query-8035fa08a2b5e8d2c0b29806d511d7b2
If you really want the language string as a column, then you could add ("Basque" AS ?hizkuntza). Clearly they all speak Basque because that's what the report selects for. : Probably this. You need to specify ?item wdt:P1412 wd:Q8752 as a triple; perhaps use the label service to retrieve the item's label, and use DISTINCT in the select since the report will produce duplicate rows where the P19/P131* triples overlap. I have also added the ?family_name in case this is of use; not all items will have a value for this.IƱaki LL@
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/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ("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 .}
?item wdt:P1412 wd:Q8752 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],eu,es,en". }
}
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")
v6("?hizkuntza")
v2("?item"):::projected
v5("?type")
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
a7((" "))
a8((" "))
a9((" "))
c14(["wd:Q95010"]):::iri
c15(["wd:Q81801"]):::iri
c20(["wd:Q673040"]):::iri
c22(["wd:Q8752"]):::iri
c24(["bd:serviceParam"]):::iri
c26(["#91;AUTO_LANGUAGE#93;,eu,es,en"]):::literal
c4(["wd:Q5"]):::iri
c17(["wd:Q671023"]):::iri
c18(["wd:Q4018"]):::iri
c6(["11^^xsd:integer"]):::literal
c16(["wd:Q93366"]):::iri
c19(["wd:Q638503"]):::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
v2 --"p:direct/P1412"--> c22
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c24 --"wikibase:language"--> c26
end
bind1[/"'Q8752'"/]
bind1 --as--o v6