Skip to content

Commit

Permalink
Merge pull request #26329 from geneontology/never-in-taxon-redundancy
Browse files Browse the repository at this point in the history
Improve redundancy check for computed never-in-taxon.
  • Loading branch information
balhoff authored Oct 28, 2023
2 parents 42fd58f + 9ae0006 commit ea952a0
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions src/sparql/taxon-constraints-never-in-taxon-annotation.rq
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,34 @@ WHERE {
FILTER(STRENDS(STR(?taxon_complement), "#NOT"))
BIND(IRI(STRBEFORE(STR(?taxon_complement), "#NOT")) AS ?taxon)
FILTER (
EXISTS {
?term rdfs:subClassOf+ [
a owl:Restriction ;
owl:onProperty in_taxon: ;
owl:someValuesFrom ?super_taxon
] .
FILTER(!STRENDS(STR(?super_taxon), "#NOT"))
?taxon rdfs:subClassOf+ ?super_taxon .
}
# only include computed never-in-taxon if...
(
# there is a computed in-taxon that is a superclass of the never...
EXISTS {
?term rdfs:subClassOf+ [
a owl:Restriction ;
owl:onProperty in_taxon: ;
owl:someValuesFrom ?super_taxon
] .
FILTER(!STRENDS(STR(?super_taxon), "#NOT"))
?taxon rdfs:subClassOf+ ?super_taxon .
}
&&
# and there is not another computed in-taxon that is not a superclass of the never...
NOT EXISTS {
?term rdfs:subClassOf+ [
a owl:Restriction ;
owl:onProperty in_taxon: ;
owl:someValuesFrom ?super_taxon
] .
FILTER(!STRENDS(STR(?super_taxon), "#NOT"))
FILTER NOT EXISTS {
?taxon rdfs:subClassOf+ ?super_taxon .
}
}
)
||
# or else if there are no computed in-taxon
NOT EXISTS {
?term rdfs:subClassOf+ [
a owl:Restriction ;
Expand Down

0 comments on commit ea952a0

Please sign in to comment.