query-014b492aa78de8cd313e0819161d1505
Queries ]reply[17:54, 7 May 2019 (UTC)) talk (Tobias1984Here is a handy query to find all units with start and end time and the fossils they bear, also with start and end time:
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 ?formation ?formationLabel ?formationStartLabel ?formationEndLabel ?fossil ?fossilLabel ?fossilStartLabel ?fossilEndLabel
WHERE {
?formation wdt:P31 wd:Q736917 .
OPTIONAL { ?formation wdt:P523 ?formationStart . }
OPTIONAL { ?formation wdt:P524 ?formationEnd . }
?formation wdt:P1137 ?fossil .
OPTIONAL { ?fossil wdt:P523 ?fossilStart . }
OPTIONAL { ?fossil wdt:P524 ?fossilEnd . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?formation"):::projected
v3("?formationEnd")
v2("?formationStart")
v4("?fossil"):::projected
v6("?fossilEnd")
v5("?fossilStart")
c7(["bd:serviceParam"]):::iri
c2(["wd:Q736917"]):::iri
c9(["en"]):::literal
v1 --"wdt:P31"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P523".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P524".-> v3
end
v1 --"wdt:P1137"--> v4
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P523".-> v5
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P524".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end