query-471ec176142968a0b48f914c2132c823
Video game items without descriptions in some language, and having publication date; show date
SELECT ?item ?itemLabel ?date
{
{
SELECT ?item (COUNT(?item) AS ?cnt) {
?item p:P31 [ ps:P31 wd:Q7889 ] .
?item p:P31 ?valueStatement .
OPTIONAL { ?item schema:description ?itemDescription FILTER(LANG(?itemDescription) = "en"). }
FILTER (!BOUND(?itemDescription))
} GROUP BY ?item
}
{
?date_node wikibase:timePrecision "9"^^xsd:integer .
?date_node wikibase:timeValue ?date .
?item p:P577/psv:P577 ?date_node .
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
FILTER(?cnt = 1)
}
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Video game items without descriptions in some language, and having publication date; show date
SELECT ?item ?itemLabel ?date
{
{
SELECT ?item (COUNT(?item) AS ?cnt) {
?item p:P31 [ ps:P31 wd:Q7889 ] .
?item p:P31 ?valueStatement .
OPTIONAL { ?item schema:description ?itemDescription FILTER(LANG(?itemDescription) = "en"). }
FILTER (!BOUND(?itemDescription))
} GROUP BY ?item
}
{
?date_node wikibase:timePrecision "9"^^xsd:integer .
?date_node wikibase:timeValue ?date .
?item p:P577/psv:P577 ?date_node .
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
FILTER(?cnt = 1)
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?cnt")
v6("?date"):::projected
v5("?date_node")
v3("?item"):::projected
v2("?itemDescription")
v4("?valueStatement")
a1((" "))
a2((" "))
c2(["en"]):::literal
c13(["bd:serviceParam"]):::iri
c4(["wd:Q7889"]):::iri
c8(["9^^xsd:integer"]):::literal
f0[["?cnt = '1^^xsd:integer'"]]
f0 --> v5
f1[["not bound(?itemDescription)"]]
f1 --> v2
a1 --"p:statement/P31"--> c4
v3 --"p:P31"--> a1
v3 --"p:P31"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."schema:description".-> v2
end
bind3[/"count(?item)"/]
v3 --o bind3
bind3 --as--o v5
v5 --"wikibase:timePrecision"--> c8
v5 --"wikibase:timeValue"--> v6
v3 --"p:P577"--> a2
a2 --"p:statement/value/P577"--> v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c2
end