-
Notifications
You must be signed in to change notification settings - Fork 7
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
for discussion: create nodes for ancestral species #53
Comments
For additional formality: if we have an instance-level relation (ie object property) between organisms geneological-parent-of, has-geneological-parent, and corresponding non-reflexive transitive ancestor relations, we can axiomatize
|
@balhoff came up with some SPARQL to inject this PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX in_taxon: <http://purl.obolibrary.org/obo/RO_0002162>
INSERT {
?ancestor a owl:Class .
?descendant a owl:Class .
?ancestor rdfs:subClassOf ?supertaxon .
?descendant rdfs:subClassOf ?supertaxon .
?descendant owl:disjointWith ?ancestor .
?subtaxon rdfs:subClassOf ?descendant .
?ancestor rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty in_taxon: ;
owl:someValuesFrom ?ancestor
] .
?descendant rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty in_taxon: ;
owl:someValuesFrom ?descendant
] .
[ a owl:Restriction ;
owl:onProperty in_taxon: ;
owl:someValuesFrom ?ancestor ;
owl:disjointWith [
a owl:Restriction ;
owl:onProperty in_taxon: ;
owl:someValuesFrom ?descendant
]
] .
}
WHERE {
?subtaxon rdfs:subClassOf ?supertaxon .
FILTER(isIRI(?subtaxon))
FILTER(isIRI(?supertaxon))
FILTER(STRSTARTS(STR(?subtaxon), "http://purl.obolibrary.org/obo/NCBITaxon_"))
FILTER(STRSTARTS(STR(?supertaxon), "http://purl.obolibrary.org/obo/NCBITaxon_"))
BIND(IRI(REPLACE(STR(?supertaxon), "http://purl.obolibrary.org/obo/NCBITaxon_", "http://purl.obolibrary.org/obo/NCBITaxon_Ancestor_")) AS ?ancestor)
BIND(IRI(REPLACE(STR(?supertaxon), "http://purl.obolibrary.org/obo/NCBITaxon_", "http://purl.obolibrary.org/obo/NCBITaxon_Descendant_")) AS ?descendant)
} this would require a further robot step to remove redundancy (either reduce, or reason with appropriate options) |
Here is a slight tweak to correct a problem where the additional nodes weren't being generated for leaf taxa: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX in_taxon: <http://purl.obolibrary.org/obo/RO_0002162>
INSERT {
?ancestor a owl:Class .
?descendant a owl:Class .
?ancestor rdfs:subClassOf ?supertaxon .
?descendant rdfs:subClassOf ?supertaxon .
?descendant owl:disjointWith ?ancestor .
?subtaxon rdfs:subClassOf ?descendant .
?ancestor rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty in_taxon: ;
owl:someValuesFrom ?ancestor
] .
?descendant rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty in_taxon: ;
owl:someValuesFrom ?descendant
] .
[ a owl:Restriction ;
owl:onProperty in_taxon: ;
owl:someValuesFrom ?ancestor ;
owl:disjointWith [
a owl:Restriction ;
owl:onProperty in_taxon: ;
owl:someValuesFrom ?descendant
]
] .
}
WHERE {
?supertaxon a owl:Class .
OPTIONAL {
?subtaxon rdfs:subClassOf ?supertaxon .
FILTER(isIRI(?subtaxon))
FILTER(STRSTARTS(STR(?subtaxon), "http://purl.obolibrary.org/obo/NCBITaxon_"))
}
FILTER(isIRI(?supertaxon))
FILTER(STRSTARTS(STR(?supertaxon), "http://purl.obolibrary.org/obo/NCBITaxon_"))
BIND(IRI(REPLACE(STR(?supertaxon), "http://purl.obolibrary.org/obo/NCBITaxon_", "http://purl.obolibrary.org/obo/NCBITaxon_Ancestor_")) AS ?ancestor)
BIND(IRI(REPLACE(STR(?supertaxon), "http://purl.obolibrary.org/obo/NCBITaxon_", "http://purl.obolibrary.org/obo/NCBITaxon_Descendant_")) AS ?descendant)
} |
For each intermediate node in ncbitaxon there is an implicit ancestral species/organism. Note the node itself represents a superclass that encompasses all instances of the node.
We can inject additional nodes, this is a SKETCH of how it might work
The hierarchy would still be pairwise disjoint facilitating taxon checks, see geneontology/gaferencer#81
note: any other ID scheme could be used for the inject nodes
ancestral-X would have taxrank=species, but is an OWL class whose members are individual organisms (likely all dead, except for very recently speciated species) just like other classes in the ontology.
Note: a completely orthogonal discussion is the extent to which axioms can be injected into the direct database translation. This should not be discussed here. But the proposal here could be implemented as a separate optional bridge owl file.
The text was updated successfully, but these errors were encountered: