query-e89a04cb23b71b21477996eb98667d01
Filter by period of time (years) and labels instead of QIDsHi everyone, I have this query to get a list of the people in the period specified (1700-1800) who can speak Basque in the territories cited, and get in the list a column of not only the QIDs, but the person name/surname and the language, not its QID. No property (P) needed, as it is showing now. So far not good. How could I get these results? Regards
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ("P1412" AS ?propietatea) ("Q8752" AS ?hizkuntza) WHERE {
?item wdt:P31 wd:Q5.
?date_node wikibase:timePrecision "11"^^xsd:integer .
?date_node wikibase:timeValue ?date .
?item (wdt:P31/(wdt:P279*)) ?type;
wdt:P569 ?dateof_birth.
FILTER((?dateof_birth >= "1700-01-01"^^xsd:dat) && (?dateof_birth <= "1799-12-31"^^xsd:dat))
?item p:P569/psv:P569 ?date_node .
{?item wdt:P19/wdt:P131* wd:Q95010 .}
UNION {?item wdt:P19/wdt:P131* wd:Q81801 .}
UNION {?item wdt:P19/wdt:P131* wd:Q93366 .}
UNION {?item wdt:P19/wdt:P131* wd:Q671023 .}
UNION {?item wdt:P19/wdt:P131* wd:Q4018 .}
UNION {?item wdt:P19/wdt:P131* wd:Q638503 .}
UNION {?item wdt:P19/wdt:P131* wd:Q673040 .}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?date")
v3("?date_node")
v1("?dateof_birth")
v7("?hizkuntza")
v2("?item"):::projected
v6("?propietatea")
v5("?type")
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
a7((" "))
a8((" "))
a9((" "))
c6(["11^^xsd:integer"]):::literal
c14(["wd:Q95010"]):::iri
c16(["wd:Q93366"]):::iri
c19(["wd:Q638503"]):::iri
c15(["wd:Q81801"]):::iri
c20(["wd:Q673040"]):::iri
c4(["wd:Q5"]):::iri
c17(["wd:Q671023"]):::iri
c18(["wd:Q4018"]):::iri
f0[["?dateof_birth >= s1700-01-01^^<http://www.w3.org/2001/XMLSchema#dat>'?dateof_birth <= s1799-12-31^^<http://www.w3.org/2001/XMLSchema#dat>'"]]
f0 --> v1
v2 --"p:direct/P31"--> c4
v3 --"wikibase:timePrecision"--> c6
v3 --"wikibase:timeValue"--> v4
v2 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> v5
v2 --"p:direct/P569"--> v1
v2 --"p:P569"--> a2
a2 --"p:statement/value/P569"--> v3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
subgraph union3[" Union "]
subgraph union3l[" "]
style union3l fill:#abf,stroke-dasharray: 3 3;
subgraph union4[" Union "]
subgraph union4l[" "]
style union4l fill:#abf,stroke-dasharray: 3 3;
subgraph union5[" Union "]
subgraph union5l[" "]
style union5l fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P19"--> a9
a9 --"p:direct/P131"--> c20
end
subgraph union5r[" "]
style union5r fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P19"--> a8
a8 --"p:direct/P131"--> c19
end
union5r <== or ==> union5l
end
end
subgraph union4r[" "]
style union4r fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P19"--> a7
a7 --"p:direct/P131"--> c18
end
union4r <== or ==> union4l
end
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P19"--> a6
a6 --"p:direct/P131"--> c17
end
union3r <== or ==> union3l
end
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P19"--> a5
a5 --"p:direct/P131"--> c16
end
union2r <== or ==> union2l
end
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P19"--> a4
a4 --"p:direct/P131"--> c15
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P19"--> a3
a3 --"p:direct/P131"--> c14
end
union0r <== or ==> union0l
end
bind1[/"'P1412'"/]
bind1 --as--o v6
bind2[/"'Q8752'"/]
bind2 --as--o v7