query-39dd548e58656313d05f6aa624274648
title:Authority control properties for authority files, sorted by year of creation (approximate on the basis of milestones)
SELECT ?property ?propertyLabel ?number (YEAR(?date) as ?year) WITH {
SELECT ?property ?number (MIN(?milestone_) as ?milestone)
WHERE {
?property wdt:P31/wdt:P279* wd:Q96776953.
BIND(xsd:integer(strafter(str(?property),"P")) as ?number)
wd:Q73616850 wdt:P1114 ?milestone_ .
FILTER(?milestone_ > ?number)
} group by ?property ?number } as %i
WHERE
{
INCLUDE %i
wd:Q73616850 p:P1114 ?stat .
?stat ps:P1114 ?milestone .
?stat pq:P585 ?date
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Authority control properties for authority files, sorted by year of creation (approximate on the basis of milestones)
SELECT ?property ?propertyLabel ?number (YEAR(?date) as ?year) WHERE
{
{
SELECT ?property ?number (MIN(?milestone_) as ?milestone)
WHERE {
?property wdt:P31/wdt:P279* wd:Q96776953.
BIND(xsd:integer(strafter(str(?property),"P")) as ?number)
wd:Q73616850 wdt:P1114 ?milestone_ .
FILTER(?milestone_ > ?number)
} group by ?property ?number } wd:Q73616850 p:P1114 ?stat .
?stat ps:P1114 ?milestone .
?stat pq:P585 ?date
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
- https://www.wikidata.org/wiki/User:Ep%C3%ACdosis/Queries
- https://www.wikidata.org/wiki/User:Ep%C3%ACdosis/sandbox
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?date"):::projected
v4("?milestone")
v1("?milestone_")
v4("?number"):::projected
v3("?property"):::projected
v5("?stat")
v7("?year")
a1((" "))
c4(["wd:Q73616850"]):::iri
c10(["bd:serviceParam"]):::iri
c3(["wd:Q96776953"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?milestone_ > ?number"]]
f0 --> v1
f0 --> v4
v3 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
bind1[/"http://www.w3.org/2001/XMLSchema#integer(substring-after(str(?property),'P'))"/]
v3 --o bind1
bind1 --as--o v4
c4 --"p:direct/P1114"--> v1
bind3[/"min(?milestone_)"/]
v1 --o bind3
bind3 --as--o v4
c4 --"p:P1114"--> v5
v5 --"p:statement/P1114"--> v4
v5 --"p:qualifier/P585"--> v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind4[/"year-from-dateTime(?date)"/]
v6 --o bind4
bind4 --as--o v7