How find the children of a term in a rdf ontology using sparql.
/path/to/apache-jena-4.8.0/bin/arq --data=path/to/go.owl --query query.sparql
find all the children of GO:0045823 ( "positive regulation of heart contraction" )
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?subClass ?label WHERE {
?subClass rdfs:subClassOf <http://purl.obolibrary.org/obo/GO_0045823> .
?subClass rdfs:label ?label .
}
subClass | label |
---|---|
http://purl.obolibrary.org/obo/GO_0001989 | "positive regulation of the force of heart contraction involved in baroreceptor response to decreased systemic arterial blood pressure" |
http://purl.obolibrary.org/obo/GO_0010460 | "positive regulation of heart rate" |
http://purl.obolibrary.org/obo/GO_0060452 | "positive regulation of cardiac muscle contraction" |
http://purl.obolibrary.org/obo/GO_0003099 | "positive regulation of the force of heart contraction by chemical signal" |
see https://www.w3.org/TR/sparql11-query/#propertypaths
find all the descendants of GO:0045823 ( "positive regulation of heart contraction" )
just add a star (*
) after rdfs:subClassOf
.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?subClass ?label WHERE {
?subClass rdfs:subClassOf* <http://purl.obolibrary.org/obo/GO_0045823> .
?subClass rdfs:label ?label .
}
subClass | label |
---|---|
http://purl.obolibrary.org/obo/GO_0045823 | "positive regulation of heart contraction" |
http://purl.obolibrary.org/obo/GO_0001989 | "positive regulation of the force of heart contraction involved in baroreceptor response to decreased systemic arterial blood pressure" |
http://purl.obolibrary.org/obo/GO_0010460 | "positive regulation of heart rate" |
http://purl.obolibrary.org/obo/GO_0001996 | "positive regulation of heart rate by epinephrine-norepinephrine" |
http://purl.obolibrary.org/obo/GO_0086024 | "adenylate cyclase-activating adrenergic receptor signaling pathway involved in positive regulation of heart rate" |
http://purl.obolibrary.org/obo/GO_0003065 | "positive regulation of heart rate by epinephrine" |
http://purl.obolibrary.org/obo/GO_0003112 | "positive regulation of heart rate by neuronal epinephrine" |
http://purl.obolibrary.org/obo/GO_0003111 | "positive regulation of heart rate by circulating epinephrine" |
http://purl.obolibrary.org/obo/GO_0003066 | "positive regulation of heart rate by norepinephrine" |
http://purl.obolibrary.org/obo/GO_0003114 | "positive regulation of heart rate by circulating norepinephrine" |
http://purl.obolibrary.org/obo/GO_0003113 | "positive regulation of heart rate by neuronal norepinephrine" |
http://purl.obolibrary.org/obo/GO_0001988 | "positive regulation of heart rate involved in baroreceptor response to decreased systemic arterial blood pressure" |
http://purl.obolibrary.org/obo/GO_0060452 | "positive regulation of cardiac muscle contraction" |
http://purl.obolibrary.org/obo/GO_0003099 | "positive regulation of the force of heart contraction by chemical signal" |
http://purl.obolibrary.org/obo/GO_0003061 | "positive regulation of the force of heart contraction by norepinephrine" |
http://purl.obolibrary.org/obo/GO_0003110 | "positive regulation of the force of heart contraction by neuronal norepinephrine" |
http://purl.obolibrary.org/obo/GO_0003109 | "positive regulation of the force of heart contraction by circulating norepinephrine" |
http://purl.obolibrary.org/obo/GO_0003059 | "positive regulation of the force of heart contraction by epinephrine" |
http://purl.obolibrary.org/obo/GO_0003087 | "positive regulation of the force of heart contraction by neuronal epinephrine" |
http://purl.obolibrary.org/obo/GO_0003088 | "positive regulation of the force of heart contraction by circulating epinephrine" |
http://purl.obolibrary.org/obo/GO_0001997 | "positive regulation of the force of heart contraction by epinephrine-norepinephrine" |
http://purl.obolibrary.org/obo/GO_0003090 | "positive regulation of the force of heart contraction by neuronal epinephrine-norepinephrine" |
http://purl.obolibrary.org/obo/GO_0003089 | "positive regulation of the force of heart contraction by circulating epinephrine-norepinephrine" |