query-e3e1a6b5408ea375c757dda0e2f6797b
pets who survived their owners SELECT ?owner ?ownerLabel ?ownerDescription ?pet ?petLabel ?petDescription ?ownerDied ?petDied WHERE { ?owner wdt:P1429 ?pet; wdt:P570 ?ownerDied. ?pet wdt:P570 ?petDied. FILTER(?petDied > ?ownerDied) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# pets who survived their owners
SELECT ?owner ?ownerLabel ?ownerDescription ?pet ?petLabel ?petDescription ?ownerDied ?petDied WHERE {
?owner wdt:P1429 ?pet;
wdt:P570 ?ownerDied.
?pet wdt:P570 ?petDied.
FILTER(?petDied > ?ownerDied)
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("?owner"):::projected
v2("?ownerDied"):::projected
v4("?pet"):::projected
v1("?petDied"):::projected
c4(["bd:serviceParam"]):::iri
c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?petDied > ?ownerDied"]]
f0 --> v1
f0 --> v2
v3 --"wdt:P1429"--> v4
v3 --"wdt:P570"--> v2
v4 --"wdt:P570"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end