query-ad73ed069bff493ab62d2685fc071e9a
Propertiesinstance of (P31)subclass of (P279)YouTube video ID (P1651)video (P10)object of statement has role (P3831)
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (GROUP_CONCAT(DISTINCT ?value; SEPARATOR = " ") AS ?trailer) WHERE {
{
?item p:P1651 ?statement.
?statement ps:P1651 ?v;
pq:P3831 wd:Q65972034.
BIND(CONCAT("https://www.youtube.com/watch?v=", ?v) AS ?value)
}
UNION
{
?item p:P10 ?statement.
?statement ps:P10 ?v;
pq:P3831 wd:Q65972034.
BIND(CONCAT("[", STR(?v), " C]") AS ?value)
}
?item (wdt:P31/(wdt:P279*)) wd:Q7889.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?item ?itemLabel
ORDER BY DESC (xsd:integer(STRAFTER(STR(?item), "Q")))
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v2("?statement")
v5("?trailer")
v3("?v")
v5("?value"):::projected
a1((" "))
c14(["en"]):::literal
c5(["wd:Q65972034"]):::iri
c12(["bd:serviceParam"]):::iri
c10(["wd:Q7889"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"p:P10"--> v2
v2 --"p:statement/P10"--> v3
v2 --"p:qualifier/P3831"--> c5
bind0[/"concat('#91;',str(?v),' C#93;')"/]
v3 --o bind0
bind0 --as--o v5
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"p:P1651"--> v2
v2 --"p:statement/P1651"--> v3
v2 --"p:qualifier/P3831"--> c5
bind1[/"concat('https://www.youtube.com/watch?v=',?v)"/]
v3 --o bind1
bind1 --as--o v5
end
union0r <== or ==> union0l
end
v1 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c10
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end
bind3[/"?value"/]
v5 --o bind3
bind3 --as--o v5