From dd5d60df0b97b81a9d30ad431e2bf23195c69009 Mon Sep 17 00:00:00 2001 From: Jim Balhoff Date: Wed, 4 Dec 2024 13:46:12 -0500 Subject: [PATCH] Add checks for empty literals and URIs as comments. Fix some violations. (#29376) --- src/ontology/go-edit.obo | 6 +++--- src/util/ontology-qc.dl | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ontology/go-edit.obo b/src/ontology/go-edit.obo index ff9d18a640..83546a2681 100644 --- a/src/ontology/go-edit.obo +++ b/src/ontology/go-edit.obo @@ -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 @@ -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 @@ -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 diff --git a/src/util/ontology-qc.dl b/src/util/ontology-qc.dl index 0e774297f2..e9f4fb6551 100644 --- a/src/util/ontology-qc.dl +++ b/src/util/ontology-qc.dl @@ -1,6 +1,7 @@ #define RDF_TYPE "" #define RDFS_SUBCLASS_OF "" #define RDFS_SUBPROPERTY_OF "" +#define RDFS_COMMENT "" #define OWL_CLASS "" #define OWL_DEPRECATED "" #define OWL_ANNOTATION_PROPERTY "" @@ -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) @@ -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\"^^"). valid_term(iri) :- term(iri), !obsolete_term(iri). @@ -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")