Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-07-2022 08:39 AM
I am using "call n10s.onto.import.fetch" to import the ontology which I generated from Protege. In that ontology file, I refer to some existing ontology files on the internet, as shown below.
I found that I can't import this indirect ontology with "call n10s.onto.import.fetch" function, can anybody help me?
09-07-2022 12:46 PM
Hi @fan_123 , thanks for your interest!
The n10s.*.import methods don't follow import links but you can do it with a couple of lines.
All you got to do is do a second pass with the n10s.rdf.stream.* method that returns the triples in your RDF file, extract the subject, predicate, object where the predicate is owl:imports and for use the object as the URL for an n10s.onto.import.fetch request.
Here's how:
call n10s.rdf.stream.inline('http://your.onto.with.imports',"RDF/XML") yield subject, predicate, object
where predicate = "http://www.w3.org/2002/07/owl#imports"
with object as importedOntoUri
call n10s.onto.import.fetch(importedOntoUri,"RDF/XML") yield terminationStatus, triplesLoaded, extraInfo
return importedOntoUri, terminationStatus, triplesLoaded, extraInfo
I've tried it with your capabilityModel onto and I get this result:
╒══════════════════════════════════════════════════════════════════════╤═══════════════════╤═══════════════╤═══════════╕ │"importedOntoUri" │"terminationStatus"│"triplesLoaded"│"extraInfo"│ ╞══════════════════════════════════════════════════════════════════════╪═══════════════════╪═══════════════╪═══════════╡ │"https://resourcedescription.rd.tuni.fi/ontology/processTaxonomyModel"│"OK" │715 │"" │ ├──────────────────────────────────────────────────────────────────────┼───────────────────┼───────────────┼───────────┤ │"https://resourcedescription.rd.tuni.fi/ontology/commonConcepts" │"OK" │6 │"" │ └──────────────────────────────────────────────────────────────────────┴───────────────────┴───────────────┴───────────┘
Cheers,
JB.
PS: Note there are some HTTP redirection issues in some of the ontologies. https://resourcedescription.rd.tuni.fi/ontology/capabilityModel gets redirected to http://150.146.207.114/lode/extract?owlapi=true&url=https://resourcedescription.rd.tuni.fi/ontology/... causing a protocol mismatch exception.
11-02-2022 05:17 AM
Dear Jesus, thanks a lot! However, when I am using the n10s.rdf.stream.inline function, I met this error
01-26-2023 11:08 AM
The inline procedure takes RDF payload, not the url. The url is for the fetch procedures.
11-11-2022 06:33 AM
Make sure you pass to the n10s methods the url of the raw RDF (https://raw.githubusercontent.com/mf093087/Ontology/main/Ontology_EMS.ttl), not the pretty formated html version (https://github.com/mf093087/Ontology/blob/main/Ontology_EMS.ttl) otherwise the parser will not be getting Turtle, but HTML.
All the sessions of the conference are now available online