query-cf0d0252cb8a64aec419f6a215bdc72b
ChristianKl
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 bd: <http://www.bigdata.com/rdf#>
select distinct ?personne ?personneLabel ?parent ?parentLabel {
?personne ?parent_prop_c ?parent . # get the data with subproperties, the actual predicate is a variable ?parent_prop_c
?parent_prop wdt:P1647* wd:P8810 . # subproperties of "parent" entities
?parent_prop wikibase:directClaim ?parent_prop_c . # main value "direct claim" predicate for those entities in ?parent_prop_c
?personne wdt:P551 wd:Q12191 . #get the persons who lives in the place (directly, not the places located in it)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?parent"):::projected
v4("?parent_prop")
v2("?parent_prop_c")
v1("?personne"):::projected
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c5(["wd:Q12191"]):::iri
c2(["wd:P8810"]):::iri
v1 -->v2--> v3
v4 --"wdt:P1647"--> c2
v4 --"wikibase:directClaim"--> v2
v1 --"wdt:P551"--> c5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end