query-e6308334dc0c00eeef80fdf0ec89a97a
TODO
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel
(GROUP_CONCAT(DISTINCT ?countryLabel; separator="$$$ ") AS ?country)
(GROUP_CONCAT(DISTINCT ?genreLabel; separator="$$$ ") AS ?genre)
(GROUP_CONCAT(DISTINCT ?languageLabel; separator="$$$ ") AS ?language)
(GROUP_CONCAT(DISTINCT ?directorLabel; separator="$$$ ") AS ?director)
(GROUP_CONCAT(DISTINCT ?scriptLabel; separator="$$$ ") AS ?script)
WHERE {
?item wdt:P31 wd:Q11424 .
?item wdt:P577 ?pubdate .
OPTIONAL { ?item wdt:P495 ?country_ }
OPTIONAL { ?item wdt:P136 ?genre_ }
OPTIONAL { ?item wdt:P364 ?language_}
OPTIONAL { ?item wdt:P57 ?director_ }
OPTIONAL { ?item wdt:P58 ?script_ }
FILTER ((?pubdate >= "2017-01-01T00:00:00Z"^^xsd:dateTime) && (?pubdate <= "2017-12-31T00:00:00Z"^^xsd:dateTime))
SERVICE wikibase:label
{
bd:serviceParam wikibase:language "cy,en,de,fr,ru,bg,cs,po,pl,nl,sl,eun,ro,oc,az,ast,my,tl,ga,br,it,cs,hu,ca,es,no,nn,gl" .
?item rdfs:label ?itemLabel .
?country_ rdfs:label ?countryLabel .
?language_ rdfs:label ?languageLabel .
?genre_ rdfs:label ?genreLabel .
?director_ rdfs:label ?directorLabel .
?script_ rdfs:label ?scriptLabel .
}
}
GROUP BY ?item ?itemLabel
ORDER BY ?item
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v14("?country")
v9("?countryLabel"):::projected
v3("?country_")
v17("?director")
v12("?directorLabel"):::projected
v6("?director_")
v15("?genre")
v11("?genreLabel"):::projected
v4("?genre_")
v1("?item"):::projected
v8("?itemLabel"):::projected
v16("?language")
v10("?languageLabel"):::projected
v5("?language_")
v2("?pubdate")
v18("?script")
v13("?scriptLabel"):::projected
v7("?script_")
c12(["bd:serviceParam"]):::iri
c14(["cy,en,de,fr,ru,bg,cs,po,pl,nl,sl,eun,ro,oc,az,ast,my,tl,ga,br,it,cs,hu,ca,es,no,nn,gl"]):::literal
c4(["wd:Q11424"]):::iri
f0[["?pubdate >= '2017-01-01T00:00:00Z^^xsd:dateTime'?pubdate <= '2017-12-31T00:00:00Z^^xsd:dateTime'"]]
f0 --> v2
v1 --"wdt:P31"--> c4
v1 --"wdt:P577"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P495".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P136".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P364".-> v5
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P57".-> v6
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P58".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
v1 --"rdfs:label"--> v8
v3 --"rdfs:label"--> v9
v5 --"rdfs:label"--> v10
v4 --"rdfs:label"--> v11
v6 --"rdfs:label"--> v12
v7 --"rdfs:label"--> v13
end
bind6[/"?countryLabel"/]
v9 --o bind6
bind6 --as--o v14
bind7[/"?genreLabel"/]
v11 --o bind7
bind7 --as--o v15
bind8[/"?languageLabel"/]
v10 --o bind8
bind8 --as--o v16
bind9[/"?directorLabel"/]
v12 --o bind9
bind9 --as--o v17
bind10[/"?scriptLabel"/]
v13 --o bind10
bind10 --as--o v18