neo4j-labs / neosemantics

Graph+Semantics: Import/Export RDF from Neo4j. SHACL Validation, Model mapping and more.... If you like it, please ★ ⇧
https://neo4j.com/labs/neosemantics/
Apache License 2.0
797 stars 139 forks source link

how to export my graph to RDF #303

Open immusferr opened 1 year ago

immusferr commented 1 year ago

Hi, I am pretty new to Neo4j and the Graph Data Science Library. And I want to export the whole graph from my neo4j graph into RDF format. I studied the n10s documentation and tried to use

call n10s.rdf.export.cypher("match(n) return n",{stream:True}) and call n10s.rdf.export.cypher("MATCH (n)-[r]-(m) RETURN n,r, m")

But none of them work, and the query results are empty.

jbarrasa commented 1 year ago

Hi, the use of the two procedures looks right so probably the problem is elsewhere. Can you provide more context, please? Some way of reproducing the issue? The only way these procedures can return empty results is if the DB is empty.

immusferr commented 1 year ago

@jbarrasa Hi jesus, thanks for the reply. I am using neo4j server 4.3.3 and neosemantics 4.3.0.2. I want to export all my graph data as a whole to rdf format file. After reading your awesome guidebook, I checked all the data in neo4j with match(n) return n and the result is as follows: image

There are indeed some data in the Neo4j. Then I try to use call n10s.rdf.export.cypher("match(n) return n",{stream:True}) export command, and the result is as follows: image

The same scenario happened on the procedure call n10s.rdf.export.cypher("MATCH (n)-[r]-(m) RETURN n,r, m"): image

And I would like to ask an additional question if I want to export the output in rdf format to a file, is the call n10s.rdf.export.cypher("match(n) return n",{stream:True, format: 'RDF/XML', file:'output.rdf' } ) command the correct one?

Thanks, huxl