query-451f2f524a9e6c826fa57918642bc67b
Sample query to find P1995 from C23 MeSH Codes SELECT DISTINCT ?item ?itemLabel ?specLabel
WHERE {?item wdt:P672 ?meshcode.
FILTER(STRSTARTS(?meshcode, 'C23.888.592'))
OPTIONAL {?item wdt:P1995 ?spec}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Sample query to find P1995 from C23 MeSH Codes
SELECT DISTINCT ?item ?itemLabel ?specLabel
WHERE {?item wdt:P672 ?meshcode.
FILTER(STRSTARTS(?meshcode, 'C23.888.592'))
OPTIONAL {?item wdt:P1995 ?spec}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?meshcode")
v3("?spec")
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["starts-with(?meshcode,'C23.888.592')"]]
f0 --> v1
v2 --"wdt:P672"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P1995".-> v3
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end