sap218 / jabberwocky

NLP toolkit for those nonsensical ontologies
https://sap218.github.io/jabberwocky/
MIT License
16 stars 1 forks source link

Supported ontology formats and synonym properties #12

Closed balhoff closed 4 years ago

balhoff commented 4 years ago

Can you say which ontology formats are meant to work? I see that the pocket monsters example is in OWL/XML. I tried some other formats with catch (RDF/XML, TTL, OFN) and they all gave the same output. I was kind of surprised, but I guess it's using only the terms in listofwords.txt and not finding synonyms in the ontology? When I run with the OFN format file, I don't see any synonyms in ontology_dict_class_synonyms.json. I think it would be good to document supported ontology formats, especially since OWL/XML is a fairly uncommon format.

Related question: I made my own OWL/XML file with a single term 'eye' and used the annotation property http://www.geneontology.org/formats/oboInOwl#hasExactSynonym to add synonym 'visual organ'. I don't see this being found and added to ontology_dict_class_synonyms.json.

Here is the ontology I used:

<?xml version="1.0"?>
<Ontology xmlns="http://www.w3.org/2002/07/owl#"
     xml:base="http://example.org/ontologies/2020/4/28/untitled-ontology-1490"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     ontologyIRI="http://example.org/ontologies/2020/4/28/untitled-ontology-1490">
    <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
    <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <Prefix name="xml" IRI="http://www.w3.org/XML/1998/namespace"/>
    <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
    <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
    <Declaration>
        <Class IRI="/eye"/>
    </Declaration>
    <Declaration>
        <AnnotationProperty IRI="http://www.geneontology.org/formats/oboInOwl#hasExactSynonym"/>
    </Declaration>
    <AnnotationAssertion>
        <AnnotationProperty IRI="http://www.geneontology.org/formats/oboInOwl#hasExactSynonym"/>
        <IRI>/eye</IRI>
        <Literal>visual organ</Literal>
    </AnnotationAssertion>
    <AnnotationAssertion>
        <AnnotationProperty abbreviatedIRI="rdfs:label"/>
        <IRI>/eye</IRI>
        <Literal>eye</Literal>
    </AnnotationAssertion>
</Ontology>

(this is part of JOSS review openjournals/joss-reviews#2168)

sap218 commented 4 years ago

Will make a list of types of ontologies it works with!

Also the reason your own created ontology doesn't work is because your "hasExactSynonym" is not following the rdfs schema, it should be defined as "rdfs:hasExactSynonym" - I can include this is the documentation

sap218 commented 4 years ago

I have included supported ontology formats in the README: owl including owl/xml and rdf/xml - I hope this helps @balhoff :-)

Edit: I also included information about RDF schema in the README

sap218 commented 4 years ago

Update: turns out I was wrong about "rdfs:synonym" annotations - my apologies! Your example is correct, I just need to fix it :-) I will look into making it user specified. Thanks!

sap218 commented 4 years ago

@balhoff I have now fixed the annotations issue, your ontology will work now if you include <Prefix name="oboInOWL" IRI="http://www.geneontology.org/formats/oboInOWL#"/> and ensure the Owl is all caps.

balhoff commented 4 years ago

Excellent, thanks!