query-6912abfedf3591cc6f182a8a665afea6
Propertiesinstance of (P31)vaccine for (P1924)described by source (P1343)clinical trial phase (P6099)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item (SAMPLE(?itemLabel) AS ?itemLabel) (SAMPLE(?trialLabels) AS ?trialLabels) (SAMPLE(?typeLabel) AS ?typeLabel)
WHERE
{
{ ?item wdt:P31 wd:Q87719492 } UNION {
VALUES ?v { wd:Q84263196 wd:Q82069695 }
VALUES ?vv { wd:Q134808 wd:Q28051899 }
?item wdt:P31 ?vv.
?item wdt:P1924 ?v.
}
OPTIONAL
{
VALUES ?type { wd:Q3560939 wd:Q96695067 wd:Q96841548 wd:Q578537 wd:Q97153934 wd:Q97153933 wd:Q58623657 wd:Q99518999 }
?item wdt:P31 ?type
}
OPTIONAL { ?item wdt:P1343 ?type }
{
SELECT ?item (GROUP_CONCAT(DISTINCT(?trialLabel); separator=", ") AS ?trialLabels)
WHERE
{
?item wdt:P1343 ?src.
?src wdt:P6099 ?trial.
?trial rdfs:label ?trialLabel. FILTER( LANG(?trialLabel)="en" )
}
GROUP BY ?item
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
?item rdfs:label ?itemLabel .
?type rdfs:label ?typeLabel .
}
}
GROUP BY ?item
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v11("?itemLabel"):::projected
v6("?src")
v7("?trial")
v5("?trialLabel")
v11("?trialLabels"):::projected
v4("?type")
v11("?typeLabel"):::projected
v2("?v")
v3("?vv")
c9(["bd:serviceParam"]):::iri
c2(["wd:Q87719492"]):::iri
c5(["en"]):::literal
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
bind0[/VALUES ?v/]
bind0-->v2
bind00(["wd:Q84263196"])
bind00 --> bind0
bind01(["wd:Q82069695"])
bind01 --> bind0
bind1[/VALUES ?vv/]
bind1-->v3
bind10(["wd:Q134808"])
bind10 --> bind1
bind11(["wd:Q28051899"])
bind11 --> bind1
v1 --"wdt:P31"--> v3
v1 --"wdt:P1924"--> v2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c2
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
bind2[/VALUES ?type/]
bind2-->v4
bind20(["wd:Q3560939"])
bind20 --> bind2
bind21(["wd:Q96695067"])
bind21 --> bind2
bind22(["wd:Q96841548"])
bind22 --> bind2
bind23(["wd:Q578537"])
bind23 --> bind2
bind24(["wd:Q97153934"])
bind24 --> bind2
bind25(["wd:Q97153933"])
bind25 --> bind2
bind26(["wd:Q58623657"])
bind26 --> bind2
bind27(["wd:Q99518999"])
bind27 --> bind2
v1 -."wdt:P31".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P1343".-> v4
end
f3[["?trialLabel = 'en'"]]
f3 --> v5
v1 --"wdt:P1343"--> v6
v6 --"wdt:P6099"--> v7
v7 --"rdfs:label"--> v5
bind5[/"?trialLabel"/]
v5 --o bind5
bind5 --as--o v11
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c5
v1 --"rdfs:label"--> v11
v4 --"rdfs:label"--> v11
end
bind9[/"sample(?itemLabel)"/]
v11 --o bind9
bind9 --as--o v11
bind10[/"sample(?trialLabels)"/]
v11 --o bind10
bind10 --as--o v11
bind11[/"sample(?typeLabel)"/]
v11 --o bind11
bind11 --as--o v11