neosemantics icon indicating copy to clipboard operation
neosemantics copied to clipboard

how to export my graph to RDF

Open immusferr opened this issue 1 year ago • 3 comments

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.

immusferr avatar Mar 24 '23 09:03 immusferr

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.

jbarrasa avatar Mar 24 '23 12:03 jbarrasa

@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

immusferr avatar Mar 24 '23 13:03 immusferr