query-34bab4f816325a4a0902d17f2d73d558

rq turtle/ttl

TODO

Use at

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 ?languageLabel_ ; separator="$$$ ") as ?languageLabel) 
(GROUP_CONCAT(DISTINCT ?countryLabel_ ; separator="$$$ ") as ?countryLabel)
(GROUP_CONCAT(DISTINCT ?directorLabel_ ; separator="$$$ ") as ?directorLabel)
(GROUP_CONCAT(DISTINCT ?genreLabel_ ; separator="$$$ ") as ?genreLabel)
(GROUP_CONCAT(DISTINCT ?scriptLabel_ ; separator="$$$ ") as ?scriptLabel)  
(GROUP_CONCAT(DISTINCT(str(?genre)); separator="$$$ ") as ?genre)

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 .
                                           ?language rdfs:label ?languageLabel_ .
                                           ?country rdfs:label ?countryLabel_ .
                                           ?director rdfs:label ?directorLabel_ .
                                           ?genre rdfs:label ?genreLabel_ .
                                           ?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; v3("?country") v15("?countryLabel") v10("?countryLabel_"):::projected v6("?director") v16("?directorLabel") v11("?directorLabel_"):::projected v19("?genre"):::projected v17("?genreLabel") v12("?genreLabel_"):::projected v1("?item"):::projected v8("?itemLabel"):::projected v5("?language") v14("?languageLabel") v9("?languageLabel_"):::projected v2("?pubdate") v7("?script") v18("?scriptLabel") v13("?scriptLabel_"):::projected 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".-> v19 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 v5 --"rdfs:label"--> v9 v3 --"rdfs:label"--> v10 v6 --"rdfs:label"--> v11 v19 --"rdfs:label"--> v12 v7 --"rdfs:label"--> v13 end bind7[/"?languageLabel_"/] v9 --o bind7 bind7 --as--o v14 bind8[/"?countryLabel_"/] v10 --o bind8 bind8 --as--o v15 bind9[/"?directorLabel_"/] v11 --o bind9 bind9 --as--o v16 bind10[/"?genreLabel_"/] v12 --o bind10 bind10 --as--o v17 bind11[/"?scriptLabel_"/] v13 --o bind11 bind11 --as--o v18 bind12[/"str(?genre)"/] v19 --o bind12 bind12 --as--o v19