Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semantics.importRDF didn't import the example openfoodfacts #31

Closed
ricarezende opened this issue Jun 30, 2017 · 19 comments
Closed

Semantics.importRDF didn't import the example openfoodfacts #31

ricarezende opened this issue Jun 30, 2017 · 19 comments

Comments

@ricarezende
Copy link

@ricarezende ricarezende commented Jun 30, 2017

Hello Jesus.
The openfoodfacts example you used on the blog post cannot be imported.
I called the procedure on the following way:
CALL semantics.importRDF("http://fr.openfoodfacts.org/data/fr.openfoodfacts.org.products.rdf","RDF/XML", {languageFilter: 'fr', commitSize: 25000})
But neo4j show KO status, 0 triples loaded and an extra info: unqualified property element not allowed [line 2, column 14]

image

@jbarrasa
Copy link
Collaborator

@jbarrasa jbarrasa commented Jul 3, 2017

Hi, any chance it has anything to do with this (#4 (comment)) ?

I remember a while ago we noticed that the dump contained some invalid characters that failed at parse time. It does not look like it though, by the error message in your screen capture.

Could you please share the full stack trace from the logs?

Thanks!

JB.

@ricarezende
Copy link
Author

@ricarezende ricarezende commented Jul 3, 2017

Hello.
What do you mean by "full stack trace"?
Where can I find it?
I re-ran the same import and here is the "Text" view:
╒═══════════════════╤═══════════════╤══════════════════════════════════════════════════════════════════════╤═════════════════════════════════════════════════════════════════════╕
│"terminationStatus"│"triplesLoaded"│"namespaces" │"extraInfo" │
╞═══════════════════╪═══════════════╪══════════════════════════════════════════════════════════════════════╪═════════════════════════════════════════════════════════════════════╡
│"KO" │0 │{"http://fr.openfoodfacts.org/data/fr.openfoodfacts.org.products.rdf#"│"unqualified property element not allowed [line 2, column 14]"│
│ │ │:"ns0"} │ │
└───────────────────┴───────────────┴──────────────────────────────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────┘

And the "Code" view:
Server version Neo4j/3.2.1
Server address 64.137.161.67:7687
Query CALL semantics.importRDF("http://fr.openfoodfacts.org/data/fr.openfoodfacts.org.products.rdf","RDF/XML", {languageFilter: 'fr', commitSize: 25000})
Response
[
{
"keys": [
"terminationStatus",
"triplesLoaded",
"namespaces",
"extraInfo"
],
"length": 4,
"_fields": [
"KO",
{
"low": 0,
"high": 0
},
{
"http://fr.openfoodfacts.org/data/fr.openfoodfacts.org.products.rdf#": "ns0"
},
"unqualified property element not allowed [line 2, column 14]"
],
"_fieldLookup": {
"terminationStatus": 0,
"triplesLoaded": 1,
"namespaces": 2,
"extraInfo": 3
}
}
]

@ricarezende
Copy link
Author

@ricarezende ricarezende commented Jul 3, 2017

For instance, I just ran CALL semantics.importRDF("http://www.w3.org/2004/08/TalkFiles/2005/Talks.rdf","RDF/XML", {commitSize: 2500}) and it worked. :S

@jbarrasa
Copy link
Collaborator

@jbarrasa jbarrasa commented Jul 3, 2017

Hi, I've found what the problem is.
The url is returning a 301 response (moved permanently) and the importRDF procedure is not following redirection so it's trying to parse the error message:

If you try on the command line interface the url (with curl for example) curl http://fr.openfoodfacts.org/data/fr.openfoodfacts.org.products.rdf you get this:

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>

The procedure is trying to parse this as RDF and is obviously failing :(

You can do two things:

  1. download the rdf file locally and then refer to it with a file://... url
  2. use the new url (same but with https): semantics.importRDF("https://fr.openfoodfacts.org/data/fr.openfoodfacts.org.products.rdf","RDF/XML", {languageFilter: 'fr', commitSize: 25000})

Enjoy!

JB.

@jbarrasa jbarrasa closed this Jul 3, 2017
@jbarrasa
Copy link
Collaborator

@jbarrasa jbarrasa commented Jul 3, 2017

Ah, and for future reference, the complete logs will be found in the neo4j.log file in the logs directory on your Neo4j home directory.
<neo_home>/logs/neo4j.log

Cheers,

JB.

@eayan
Copy link

@eayan eayan commented Feb 1, 2018

Hi,

I am trying to visualize .rdf over neo4j but continuously I take a syntax error as you may see in the attached screen shot. Does anyone know about a way to solve that problem?

Best...

Erdal Ayan, M.A.-M.Sc.

selection_018

@jbarrasa
Copy link
Collaborator

@jbarrasa jbarrasa commented Feb 4, 2018

The procedure requires 3 parameters and you seem to be combining the last two into one single string. Probably the easiest for you would be to do
CALL semantics.importRDF("....your file...", "RDF/XML", {} )
Now if for whatever reason you want to set the periodicity of commits to 500 (assuming that's what your 500 means) all you'd need to do is use { commitSize: 500 } instead of the empty brackets in the previous example.
Please, have a look at the documentation in the readme file. You'll find some usage examples.

@eayan
Copy link

@eayan eayan commented Feb 5, 2018

Dear J.Barrasa,

I have solved the problem when I have changed the commit size into 5000 and nodeCacheSize as 250000. I could simply import and visualize the data. Thank you so much.

Best...

Erdal Ayan, M.A.-M.Sc.

@cj1406942109
Copy link

@cj1406942109 cj1406942109 commented Oct 8, 2018

Hello Jesus.
I called the procedure on the following way:
CALL semantics.importRDF("http://fr.openfoodfacts.org/data/fr.openfoodfacts.org.products.rdf","RDF/XML", {languageFilter: 'fr', commitSize: 25000})
But neo4j show KO status, 0 triples loaded and an extra info: unqualified property element not allowed [line 2, column 14]

And I tried two methods you mentioned above:
both local file file:///.../fr.openfoodfacts.org.products.rdf and new url https://fr.openfoodfacts.org/data/fr.openfoodfacts.org.products.rdf.

But neo4j still shows KO status, 0 triples loaded, namespaces { "http://purl.org/dc/terms/": "ns1", "http://data.lirmm.fr/ontologies/food#": "ns2", "http://rdfs.org/ns/void#": "ns0" } and an extra info:"在实体引用中, 实体名称必须紧跟在 '&' 后面。 [line 2514, column 94]"

image

Is there anything not correct?

@jbarrasa
Copy link
Collaborator

@jbarrasa jbarrasa commented Oct 8, 2018

I seem to remember that the fr.openfoodfacts.org.products.rdf file was not valid RDF. It produced some parsing errors.
If i run call semantics.streamRDF("https://fr.openfoodfacts.org/data/fr.openfoodfacts.org.products.rdf", "RDF/XML", {}) it streams the first 1K triples without problems but there must be something wrong later on in the file.
Can you try that the RDF import works with another RDF file? For example the English version of the openfoodfacts dataset?
Here's the url: https://world.openfoodfacts.org/data/en.openfoodfacts.org.products.rdf

Let me know how it goes.

JB.

@cj1406942109
Copy link

@cj1406942109 cj1406942109 commented Oct 8, 2018

I tried the English version of the dataset, but I got another problem...
image

@jbarrasa
Copy link
Collaborator

@jbarrasa jbarrasa commented Oct 9, 2018

Yep, that's not a valid URI, it contains whitespaces. The openfoodfacts datasets seem to be both broken. Probably worth raising it as an issue to the openfoodfacts admins?
What are you trying to achieve? If what you want is try to load some RDF, then I'd recommend you try another dataset.

@cj1406942109
Copy link

@cj1406942109 cj1406942109 commented Oct 11, 2018

I tried some other local RDF files, and it worked. Thanks for your help.

@shwetank2174
Copy link

@shwetank2174 shwetank2174 commented Jul 9, 2019

@cj1406942109 I am unable to load a local RDF file instead I am able to load files with weblink.
I am using
Create Index On :Resource(uri)
Call semantics.importRDF("file:///Users/..../opentox-example.owl", "RDF/XML")
It shows the following error.
image

I have checked it and the file is located in the same location.
How shall I approach?

@jbarrasa
Copy link
Collaborator

@jbarrasa jbarrasa commented Jul 9, 2019

check on a terminal ls -arlt /Users/ssharan3/... that the file does not have any additional extensions (.owl.xml or .owl.txt ...)

Double (triple,etc..) check that the path is correct. If it says this file is not there... it's probably because it is not there :)

Check other files on other locations on your drive?

@shwetank2174
Copy link

@shwetank2174 shwetank2174 commented Jul 11, 2019

I am able to locate the file and it exists there. Because I am copying the path directly so again rules out the possibility of manual error. I am able to ping the same path in browser and access the .owl file. So, I think it should be there only. Moreover, I also don't understand why termination status {KO}?
And the file doesn't have any other extension as well.

@ManelBM
Copy link

@ManelBM ManelBM commented Aug 18, 2020

Hello, I need your help :)
I am trying to import onto in neo4j.
I followed the documentation on neo4j labs portal:


terminationStatus triplesLoaded triplesParsed namespaces extraInfo callParams
1 "KO" 0 0 null "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

  • then I tried to save the owl file locally (in db import folder) then tried this cypher code
    CALL n10s.onto.import.fetch("file://vw.owl","Turtle")
    and got this:

terminationStatus triplesLoaded triplesParsed namespaces extraInfo callParams
1 "KO" 0 0 null "vw.owl"

No more details in logs and I wonder what is missing.

@jbarrasa
Copy link
Collaborator

@jbarrasa jbarrasa commented Aug 18, 2020

Hi @ManelBM , you have to provide an absolute path, not the one relative to the import directory.
Something like this (notice the triple forward slash ///) :
CALL n10s.onto.import.fetch("file:///Users/jb/myfolder/vw.owl","Turtle");

But I'm with you, the extraInfo does not provide any help understanding what's going on.
We'll try to address that asap.

Cheers,

JB.

@ManelBM
Copy link

@ManelBM ManelBM commented Aug 18, 2020

Great it works. Many thanks to you :)
I have maybe another question concerning GraphQl, I installed manually the plugin (knowing that I have the last version of neo4j (4.1) and I tried the command CALL graphql.idl(null) to generate automatically the graphql schema but it is not working. I tried Call procedures to check that all graphql procedures are there and it is the case.
Is it linked to neo4j version ? Should I rather use neo4j-graphql.js to make it work ?

here what I got
Neo.ClientError.Procedure.ProcedureCallFailed
Failed to invoke procedure graphql.idl: Caused by: java.lang.NoSuchMethodError: 'org.neo4j.graphdb.DependencyResolver org.neo4j.kernel.internal.GraphDatabaseAPI.getDependencyResolver()'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants