-
Notifications
You must be signed in to change notification settings - Fork 46
Query repository
the following query will count all the biochemical reactions in the biomodels database that are involved in "protein catabolic process". It works first by getting all the biochemical reactions labelled with that GO term (using the bioportal endpoint), and joining these results with all the biochemical reactions that are annotated with GO terms that are more specific than "protein catabolic process"
use SPARQLbin: http://sparqlbin.com/#862e8b4ded87331146c5fe89266b1e34
or go to http://bioportal.bio2rdf.org/sparql and type in the sparql box:
SELECT ?go ?label count(distinct ?x)
WHERE {
{
# get all the biochemical reactions specifically labelled with protein catabolic process
?go rdfs:label ?label .
FILTER regex(?label, "^protein catabolic process")
service <http://biomodels.bio2rdf.org/sparql> {
?x <http://bio2rdf.org/biopax_vocabulary:identical-to> ?go .
?x a <http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction> .
} # end service
} UNION {
# get all the biochemical reactions that are more specific than "protein catabolic process"
?go rdfs:label ?label .
?go rdfs:subClassOf ?tgo OPTION (TRANSITIVE) . # get all the subclasses of the target to term
?tgo rdfs:label ?tlabel .
FILTER regex(?tlabel, "^protein catabolic process")
service <http://biomodels.bio2rdf.org/sparql> {
?x <http://bio2rdf.org/biopax_vocabulary:identical-to> ?go .
?x a <http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction> .
} # end service
} # end union
} # end where
The following is an alternative version of the previous query that does not make use of rdfs:label to find go terms that share the "protein catabolic process" (GO:0030163) term.
SELECT ?go ?label count(distinct ?x)
WHERE {
{
?go rdfs:label ?label .
FILTER (?go = <http://bio2rdf.org/go:0030163>)
service <http://biomodels.bio2rdf.org/sparql> {
?x <http://bio2rdf.org/biopax_vocabulary:identical-to> ?go .
?x a <http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction> .
}
} UNION {
?go rdfs:label ?label .
?go rdfs:subClassOf ?tgo OPTION (TRANSITIVE) .
FILTER (?tgo = <http://bio2rdf.org/go:0030163>)
service <http://biomodels.bio2rdf.org/sparql> {
?x <http://bio2rdf.org/biopax_vocabulary:identical-to> ?go .
?x a <http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction> .
}
}
}
This SPARQL query utilizes 3 datasets: PubMed, GHO and LinkedCT (only PubMed belonging to Bio2RDF). This SPARQL query can be executed on this endpoint: http://db0.aksw.org:8895/sparql
This query counts the number of distinct publications and number of distinct deaths due to the disease Tuberculosis in the country India.
PREFIX qb:
PREFIX att:
PREFIX eg:
PREFIX rdfs:
PREFIX ct:
PREFIX gho:
PREFIX redd:
SELECT count(distinct(?publication)) AS ?no_of_publications count(?deaths) AS ?no_of_deaths
WHERE {
?item a qb:Observation ;
gho:Country ?country .
?country rdfs:label "India" .
?item gho:Disease ?disease .
?disease rdfs:label "Tuberculosis".
?item att:unitMeasure gho:Measure .
?item eg:incidence ?deaths .
?trial a ct:trials .
?trial ct:condition ?condition .
?condition owl:sameAs ?disease .
?trial ct:location ?location .
?location redd:locatedIn ?country .
?trial ct:reference ?publication.
?publication ct:citation ?citation.
}