query-83b5df4261296749ff3cf22c1f2f7077
title:Direttori della Scuola Normale Superiore
SELECT DISTINCT ?item ?itemLabel ?ordinal ?birthyear ?deadyear ?startyear ?endyear ?trec
WHERE {
?item p:P39 ?position .
?position ps:P39 wd:Q41210386 .
?position pq:P1545 ?ordinal .
OPTIONAL { ?item wdt:P569 ?db. }
OPTIONAL { ?item wdt:P570 ?dd. }
OPTIONAL { ?position pq:P580 ?st. }
OPTIONAL { ?position pq:P582 ?en. }
OPTIONAL { ?item wdt:P3365 ?trec. }
BIND(str(YEAR(?db)) AS ?birthyear)
BIND(str(YEAR(?dd)) AS ?deadyear)
BIND(str(YEAR(?st)) AS ?startyear)
BIND(str(YEAR(?en)) AS ?endyear)
SERVICE wikibase:label { bd:serviceParam wikibase:language "it". }
}
ORDER BY ASC(xsd:integer(?ordinal))
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:Direttori della Scuola Normale Superiore
SELECT DISTINCT ?item ?itemLabel ?ordinal ?birthyear ?deadyear ?startyear ?endyear ?trec
WHERE {
?item p:P39 ?position .
?position ps:P39 wd:Q41210386 .
?position pq:P1545 ?ordinal .
OPTIONAL { ?item wdt:P569 ?db. }
OPTIONAL { ?item wdt:P570 ?dd. }
OPTIONAL { ?position pq:P580 ?st. }
OPTIONAL { ?position pq:P582 ?en. }
OPTIONAL { ?item wdt:P3365 ?trec. }
BIND(str(YEAR(?db)) AS ?birthyear)
BIND(str(YEAR(?dd)) AS ?deadyear)
BIND(str(YEAR(?st)) AS ?startyear)
BIND(str(YEAR(?en)) AS ?endyear)
SERVICE wikibase:label { bd:serviceParam wikibase:language "it". }
}
ORDER BY ASC(xsd:integer(?ordinal))
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v9("?birthyear"):::projected
v4("?db")
v5("?dd")
v10("?deadyear"):::projected
v7("?en")
v12("?endyear"):::projected
v2("?item"):::projected
v1("?ordinal"):::projected
v3("?position")
v6("?st")
v11("?startyear"):::projected
v8("?trec"):::projected
c13(["it"]):::literal
c3(["wd:Q41210386"]):::iri
c11(["bd:serviceParam"]):::iri
v2 --"p:P39"--> v3
v3 --"p:statement/P39"--> c3
v3 --"p:qualifier/P1545"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P569".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P570".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P580".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P582".-> v7
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P3365".-> v8
end
bind0[/"str(year-from-dateTime(?db))"/]
v4 --o bind0
bind0 --as--o v9
bind1[/"str(year-from-dateTime(?dd))"/]
v5 --o bind1
bind1 --as--o v10
bind2[/"str(year-from-dateTime(?st))"/]
v6 --o bind2
bind2 --as--o v11
bind3[/"str(year-from-dateTime(?en))"/]
v7 --o bind3
bind3 --as--o v12
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end