-
Notifications
You must be signed in to change notification settings - Fork 12
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
Should genusIds be optional in logicalDefinitionAxioms? #89
Comments
2 |
Can you provide a chunk of OWL to test this. Also, I presume its ok for the restrictions to be empty? |
* Adding documentation for logical definition axioms in obograph. See geneontology/obographs#89 * Enhancements for ontology statistics Including contributor statistics, fixes #378 Allowing diff statistics to be folded into general statistics * lint
@julesjacobsen here is a junk of OWL: I presume this:
I am assuming you are asking about C2? |
@julesjacobsen I have some OWL below you can look at. I had opened up an issue in robot (ontodev/robot#1079), and Nico felt the root of my issue lies here, with Obographs. Below is a copy/paste of what I wrote. Although I had thought that this issue was not pertaining specifically to OverviewI am converting an OWL file to Obographs JSON. I was then using that JSON for something else, and I encountered an error because Command
InputSnippet of the Sub-snippet: <owl:Restriction>
<owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000051"/>
<owl:someValuesFrom>
<owl:Restriction>
<owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000050"/>
<owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0009768"/>
</owl:Restriction>
</owl:someValuesFrom>
</owl:Restriction> The full axiom: <owl:Axiom>
<owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/UBERON_0009551"/>
<owl:annotatedProperty rdf:resource="http://www.w3.org/2002/07/owl#equivalentClass"/>
<owl:annotatedTarget>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://purl.obolibrary.org/obo/UBERON_0002529"/>
<owl:Restriction>
<owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000050"/>
<owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0002544"/>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000051"/>
<owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0004300"/>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000051"/>
<owl:someValuesFrom>
<owl:Restriction>
<owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000050"/>
<owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0009768"/>
</owl:Restriction>
</owl:someValuesFrom>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:annotatedTarget>
<oboInOwl:source>cjm</oboInOwl:source>
</owl:Axiom> OutputWithin {
"definedClassId" : "http://purl.obolibrary.org/obo/UBERON_0009551",
"genusIds" : [ "http://purl.obolibrary.org/obo/UBERON_0002529" ],
"restrictions" : [ {
"propertyId" : "http://purl.obolibrary.org/obo/BFO_0000050",
"fillerId" : "http://purl.obolibrary.org/obo/UBERON_0002544"
}, {
"propertyId" : "http://purl.obolibrary.org/obo/BFO_0000051",
"fillerId" : "http://purl.obolibrary.org/obo/UBERON_0004300"
}, null ]
} |
@joeflack4 your issue and the |
This is consistent with JSON files found in the wild. See also geneontology/obographs#89 and linkml/linkml#1156
In INCATools/ontology-access-kit#414 I am making genusIds recommended rather than required, as it's important to be consistent with json already released. However I think it is better to capture these axioms differently |
…nal (#414) * Added allValuesFromEdges to OBO Graph data model. Note these are currently treated distinct from the core edges, which is intentional. Graph operations should typically not operate over universal restrictions. * Made genusIds optional in logical definition axioms. This is consistent with JSON files found in the wild. See also geneontology/obographs#89 and linkml/linkml#1156 * make restrictions recommended * Adding test * placing AVF under domaonRangeAxioms * update maxo notebook * temp skip translator test as service unavailable * allow for case insensitive search * allow for case insensitive search * remove print * annotator whole text match should be case insensitive * lint * lint
@joeflack4 @cmungall @matentzn I'm failing to reproduce this <?xml version="1.0"?>
<rdf:RDF xmlns="http://purl.obolibrary.org/obo/uberon.owl#"
xml:base="http://purl.obolibrary.org/obo/uberon.owl"
xmlns:obo="http://purl.obolibrary.org/obo/"
xmlns:oboInOwl="http://www.geneontology.org/formats/oboInOwl#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<owl:Ontology rdf:about="http://purl.obolibrary.org/obo/uberon.owl">
<owl:versionIRI rdf:resource="http://purl.obolibrary.org/obo/uberon/releases/2022-12-13/uberon.owl"/>
</owl:Ontology>
<owl:Axiom>
<owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/UBERON_0009551"/>
<owl:annotatedProperty rdf:resource="http://www.w3.org/2002/07/owl#equivalentClass"/>
<owl:annotatedTarget>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://purl.obolibrary.org/obo/UBERON_0002529"/>
<owl:Restriction>
<owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000050"/>
<owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0002544"/>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000051"/>
<owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0004300"/>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000051"/>
<owl:someValuesFrom>
<owl:Restriction>
<owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000050"/>
<owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0009768"/>
</owl:Restriction>
</owl:someValuesFrom>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:annotatedTarget>
<oboInOwl:source>cjm</oboInOwl:source>
</owl:Axiom>
</rdf:RDF> when converted to JSON using OWLOntologyManager m = OWLManager.createOWLOntologyManager();
OWLOntology ontology = m.loadOntologyFromOntologyDocument(new ByteArrayInputStream(axiom.getBytes(StandardCharsets.UTF_8)));
GraphDocument graphDocument = new FromOwl().generateGraphDocument(ontology);
System.out.println(OgJsonGenerator.render(graphDocument)); gives me {
"graphs" : [ {
"id" : "http://purl.obolibrary.org/obo/uberon.owl",
"meta" : {
"version" : "http://purl.obolibrary.org/obo/uberon/releases/2022-12-13/uberon.owl"
},
"logicalDefinitionAxioms" : [ {
"definedClassId" : "http://purl.obolibrary.org/obo/UBERON_0009551",
"genusIds" : [ "http://purl.obolibrary.org/obo/UBERON_0002529" ],
"restrictions" : [ {
"propertyId" : "http://purl.obolibrary.org/obo/BFO_0000050",
"fillerId" : "http://purl.obolibrary.org/obo/UBERON_0002544"
}, {
"propertyId" : "http://purl.obolibrary.org/obo/BFO_0000051",
"fillerId" : "http://purl.obolibrary.org/obo/UBERON_0004300"
} ]
} ]
} ]
} i.e. no <rdf:Description rdf:about="http://purl.obolibrary.org/obo/UBERON_0002529"/> results in this JSON output: {
"graphs" : [ {
"id" : "http://purl.obolibrary.org/obo/uberon.owl",
"meta" : {
"version" : "http://purl.obolibrary.org/obo/uberon/releases/2022-12-13/uberon.owl"
},
"logicalDefinitionAxioms" : [ {
"definedClassId" : "http://purl.obolibrary.org/obo/UBERON_0009551",
"restrictions" : [ {
"propertyId" : "http://purl.obolibrary.org/obo/BFO_0000050",
"fillerId" : "http://purl.obolibrary.org/obo/UBERON_0002544"
}, {
"propertyId" : "http://purl.obolibrary.org/obo/BFO_0000051",
"fillerId" : "http://purl.obolibrary.org/obo/UBERON_0004300"
} ]
} ]
} ]
} No Could it be something to do with the way ROBOT is loading the ontology? |
I thought I had the newest version, but it looks like I was using 1.8.1 and not 1.9+. I know I used a pretty simple command to do this, though. Sorry I don't have more time to look into at the moment. Feel free to close and I can reopen if still an issue. |
I think we can close this. SummaryNo changes to be made to obographs. NULL in JSON outputobographs 0.3.0+ will not write out Missing
|
@Nullable | |
private ExistentialRestrictionExpression getRestriction(OWLClassExpression x) { | |
if (x instanceof OWLObjectSomeValuesFrom) { | |
OWLObjectSomeValuesFrom r = (OWLObjectSomeValuesFrom) x; | |
OWLPropertyExpression p = r.getProperty(); | |
OWLClassExpression f = r.getFiller(); | |
if (p instanceof OWLObjectProperty && !f.isAnonymous()) { | |
return new ExistentialRestrictionExpression.Builder() | |
.propertyId(getPropertyId((OWLObjectProperty) p)) | |
.fillerId(getClassId((OWLClass) f)) | |
.build(); | |
} | |
// n.b nested OWLObjectSomeValuesFrom will be removed from the output. These can be found by testing that | |
// f instanceof OWLObjectSomeValuesFrom | |
} | |
return null; | |
} |
Thank you @julesjacobsen. I'm confused on 1 point though; you mentioned that there should never be instances of |
@joeflack4 yes, the function returns a @matentzn if you're satisfied with all this, please close... |
@julesjacobsen thank you for working on this :). So basically, to address monarch-initiative/MAxO#362, we need to change OAK/Pronto! |
Currently, we cant open several obographs json files, see also monarch-initiative/MAxO#362, because of this error:
Here is an extract of the related section in the ontology:
What is the right thing to do here?
The text was updated successfully, but these errors were encountered: