-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re-name existing query for mult gene associations
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/sparql/qc/mondo/qc-multiple-gene-associations-ORIG.sparql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX obo: <http://purl.obolibrary.org/obo/> | ||
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> | ||
prefix mondoSparqlQcMondo: <http://purl.obolibrary.org/obo/mondo/sparql/qc/mondo/> | ||
prefix mondo: <http://purl.obolibrary.org/obo/mondo#> | ||
|
||
# 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 . | ||
FILTER NOT EXISTS { | ||
?entity mondo:excluded_from_qc_check mondoSparqlQcMondo:qc-multiple-gene-associations.sparql . | ||
} | ||
} | ||
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 . | ||
|
||
FILTER NOT EXISTS { | ||
?entity mondo:excluded_from_qc_check mondoSparqlQcMondo:qc-multiple-gene-associations.sparql . | ||
} | ||
} | ||
} | ||
GROUP BY ?entity ?label | ||
HAVING (COUNT(DISTINCT ?geneIdentifier) > 1) |