query-cbcfaeea424afa10836b161c34a9c778
Search for items with descriptions both in Basque and Spanish.
Here only people born in Bilbao
SELECT ?item ?genderLabel ?occupationLabel ?domainLabel ?positionLabel ?itemDescription ?itemLabel WHERE { ?item wdt:P31 wd:Q5. OPTIONAL { ?item wdt:P21 ?gender. } OPTIONAL { ?item wdt:P106 ?occupation. } OPTIONAL { ?item wdt:P101 ?domain. } OPTIONAL { ?item wdt:P39 ?position. } SERVICE wikibase:label { bd:serviceParam wikibase:language "eu, es". } FILTER(EXISTS { ?item schema:description ?itemdesc, ?itemdesc2. FILTER(((LANG(?itemdesc)) = "eu") && ((LANG(?itemdesc2)) = "es")) })
?item wdt:P19 wd:Q8692. } ORDER BY (?itemLabel)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Search for items with descriptions both in Basque and Spanish.
#Here only people born in Bilbao
SELECT ?item ?genderLabel ?occupationLabel ?domainLabel ?positionLabel ?itemDescription ?itemLabel WHERE {
?item wdt:P31 wd:Q5.
OPTIONAL { ?item wdt:P21 ?gender. }
OPTIONAL { ?item wdt:P106 ?occupation. }
OPTIONAL { ?item wdt:P101 ?domain. }
OPTIONAL { ?item wdt:P39 ?position. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "eu, es". }
FILTER(EXISTS {
?item schema:description ?itemdesc, ?itemdesc2. FILTER(((LANG(?itemdesc)) = "eu") && ((LANG(?itemdesc2)) = "es"))
})
?item wdt:P19 wd:Q8692.
}
ORDER BY (?itemLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?domain")
v5("?gender")
v4("?item"):::projected
v1("?itemLabel"):::projected
v2("?itemdesc")
v3("?itemdesc2")
v6("?occupation")
v8("?position")
c13(["eu, es"]):::literal
c11(["bd:serviceParam"]):::iri
c15(["wd:Q8692"]):::iri
c5(["wd:Q5"]):::iri
f0[[" "]]
subgraph f0e0["Exists Clause"]
e0f0[["?itemdesc = 'eu'?itemdesc2 = 'es'"]]
e0f0 --> e0v1
e0f0 --> e0v2
e0v3 --"schema:description"--> e0v1
e0v3 --"schema:description"--> e0v2
e0v3("?item"):::projected
e0v1("?itemdesc"):::projected
e0v2("?itemdesc2"):::projected
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> v3
f0 --> v4
f0 --> c3
f1[["?itemdesc = 'eu'?itemdesc2 = 'es'"]]
f1 --> v2
f1 --> v3
v4 --"schema:description"--> v2
v4 --"schema:description"--> v3
v4 --"wdt:P31"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P21".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P106".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P101".-> v7
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P39".-> v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end
v4 --"wdt:P19"--> c15