query-981abc5b9f88319f9403a519b43b886a
Animals owned by people holding any position Animals owned by people holding any position Animals owned by people holding any position Animaux détenus par des personnes occupant une position quelconque Animals owned by people holding any position Dieren die eigendom zijn van personen die een bepaalde functie hebben Animals owned by people holding any position Animals owned by people holding any position Animals owned by people holding any position Animals owned by people holding any position
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?animal ?animalLabel ?itemLabel (SAMPLE(?image) as ?image)
(GROUP_CONCAT(DISTINCT(?personLabel); separator=", ") as ?owners) {
?item wdt:P31 wd:Q16521.
?animal wdt:P31 ?item .
?person wdt:P39 ?x .
?animal wdt:P127 ?person .
OPTIONAL { ?animal wdt:P18 ?image }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
?animal rdfs:label ?animalLabel .
?item rdfs:label ?itemLabel .
?person rdfs:label ?personLabel
}
} GROUP BY ?animal ?animalLabel ?itemLabel
Query found at
- https://www.wikidata.org/wiki/User:Amitie_10g/Sandbox/Wikidata:SPARQL_query_service/queries/examples/maintenance
- https://www.wikidata.org/wiki/User:Amitie_10g/Sandbox/Wikidata:SPARQL_query_service/queries/examples/maintenance/en
- https://www.wikidata.org/wiki/User:Amitie_10g/Sandbox/Wikidata:SPARQL_query_service/queries/examples/maintenance/es
- https://www.wikidata.org/wiki/User:Amitie_10g/Sandbox/Wikidata:SPARQL_query_service/queries/examples/maintenance/zh
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/cs
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/en
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/es
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/fr
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/ja
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/nl
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/pl
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/sv
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/uk
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?animal"):::projected
v6("?animalLabel"):::projected
v9("?image"):::projected
v1("?item")
v7("?itemLabel"):::projected
v9("?owners")
v3("?person")
v8("?personLabel"):::projected
v4("?x")
c7(["bd:serviceParam"]):::iri
c9(["en"]):::literal
c2(["wd:Q16521"]):::iri
v1 --"wdt:P31"--> c2
v2 --"wdt:P31"--> v1
v3 --"wdt:P39"--> v4
v2 --"wdt:P127"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P18".-> v9
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
v2 --"rdfs:label"--> v6
v1 --"rdfs:label"--> v7
v3 --"rdfs:label"--> v8
end
bind2[/"sample(?image)"/]
v9 --o bind2
bind2 --as--o v9
bind3[/"?personLabel"/]
v8 --o bind3
bind3 --as--o v9