Skip to content

Commit

Permalink
Add checks for empty literals and URIs as comments. Fix some violatio…
Browse files Browse the repository at this point in the history
…ns. (#29376)
  • Loading branch information
balhoff authored Dec 4, 2024
1 parent 0338456 commit dd5d60d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ontology/go-edit.obo
Original file line number Diff line number Diff line change
Expand Up @@ -438876,9 +438876,9 @@ id: GO:0103040
name: aldose sugar dehydrogenase activity
namespace: molecular_function
def: "Catalysis of the reaction: H2O + an aldose + an oxidized electron acceptor = H+ + an aldonate + a reduced electron acceptor." [GOC:pz, MetaCyc:RXN0-6371, PMID:16864586]
comment: https://github.com/geneontology/go-ontology/issues/28942
xref: MetaCyc:RXN0-6371
is_a: GO:0016901 ! oxidoreductase activity, acting on the CH-OH group of donors, quinone or similar compound as acceptor
property_value: term_tracker_item "https://github.com/geneontology/go-ontology/issues/28942" xsd:anyURI

[Term]
id: GO:0103041
Expand Down Expand Up @@ -468061,9 +468061,9 @@ id: GO:0180044
name: borate channel activity
namespace: molecular_function
def: "Enables the facilitated diffusion of borate (by an energy-independent process) involving passage through a transmembrane aqueous pore or channel without evidence for a carrier-mediated mechanism." [PMID:21710975]
comment: https://github.com/geneontology/go-ontology/issues/27487
is_a: GO:0015103 ! inorganic anion transmembrane transporter activity
is_a: GO:0015267 ! channel activity
property_value: term_tracker_item "https://github.com/geneontology/go-ontology/issues/27487" xsd:anyURI
created_by: vw
creation_date: 2024-07-05T11:36:39Z

Expand Down Expand Up @@ -497307,9 +497307,9 @@ id: GO:1901638
name: obsolete copper ion import into ascospore-type prospore
namespace: biological_process
def: "OBSOLETE. Any copper ion import that takes place in ascospore-type prospore." [GOC:TermGenie]
comment: https://sourceforge.net/tracker/index.php?func=detail&aid=3510080&group_id=36855&atid=440764
synonym: "copper ion import into ascospore-type prospore" EXACT []
synonym: "copper ion uptake in ascospore-type prospore" EXACT [GOC:TermGenie]
property_value: term_tracker_item "https://sourceforge.net/tracker/index.php?func=detail&aid=3510080&group_id=36855&atid=440764" xsd:anyURI
is_obsolete: true
created_by: al
creation_date: 2012-11-15T15:44:04Z
Expand Down
6 changes: 6 additions & 0 deletions src/util/ontology-qc.dl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#define RDF_TYPE "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"
#define RDFS_SUBCLASS_OF "<http://www.w3.org/2000/01/rdf-schema#subClassOf>"
#define RDFS_SUBPROPERTY_OF "<http://www.w3.org/2000/01/rdf-schema#subPropertyOf>"
#define RDFS_COMMENT "<http://www.w3.org/2000/01/rdf-schema#comment>"
#define OWL_CLASS "<http://www.w3.org/2002/07/owl#Class>"
#define OWL_DEPRECATED "<http://www.w3.org/2002/07/owl#deprecated>"
#define OWL_ANNOTATION_PROPERTY "<http://www.w3.org/2002/07/owl#AnnotationProperty>"
Expand All @@ -25,6 +26,7 @@
.decl synonym_property(iri: symbol)
.decl declared_subset(iri: symbol)
.decl subset_assertion(term: symbol, subset: symbol)
.decl triple_with_literal(s: symbol, p: symbol, o: symbol)
.decl xref(term: symbol, ref: symbol)
.decl defxref(term: symbol, ref: symbol)
.decl synonym_xref(term: symbol, property: symbol, ref: symbol)
Expand All @@ -40,6 +42,8 @@ synonym_property(OIO_HAS_BROAD_SYNONYM).

term(iri) :- ontrdf(iri, RDF_TYPE, OWL_CLASS), match("<.+>", iri).

triple_with_literal(s, p, o) :- ontrdf(s, p, o), match("\".*", o).

obsolete_term(iri) :- term(iri), ontrdf(iri, OWL_DEPRECATED, "\"true\"^^<http://www.w3.org/2001/XMLSchema#boolean>").

valid_term(iri) :- term(iri), !obsolete_term(iri).
Expand All @@ -66,5 +70,7 @@ error(cat("ERROR: ", term, " has an xref to an obsolete EC: ", ec)) :- xref(term
error(cat("ERROR: ", term, " has a definition xref to an obsolete EC: ", ec)) :- defxref(term, ec), valid_term(term), obsolete_ec(ec).
error(cat("ERROR: ", term, " has a synonym xref to an obsolete EC: ", ec)) :- synonym_xref(term, _, ec), valid_term(term), obsolete_ec(ec).
error(cat("ERROR: ", term, " references an undeclared subset: ", subset)) :- subset_assertion(term, subset), !declared_subset(subset).
error(cat("ERROR: empty literal value for ", s, " ", p)) :- triple_with_literal(s, p, o), match("\"\".*", o).
error(cat("ERROR: ", term, " has a comment that seems to be a URI")) :- triple_with_literal(term, RDFS_COMMENT, o), match("\"http.*", o).

.output error(filename="datalog-violations.tsv")

0 comments on commit dd5d60d

Please sign in to comment.