Skip to content

Commit

Permalink
Include taxon unions in taxon constraint precomputation. (#28944)
Browse files Browse the repository at this point in the history
  • Loading branch information
balhoff authored Sep 17, 2024
1 parent 7704e0f commit dfdab08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/ontology/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ basic.facts: go-basic.owl
riot -q --output=ntriples $< | sed 's/ /\t/' | sed 's/ /\t/' | sed 's/ \.$$//' >$@

basic-cycles.tsv: basic.facts ../util/cycles.dl
souffle ../util/cycles.dl && mv cycle.csv $@ &&\
souffle -c ../util/cycles.dl && mv cycle.csv $@ &&\
( [ -s $@ ] && { cat $@; exit 1; } || true ) # exit with an error if the output is not empty

# ----------------------------------------
Expand Down Expand Up @@ -386,7 +386,7 @@ imports/go-computed-taxon-constraints.owl: $(SRC) $(SPARQLDIR)/taxon-constraints
$(ROBOT) merge -i $< query --update $(SPARQLDIR)/taxon-constraints-materialization.ru -o taxon-constraints-materialization-temp.ofn &&\
JAVA_OPTS=-Xmx12G relation-graph --ontology-file taxon-constraints-materialization-temp.ofn --output-file taxon-constraints-materialization-temp.nt --property 'http://purl.obolibrary.org/obo/RO_0002162' --output-subclasses true --reflexive-subclasses false &&\
sed 's/ /\t/' taxon-constraints-materialization-temp.nt | sed 's/ /\t/' | sed 's/ \.$$//' >taxonconstraintsrelationgraph.facts &&\
souffle ../util/materialize-taxon-constraints.dl &&\
souffle -c ../util/materialize-taxon-constraints.dl &&\
sed -E 's|<http://purl.obolibrary.org/obo/([^[:space:]]+)_([[:digit:]]+)>|\1:\2|g' computed_only_in_taxon.csv | sed '1s/^/defined_class\ttaxon\n/' >computed_only_in_taxon.tsv &&\
sed -E 's|<http://purl.obolibrary.org/obo/([^[:space:]]+)_([[:digit:]]+)>|\1:\2|g' computed_never_in_taxon.csv | sed '1s/^/defined_class\ttaxon\n/' >computed_never_in_taxon.tsv &&\
$(DOSDP_TOOLS) generate --obo-prefixes=true --template=../taxon_constraints/computed_only_in_taxon.yaml --infile=computed_only_in_taxon.tsv --outfile=computed_only_in_taxon.tmp.ofn &&\
Expand Down Expand Up @@ -660,7 +660,7 @@ go-edit.facts: $(SRC)
riot -q --nocheck --output ntriples go-edit.facts.ttl | sed 's/ /\t/' | sed 's/ /\t/' | sed 's/ \.$$//' >$@

datalog-violations.tsv: go-edit.facts ../resources/obsolete_ec.txt
souffle ../util/ontology-qc.dl &&\
souffle -c ../util/ontology-qc.dl &&\
( [ -s $@ ] && { cat $@; exit 1; } || true ) # exit with an error if the output is not empty

reports/neo-violations.report: $(GO_LEGO).owl
Expand Down
4 changes: 2 additions & 2 deletions src/util/materialize-taxon-constraints.dl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ subclassof(s, o) :- taxonconstraintsrelationgraph(s, RDFS_SUBCLASS_OF, o), match
goterm(goterm) :- taxonconstraintsrelationgraph(goterm, _, _), match("<http://purl.obolibrary.org/obo/GO_.+>", goterm).
goterm(goterm) :- taxonconstraintsrelationgraph(_, _, goterm), match("<http://purl.obolibrary.org/obo/GO_.+>", goterm).

taxon(taxon) :- taxonconstraintsrelationgraph(taxon, _, _), match("<http://purl.obolibrary.org/obo/NCBITaxon_\\d+>", taxon).
taxon(taxon) :- taxonconstraintsrelationgraph(_, _, taxon), match("<http://purl.obolibrary.org/obo/NCBITaxon_\\d+>", taxon).
taxon(taxon) :- taxonconstraintsrelationgraph(taxon, _, _), match("<http://purl.obolibrary.org/obo/NCBITaxon_.*\\d+>", taxon).
taxon(taxon) :- taxonconstraintsrelationgraph(_, _, taxon), match("<http://purl.obolibrary.org/obo/NCBITaxon_.*\\d+>", taxon).

taxon_complement(tc, taxon) :- taxonconstraintsrelationgraph(tc, _, _), match("<http://purl.obolibrary.org/obo/NCBITaxon_\\d+#NOT>", tc), len=strlen(tc), taxon=cat(substr(tc, 0, len-5), ">").
taxon_complement(tc, taxon) :- taxonconstraintsrelationgraph(_, _, tc), match("<http://purl.obolibrary.org/obo/NCBITaxon_\\d+#NOT>", tc), len=strlen(tc), taxon=cat(substr(tc, 0, len-5), ">").
Expand Down

0 comments on commit dfdab08

Please sign in to comment.