query-137caafbaf245e1fa55b47b21ee1c7a9
Propertiesmedical condition treated (P2175)stated in (P248)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?drug ?drugLabel ?value ?valueLabel ?reference_stated_inLabel WHERE {
?drug p:P2175 ?statement .
?statement ps:P2175 ?value . # get the value associated with the statement
?statement prov:wasDerivedFrom/pr:P248 ?reference_stated_in . #where stated
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?drug"):::projected
v4("?reference_stated_in")
v2("?statement")
v3("?value"):::projected
a1((" "))
c6(["bd:serviceParam"]):::iri
c8(["en"]):::literal
v1 --"p:P2175"--> v2
v2 --"p:statement/P2175"--> v3
v2 --"prov:wasDerivedFrom"--> a1
a1 --"p:reference/P248"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end