I am trying to export some RDF from the sample northwind database using the neosemantics plugin in my neo4j desktop environment.
OS: windows 10
Desktop version: 1.2.9
Neo4j version: 4.1.0
Neosemantics version: neosemantics-4.0.0.1.jar
I run the following command in the browser:
:GET /rdf/neo4j/describe/78
I get the following error message:
Could not fetch URL: "Failed to fetch". This could be due to the remote server policy. See your web browsers error console for more information.
I think I've figured this out. The documentation states:
The only required parameter is node’s unique identifier: If the graph is the result of importing RDF using n10s it will be the uri and if the graph is not the result of importing RDF, then we’ll use the node ID. Whether we’re in one case or the other will be determied by the **presence** of a Graph Configuration (see Chapter 3, Configuring Neo4j to use RDF data)
Since I'm exporting graph data that was not the result of importing graph data I needed to delete the "graph configuration" using the following command:
call n10s.graphconfig.drop
Now I run the describe command shown above in Firefox and get the following error:
XML Parsing Error: not well-formed
Location: http://localhost:7474/rdf/neo4j/describe/78
Line Number 1, Column 1:@prefix neoind: <neo4j://individuals#> .
However if I run the same describe command in MSFT Edge I get no error and a file is downloaded with the generated RDF.
Hey John, sorry for the late reply. What did you use for your graph config? Depending on what you have set for handleVocabUris you may need to use the node's URI.
I don't think the RDF export works with neo4j desktop. According to the n10s 4.0 documentation, you need to have this line in the neo4j conf file in the server version to enable HTTP RDF export
Hi @adam_cowley, is there a solution to this problem? I got the same error when using the ':POST /rdf/neo4j/cypher' in Neo4j Browser, and got an empty RDF file when using 'describe' approach. Is it the fact that Neo4j Desktop version doesn't support RDF exporting?
Hi @hellozhengxiaochen,
if you use the following command :POST /rdf/neo4j/cypher {...} Neo4j Desktop will throw the following error:
Could not fetch URL: "Failed to fetch". This could be due to the remote server policy. See your web browsers error console for more information.
To see the resulting rdf file in Neo4j Desktop, you need to have the full URI. Since you are using Neo4j Desktop, running the following command should solve your problem: :POST http://localhost:7474/rdf/neo4j/cypher {...} .
As for the empty file, I have been using the url with describe multiple times in the past week without problem, so I'm not sure that I can help you further.
Hi @philippe.carrier22,
Many thanks for the help!
I managed to fetch some results by changing to HTTP post. A new problem appears though. Not sure if you have any idea.
I imported an ontology to Neo4j using n10s.onto.import.fetch("file:xxx.ttl","Turtle",{ handleVocabUris: "IGNORE" }) .
Then I added some new entities to the imported ontology in Neo4j.
The problem now is I can get the entities from the original ontology, but not for the newly added entities. It returns an empty result for the new ones. This is also the cause of the previous empty file issue.
It seems like you are having difficulties linking the right element to it's ontology. What I would do is mapped my ontology onto neo4j element. You can find more information here: Neo4j Mapping Documentation.
Then instead of using the ignore, this is what you would do: