monarch-initiative / mondo

Mondo Disease Ontology
http://obofoundry.org/ontology/mondo
Creative Commons Attribution 4.0 International
224 stars 51 forks source link

Mondo QC does not (seem to) catch all issues... #7753

Open matentzn opened 1 month ago

matentzn commented 1 month ago

.. but release QC does:

[Term]
id: MONDO:0016178
name: obsolete peripheral neuropathy associated with monoclonal gammopathy
comment: Reason: out of scope. This is an Orphanet grouping class that is considered out of scope for Mondo. Term to consider: peripheral neuropathy associated with monoclonal gammopathy'
subset: gard_rare {source="GARD:20417"}
subset: ordo_group_of_disorders {source="Orphanet:209010"}
xref: GARD:20417 {source="MONDO:obsoleteEquivalent", source="Orphanet:209010"}
xref: Orphanet:209010 {source="MONDO:obsoleteEquivalent"}
property_value: IAO:0000231 OMO:0001000
property_value: IAO:0000233 "https://github.com/monarch-initiative/mondo/issues/3886" xsd:anyURI
is_obsolete: true
consider: MONDO:0016178
FAIL Rule ../sparql/qc/general/qc-reflexive.sparql: 1 violation(s)
entity,property,value
http://purl.obolibrary.org/obo/MONDO_0016178,http://www.geneontology.org/formats/oboInOwl#consider,Entity referencing itself in triple!
twhetzel commented 1 month ago

I see this case where the value of the consider relation was the same as the id for MONDO:0016178 in EBI OLS and therefore this query did not Fail on this condition for a Mondo release.

What was run to get the FAIL in original post?

If the triple is:

http://purl.obolibrary.org/obo/MONDO_0016178,http://www.geneontology.org/formats/oboInOwl#consider,MONDO:0016178

how did the FAIL in the original post occur since the entity is an IRI and value is a CURIE?

FWIW, this is what I was thinking of for a generic reflexive check:

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>

SELECT DISTINCT ?entity ?property ?value ?message
WHERE {
    ?entity ?property ?value .
    BIND(REPLACE(STR(?entity), "http://purl.obolibrary.org/obo/", "") AS ?curie)
    BIND(REPLACE(?curie, "_", ":") AS ?formatted_curie)
    FILTER (isIRI(?entity))
    FILTER(?entity!=owl:Nothing)
    FILTER(?formatted_curie = ?value)
    FILTER(?property != <http://www.geneontology.org/formats/oboInOwl#id>)
    BIND("Entity referencing itself in triple" as ?message)
}
matentzn commented 1 month ago

how did the FAIL in the original post occur since the entity is an IRI and value is a CURIE?

Running the release caused the failure. Sorry I should have mentioned this in the issue here.

This test failed: https://github.com/monarch-initiative/mondo/blob/master/src/sparql/qc/general/qc-reflexive.sparql

I do not know why this test is not run on a PR, and only shows up during the release. My guess make test does not include a number of tests that only work on the mondo.owl (rather than mondo-edit.obo) file, but it would have to be investigated