# Exporting RDF with 4.0 and 3.5.x

**URL:** <https://community.neo4j.com/t/exporting-rdf-with-4-0-and-3-5-x/17674>\
**Category:** Linked Data, RDF, Ontology\
**Created:** [April 27, 2020, 4:35pm UTC](https://community.neo4j.com/t/exporting-rdf-with-4-0-and-3-5-x/17674 "2020-04-27T16:35:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_moquin](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/r_moquin/32/8731_2.png) [@r\_moquin](https://community.neo4j.com/u/r_moquin)\
**Post date:** [April 27, 2020, 4:35pm UTC](https://community.neo4j.com/t/exporting-rdf-with-4-0-and-3-5-x/17674/1 "2020-04-27T16:35:26Z")

</div>

Hi Jesus,

I've playing around with exporting data with Neosemantics and had a question:

1. Does Neosemantics expand the prefixes in properties when you try to export some RDF? For example, if I tried something like:

call n10s.rdf.export.cypher("match(n:skos\_\_ConceptScheme{uri:'[MySchema.com is for sale | HugeDomains](http://myschema.com/myvocabulary)'}) return n")

Then I'll see:

| subject | predicate | object | isLiteral | literalType | literalLang |
| --- | --- | --- | --- | --- | --- |
| "neo4j://individuals#1965" | "[http://www.w3.org/1999/02/22-rdf-syntax-ns#type](http://www.w3.org/1999/02/22-rdf-syntax-ns#type)" | "neo4j://vocabulary#skos\_\_ConceptScheme" | false | null | null |
| "neo4j://individuals#1965" | "neo4j://vocabulary#uri" | "[MySchema.com is for sale | HugeDomains](http://myschema.com/myvocabulary)" | true | "[XML Schema](http://www.w3.org/2001/XMLSchema#string)" | null |
| "neo4j://individuals#1965" | "neo4j://vocabulary#rdfs\_\_label" | "My Test Vocabulary Name" | true | "[XML Schema](http://www.w3.org/2001/XMLSchema#string)" | null |
| "neo4j://individuals#1965" | "[http://www.w3.org/1999/02/22-rdf-syntax-ns#type](http://www.w3.org/1999/02/22-rdf-syntax-ns#type)" | "neo4j://vocabulary#Resource" | false | null | null |

In looking at the code, it appears as if Neosemantics things that the nodes being exported are not RDF nodes and therefore the property names aren't being converted back into RDF properly? I'm guessing that's somehow my issue, I can just can't figure out why that is happening though?

I thought I would try to do the above using the http api for Neosemantics, I tried a bunch of different things such as, [http://localhost:7474/rdf/describe/uri/http://myschema.com/myvocabulary](http://localhost:7474/rdf/describe/uri/http://myschema.com/myvocabulary) and [http://localhost:7474/rdf/n10s/neo4j/describe/uri/http://myschema.com/myvocabulary](http://localhost:7474/rdf/n10s/neo4j/describe/uri/http://myschema.com/myvocabulary) (from looking at the unit tests) but keep getting a 404. So I'm not really sure how to use the extension via http. I can however get the ping to work if I hit the /rdf/n10s/ping context path.

I see the same behavior with the export using 3.5.x as well.

Is there something particular that is needed to export RDF that conforms to what was loaded? Hopefully I haven't missed anything silly. I did comb through the current docs and the new docs without any luck so far.

Thanks!  
Ryan

---

<div class="post-metadata">

**Author:** ![jesus\_barrasa](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jesus_barrasa/32/27513_2.png) [@jesus\_barrasa](https://community.neo4j.com/u/jesus_barrasa)\
**Post date:** [April 28, 2020, 1:14am UTC](https://community.neo4j.com/t/exporting-rdf-with-4-0-and-3-5-x/17674/2 "2020-04-28T01:14:10Z")

</div>

Hi @r_moquin, you're right the `n10s.rdf.export.cypher` method at the moment only exports RDF from a Property Graph model. But I expect to have its behavior fixed for the GA release by the end of the week.

In 4.0 you can achieve it using the RDF http endpoint. Here's how:

```auto
:post http://localhost:7474/rdf/n10s/mydb/cypher
{ "cypher" : "match p = (r:Resource { uri: 'http://neo4j.org/ind#nsmntx3502'})--() return p " , "format": "Turtle" }

```

where mydb is the name of the database you're using (`'neo4j'` if it's the default one).

Similarly, for the describe method, you can invoke it as follows:  
`:get http://localhost:7474/rdf/n10s/mydb/describe/xxxxxxx`

where `mydb` is again your db name and `xxxx` is the 'URL encoded' URI of the resource you want to get serialised. You can do the encoding programmatically or for testing you can use [this page](https://www.urlencoder.org/).

By using the endpoint, you should get exactly the RDF you imported, triple by triple.

(for 3.5 you can check the documentation [here](https://neo4j.com/docs/labs/nsmntx/3.5/export/))

Sorry for the difficulties you're finding but this will all be described properly in the documentation, bear with us, we're getting there ;-)

Hope this helps, please let me know if there's anything unclear.

Cheers,

JB.

---

<div class="post-metadata">

**Author:** ![r\_moquin](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/r_moquin/32/8731_2.png) [@r\_moquin](https://community.neo4j.com/u/r_moquin)\
**Post date:** [April 28, 2020, 2:41pm UTC](https://community.neo4j.com/t/exporting-rdf-with-4-0-and-3-5-x/17674/3 "2020-04-28T14:41:15Z")

</div>

You don't need to apologize. I'm just very thankful that you are so responsive and helpful. :) Documentation is very time consuming and is a lot of work in addition to the development work that needs done.

This is why I try to make sure that I look through documentation when it is available, to minimize the chance of wasting someone's time asking a question that already spent time to answer in their documentation. ;)

I get what I was doing wrong now, I feel silly. Because I didn't url encode the IRI, the IRI was being interpreted as an additional sequence of paths in the url. I'm used to web browsers auto encoding characters as needed in **parameters** but completely forgot the web browser doesn't know what part of a path in a URI is a dynamic parameter and might need encoded.

My bad. It looks much better if I hit the URL directly. The only initial thing I'll mention, but I'm sure you know this, is that the neo4j prefixes that are added, are added whether or not they are used in the rdf response or not. That is an extremely trivial thing though. 🙂

I'm looking forward to the release of 4.0. Thanks for all the work you put you into this!

Ryan

Ryan
