query-5e4ae6cb1920ffeafc13fb840b3ac9b6
HannolansTried to make a combination to check for either end time, start time and point in 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 pqv: <http://www.wikidata.org/prop/qualifier/value/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?property ?propertyLabel ?qualifier ?qualifierLabel ?time ?precision
WHERE
{
{
SELECT ?item ?claim ?qualifiervalue ?time ?precision
WHERE
{
?item wdt:P31 wd:Q5.
?item wdt:P6379 wd:Q17153751.
# Get truthy statements for ?item with any of time qualifiers in ?qualifiervalue:
VALUES ?qualifiervalue { pqv:P580 pqv:P582 pqv:P585 }
?item ?claim ?statement.
?statement a wikibase:BestRank.
?statement ?qualifiervalue ?timenode.
?timenode wikibase:timePrecision ?precision.
?timenode wikibase:timeValue ?time.
FILTER (?precision > 8) #only year or better precision
}
}
#Get labels for item, property and qualifier:
?qualifier wikibase:qualifierValue ?qualifiervalue.
?property wikibase:claim ?claim.
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;
v4("?claim")
v2("?item"):::projected
v1("?precision"):::projected
v9("?property"):::projected
v8("?qualifier"):::projected
v3("?qualifiervalue")
v5("?statement")
v7("?time"):::projected
v6("?timenode")
c7(["wikibase:BestRank"]):::iri
c13(["bd:serviceParam"]):::iri
c3(["wd:Q5"]):::iri
c15(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c5(["wd:Q17153751"]):::iri
f0[["?precision > '8^^xsd:integer'"]]
f0 --> v1
v2 --"wdt:P31"--> c3
v2 --"wdt:P6379"--> c5
bind1[/VALUES ?qualifiervalue/]
bind1-->v3
bind10(["pqv:P580"])
bind10 --> bind1
bind11(["pqv:P582"])
bind11 --> bind1
bind12(["pqv:P585"])
bind12 --> bind1
v2 -->v4--> v5
v5 --"a"--> c7
v5 -->v3--> v6
v6 --"wikibase:timePrecision"--> v1
v6 --"wikibase:timeValue"--> v7
v8 --"wikibase:qualifierValue"--> v3
v9 --"wikibase:claim"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end