ncbo / owlapi_wrapper

A command line utility that wraps the Java OWL-API to parse RDFS, OWL and OBO ontologies.
5 stars 9 forks source link

Ontology-level annotation axioms and version info #18

Open syphax-bouazzouni opened 2 years ago

syphax-bouazzouni commented 2 years ago

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.

Example

If we take the example of cnov0_5.owl (one of the ontologies used in the tests)

In the original file, we have

    <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>

The generated file contains

 <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: &quot;The Cornucopia of Formal Ontological Relations&quot;</dc:source>
        <dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Barry Smith: &quot;Against Fantology&quot;</dc:source>
        <dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Barry Smith: &quot;Basic Tools of Formal Ontology&quot;</dc:source>
        <dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Barry Smith: &quot;Beyond Concepts: Ontology as Reality Representation&quot;</dc:source>
        <dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Pierre Grenon and Barry Smith: &quot;SNAP and SPAN: Towards Geospatial Dynamics&quot;</dc:source>
        <dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Pierre Grenon, Barry Smith and Louis Goldberg: &quot;Biodynamic Ontology: Applying BFO in the Biomedical Domain&quot;</dc:source>
        <dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Pierre Grenon: &quot;BFO in a Nutshell: A Bi-categorial Axiomatization of BFO and Comparison with DOLCE&quot;</dc:source>
        <dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Pierre Grenon: &quot;Nuts in BFO&apos;s Nutshell: Revisions to the Bi-categorial Axiomatization of BFO&quot;</dc:source>
        <dc:source rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Pierre Grenon: &quot;Spatio-temporality in Basic Formal Ontology: SNAP and SPAN, Upper-Level Ontology, and Framework for Formalization&quot;</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&apos;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, &apos;folksonomies&apos;, 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

jvendetti commented 2 years ago

Theoretically, I agree that pulling in ontology-level annotations from imported ontologies doesn't seem correct. Since the original developer of this project is no longer at Stanford, I don't know if there was a historical reason for doing this, or if it's just an oversight.

Interestingly, despite what's pointed out above, the REST API appears to return the correct ontology metadata for CNO. The following call:

https://data.bioontology.org/ontologies/CNO/latest_submission?display_links=false&display_context=false&display=ontology,name,version

... returns:

{
  -"ontology": {
    -"administeredBy": [
      "https://data.bioontology.org/users/ylefranc"
    ],
    "acronym": "CNO",
    "name": "Computational Neuroscience Ontology",
    "@id": "https://data.bioontology.org/ontologies/CNO",
    "@type": "http://data.bioontology.org/metadata/Ontology"
  },
  "version": "version 0.5",
  "@id": "https://data.bioontology.org/ontologies/CNO/submissions/8",
  "@type": "http://data.bioontology.org/metadata/OntologySubmission"
}

This could simply be a product of the end user manually entering the metadata when they submitted their ontology through the Rails application, which would initialize these values from the form data.

ncbo-deployer commented 2 years ago

I suspect that neither the call you give here nor the call that you presented in the chat https://data.bioontology.org/ontologies/CNO/latest_submission?display_links=false&display_context=false&include=all represent ontology annotations. They both lack the wealth of Dublin core source annotations and the call you present in the chat presents annotations not found in the ontology. I verified syphax’s claim by looking at the owlxml file for cno from the production system.

Interestingly, despite what's pointed out above, the REST API appears to return the correct ontology metadata for CNO. This is puzzling but your explanation must be correct.

-Timothy

From: bioontology-admin @.> on behalf of Jennifer Vendetti @.> Date: Wednesday, August 3, 2022 at 11:30 AM To: ncbo/owlapi_wrapper @.> Cc: Subscribed @.> Subject: Re: [bioontology-admin] [ncbo/owlapi_wrapper] Ontology-level annotation axioms and version info (Issue #18)

Theoretically, I agree that pulling in ontology-level annotations from imported ontologies doesn't seem correct. Since the original developer of this project is no longer at Stanford, I don't know if there was a historical reason for doing this, or if it's just an oversight.

Interestingly, despite what's pointed out above, the REST API appears to return the correct ontology metadata for CNO. The following call:

https://data.bioontology.org/ontologies/CNO/latest_submission?display_links=false&display_context=false&display=ontology,name,version

... returns:

{

-"ontology": {

-"administeredBy": [

  "https://data.bioontology.org/users/ylefranc"

],

"acronym": "CNO",

"name": "Computational Neuroscience Ontology",

***@***.***": "https://data.bioontology.org/ontologies/CNO",

***@***.***": "http://data.bioontology.org/metadata/Ontology"

},

"version": "version 0.5",

@.***": "https://data.bioontology.org/ontologies/CNO/submissions/8",

@.***": "http://data.bioontology.org/metadata/OntologySubmission"

}

This could simply be a product of the end user manually entering the metadata when they submitted their ontology through the Rails application, which would initialize these values from the form data.

— Reply to this email directly, view it on GitHubhttps://github.com/ncbo/owlapi_wrapper/issues/18#issuecomment-1204329185, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAP2LDRGQUZY7LABKDNAGLDVXK3DFANCNFSM55BDGMBQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

syphax-bouazzouni commented 1 year ago

Hi @jvendetti , @stdotjohn

Do you have any restrictions, if I remove this behavior (or at least make it optional)

If you want the detailed reason for the "why", you can see this https://github.com/agroportal/project-management/issues/340

jvendetti commented 1 year ago

Merging in the ontology-level annotations from imported ontologies doesn't seem correct. I guess I would lean toward removing this behavior instead of making it optional. If that change is made and all of the unit tests for ontologies_linked_data and ontologies_api pass, then I think we'd be OK.