diff --git a/src/sparql/qc/mondo/qc-gene-identifier-mismatch.sparql b/src/sparql/qc/mondo/qc-gene-identifier-mismatch.sparql new file mode 100644 index 0000000000..6fa7433526 --- /dev/null +++ b/src/sparql/qc/mondo/qc-gene-identifier-mismatch.sparql @@ -0,0 +1,35 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX obo: + +# Find classes with mismatched gene identifiers added as equivalentTo and subClassOf + +SELECT DISTINCT ?entity ?label ?equivGeneIdentifier ?subClassGeneIdentifier +WHERE { + ?entity rdf:type owl:Class ; + rdfs:label ?label . + + # Equivalent class restriction + ?entity owl:equivalentClass ?equivClass . + ?equivClass owl:intersectionOf/rdf:rest*/rdf:first ?equivComponent . + + ?equivComponent rdf:type owl:Restriction ; + owl:onProperty obo:RO_0004003 ; + owl:someValuesFrom ?equivGeneIdentifier . + + # subClassOf restriction + ?entity rdfs:subClassOf ?subClassRestriction . + ?subClassRestriction rdf:type owl:Restriction ; + owl:onProperty obo:RO_0004003 ; + owl:someValuesFrom ?subClassGeneIdentifier . + + # Filter for gene identifiers with HGNC or NCBIGene prefixes + FILTER(STRSTARTS(STR(?equivGeneIdentifier), "http://identifiers.org/hgnc/") || + STRSTARTS(STR(?equivGeneIdentifier), "http://identifiers.org/ncbigene/")) + FILTER(STRSTARTS(STR(?subClassGeneIdentifier), "http://identifiers.org/hgnc/") || + STRSTARTS(STR(?subClassGeneIdentifier), "http://identifiers.org/ncbigene/")) + + # Filter for cases where the gene identifiers do not match + FILTER(?equivGeneIdentifier != ?subClassGeneIdentifier) +} diff --git a/src/sparql/qc/mondo/qc-multiple-gene-associations.sparql b/src/sparql/qc/mondo/qc-multiple-gene-associations.sparql new file mode 100644 index 0000000000..1fa354d310 --- /dev/null +++ b/src/sparql/qc/mondo/qc-multiple-gene-associations.sparql @@ -0,0 +1,34 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX obo: +PREFIX oboInOwl: + +# Get classes that have more than 1 gene association (either subClassOf or equivalentClass) with RO:0004003 property + +SELECT DISTINCT ?entity ?label (GROUP_CONCAT(DISTINCT ?geneIdentifier; separator=", ") AS ?geneIdentifiers) +WHERE { + { + # subClassOf association + ?entity rdfs:subClassOf ?restriction ; + rdfs:label ?label . + + ?restriction rdf:type owl:Restriction ; + owl:onProperty obo:RO_0004003 ; + owl:someValuesFrom ?geneIdentifier . + } + UNION + { + # equivalentClass association + ?entity owl:equivalentClass ?equivClass ; + rdfs:label ?label . + + ?equivClass owl:intersectionOf/rdf:rest*/rdf:first ?component . + + ?component rdf:type owl:Restriction ; + owl:onProperty obo:RO_0004003 ; + owl:someValuesFrom ?geneIdentifier . + } +} +GROUP BY ?entity ?label +HAVING (COUNT(DISTINCT ?geneIdentifier) > 1)