ncbo / owlapi_wrapper Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ontoportal/owlapi_wrapper
A command line utility that wraps the Java OWL-API to parse RDFS, OWL and OBO ontologies.
This project forked from ontoportal/owlapi_wrapper
A command line utility that wraps the Java OWL-API to parse RDFS, OWL and OBO ontologies.
Some of the unit test classes, e.g. TestCompleteRepo are unimplemented.
Encountering a NoClassDefFoundError when the system attempts to load and parse certain ontologies, e.g., the N-Triples version of the AGROVOC ontology (submission ID 16) hosted in AgroPortal.
The error occurs because we're running on Java 11 in production where the JAXB APIs were removed.
Full stack trace from local dev environment:
java.lang.NoClassDefFoundError: javax/xml/bind/annotation/adapters/HexBinaryAdapter
at org.eclipse.rdf4j.rio.helpers.AbstractRDFParser.createNode(AbstractRDFParser.java:479)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseNodeID(TurtleParser.java:1114)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseValue(TurtleParser.java:594)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseSubject(TurtleParser.java:429)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseTriples(TurtleParser.java:370)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseStatement(TurtleParser.java:239)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parse(TurtleParser.java:201)
at org.semanticweb.owlapi.rio.RioParserImpl.parseDocumentSource(RioParserImpl.java:229)
at org.semanticweb.owlapi.rio.RioParserImpl.parse(RioParserImpl.java:180)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyFactoryImpl.loadOWLOntology(OWLOntologyFactoryImpl.java:221)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.actualParse(OWLOntologyManagerImpl.java:1294)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1234)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:1191)
at org.stanford.ncbo.oapiwrapper.OntologyParser.findMasterFile(OntologyParser.java:594)
at org.stanford.ncbo.oapiwrapper.OntologyParser.internalParse(OntologyParser.java:513)
at org.stanford.ncbo.oapiwrapper.OntologyParser.parse(OntologyParser.java:497)
Upgrading from Java 8 to 11 would help address an issue that prevents BioPortal from loading the SWEET ontology. See: ncbo/bioportal-project#127.
When determining the version number for OWL format ontologies, the current code uses the owl:versionInfo annotation property:
This was the standard location for storing version numbers in OWL 1 ontologies, but in OWL 2 the standard is Version IRI:
https://www.w3.org/TR/owl2-syntax/#Ontology_IRI_and_Version_IRI
Code should perhaps be modified to favor Version IRI, then versionInfo as a fallback.
See also: ncbo/bioportal-project#168
Upgrade to the latest release in the OWL API 4 series.
While parsing from within an input directory, only .obo|.owl|.ttl|.xml files are taken into account, the others being filtered (see the class below).
It would be nice to expand the allowed extensions list with the following : *.n3, *.nt, *.nq, *.skos, *.rdf, *.rdfs
End users of BioPortal are supposed to be able to create a new ontology submission where the file upload portion is a ZIP file that contains multiple ontology source files.
The findLocalOntologies method correctly identifies all ontology source files in a specified input folder, and stores them in an array. However, subsequent code that handles ontology content only loads/parses the file designated as the "master" file (the -m option).
Hello,
When the parser builds the owl ontology he calls a function called addGroundMetadata
which copies ontology-level annotation axioms from the source ontology to the target ontology.
And also checks for the owl#versionInfo property. If found, adds a BioPortal-specific "versionSubject (http://bioportal.bioontology.org/ontologies/versionSubject)" annotation axiom to the target ontology.
But I don't know if it is wanted but the generated ow:Ontology will contain and mix all the annotations of all the imported ontologies.
If we take the example of cnov0_5.owl (one of the ontologies used in the tests)
<owl:Ontology rdf:about="http://purl.org/incf/ontology/Computational_Neurosciences/cno_alpha.owl">
<dc:date rdf:datatype="&xsd;string">13/03/2012</dc:date>
<dc:subject rdf:datatype="&xsd;string">An ontology to describe the field of Computational Neurosciences</dc:subject>
<dc:contributor rdf:datatype="&xsd;string">Birgit Kriener</dc:contributor>
<dc:title rdf:datatype="&xsd;string">Computational Neuroscience Ontology</dc:title>
<dc:contributor rdf:datatype="&xsd;string">Erik De Schutter</dc:contributor>
<dc:contributor rdf:datatype="&xsd;string">Fahim T. Imam</dc:contributor>
<dc:contributor rdf:datatype="&xsd;string">INCF MultiScale Modeling Task Force</dc:contributor>
<dc:contributor rdf:datatype="&xsd;string">Lars Schwabe</dc:contributor>
<dc:contributor rdf:datatype="&xsd;string">Padraig Gleeson</dc:contributor>
<dc:contributor rdf:datatype="&xsd;string">Sean Hill</dc:contributor>
<dc:contributor rdf:datatype="&xsd;string">Stephen D. Larson</dc:contributor>
<dc:contributor rdf:datatype="&xsd;string">Subhasis Ray</dc:contributor>
<rdfs:comment rdf:datatype="&xsd;string">This ontology is used to add the Definition class of annotation as in NIF.
The source of the definition can be defined with class from OBO-annotation</rdfs:comment>
<rdfs:comment rdf:datatype="&xsd;string">This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.</rdfs:comment>
<dc:creator rdf:datatype="&xsd;string">Yann Le Franc</dc:creator>
<owl:versionInfo rdf:datatype="&xsd;string">version 0.5</owl:versionInfo>
<owl:imports rdf:resource="http://ontology.neuinfo.org/NIF/Backend/OBO_annotation_properties.owl"/>
<owl:imports rdf:resource="http://ontology.neuinfo.org/NIF/Backend/ro_bfo1-1_bridge.owl"/>
-<owl:imports rdf:resource="http://protege.stanford.edu/plugins/owl/dc/protege-dc.owl"/>
-<owl:imports rdf:resource="http://purl.org/incf/ontology/Computational_Neurosciences/external_import/external.owl"/>
<owl:imports rdf:resource="http://purl.org/obo/owl/ro"/>
-<owl:imports rdf:resource="http://www.ifomis.org/bfo/1.1"/>
-<owl:imports rdf:resource="http://www.w3.org/2004/02/skos/core"/>
</owl:Ontology>
<owl:Ontology>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Alan Ruttenberg</dc:contributor>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Andrew Spear</dc:contributor>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Birgit Kriener</dc:contributor>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Erik De Schutter</dc:contributor>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Fahim T. Imam</dc:contributor>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">INCF MultiScale Modeling Task Force</dc:contributor>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Lars Schwabe</dc:contributor>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Padraig Gleeson</dc:contributor>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Pierre Grenon</dc:contributor>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Sean Hill</dc:contributor>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Stephen D. Larson</dc:contributor>
<dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Subhasis Ray</dc:contributor>
<dc:creator rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Holger Stenzhorn</dc:creator>
<dc:creator rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Yann Le Franc</dc:creator>
<dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#string">13/03/2012</dc:date>
<dc:format rdf:datatype="http://www.w3.org/2001/XMLSchema#string">application/rdf+xml</dc:format>
<dc:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">http://www.ifomis.org/bfo/1.1</dc:identifier>
<dc:language rdf:datatype="http://www.w3.org/2001/XMLSchema#string">en</dc:language>
<dc:publisher rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Institute for Formal Ontology and Medical Information Science (IFOMIS)</dc:publisher>
<dc:rights>http://creativecommons.org/licenses/by/3.0</dc:rights>
<dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Barry Smith and Pierre Grenon: "The Cornucopia of Formal Ontological Relations"</dc:source>
<dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Barry Smith: "Against Fantology"</dc:source>
<dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Barry Smith: "Basic Tools of Formal Ontology"</dc:source>
<dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Barry Smith: "Beyond Concepts: Ontology as Reality Representation"</dc:source>
<dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Pierre Grenon and Barry Smith: "SNAP and SPAN: Towards Geospatial Dynamics"</dc:source>
<dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Pierre Grenon, Barry Smith and Louis Goldberg: "Biodynamic Ontology: Applying BFO in the Biomedical Domain"</dc:source>
<dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Pierre Grenon: "BFO in a Nutshell: A Bi-categorial Axiomatization of BFO and Comparison with DOLCE"</dc:source>
<dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Pierre Grenon: "Nuts in BFO's Nutshell: Revisions to the Bi-categorial Axiomatization of BFO"</dc:source>
<dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Pierre Grenon: "Spatio-temporality in Basic Formal Ontology: SNAP and SPAN, Upper-Level Ontology, and Framework for Formalization"</dc:source>
<dc:subject rdf:datatype="http://www.w3.org/2001/XMLSchema#string">An ontology to describe the field of Computational Neurosciences</dc:subject>
<dc:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Basic Formal Ontology (BFO)</dc:title>
<dc:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Computational Neuroscience Ontology</dc:title>
<terms:contributor>Dave Beckett</terms:contributor>
<terms:contributor>Nikki Rogers</terms:contributor>
<terms:contributor>Participants in W3C's Semantic Web Deployment Working Group.</terms:contributor>
<terms:creator>Alistair Miles</terms:creator>
<terms:creator>Sean Bechhofer</terms:creator>
<terms:description xml:lang="en">An RDF vocabulary for describing the basic structure and content of concept schemes such as thesauri, classification schemes, subject heading lists, taxonomies, 'folksonomies', other types of controlled vocabulary, and also concept schemes embedded in glossaries and terminologies.</terms:description>
<terms:title xml:lang="en">SKOS Vocabulary</terms:title>
<rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string">This ontology is used to add the Definition class of annotation as in NIF.
The source of the definition can be defined with class from OBO-annotation</rdfs:comment>
<rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string">This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.</rdfs:comment>
<rdfs:seeAlso rdf:resource="http://www.w3.org/TR/skos-reference/"/>
<owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1.1.1</owl:versionInfo>
<owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#string">version 0.5</owl:versionInfo>
</owl:Ontology>
For example the <owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1.1.1</owl:versionInfo>
and <dc:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Basic Formal Ontology (BFO)</dc:title>
comes from the imported ontology http://www.ifomis.org/bfo/1.1
Current directory structure doesn't conform to Maven standard: https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html.
Protege v5.6.0 and ROBOT are using OWLAPI 4.5.24
Tips for migrating from 4 to 5.
The default logging level of metrics calculation is set to DEBUG which generates an excessive amount of logging when working with large ontologies.
We're currently using 4.3.2. The Protege application is on 4.5.9. Would be good to be on the latest version of the 4.x series
The getOBODataVersion method is only called for ontologies where the file extension ends with "obo". Some BioPortal end users submit OBO ontologies where the file extension ends in something else, like ".ontology". In these cases, the method to determine the version number isn't called, and the system later copies the version number from the previous submission, even if an updated version number exists in the ontology source file. The Mammalian Phenotype Ontology is one such example of this issue.
As of recently, the W3C started rate limiting requests to http://www.w3.org/2004/02/skos/core:
We recently adjusted our abuse prevention systems to address an excessive volume of requests from automated systems, adding up to tens of millions of requests per day.
As a side effect of this, attempting to load ontologies in BioPortal that import SKOS Core, e.g.:
<owl:imports rdf:resource="http://www.w3.org/2004/02/skos/core"/>
.... result in missing import errors in the logs:
++++++++++++++++++++++++++++++++++++++++++++++++++
Error: OWL_IMPORT_MISSING
Message: http://www.w3.org/2004/02/skos/core
++++++++++++++++++++++++++++++++++++++++++++++++++
... and intermittently failing metrics-related unit tests in the ontologies_linked_data project. See this issue: ontoportal/ontologies_linked_data#6.
Since this is an oft-imported vocabulary, I propose an initial solution of using an IRI mapper that maps to a copy of the file that we host somewhere.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.