query-3b714a24d3bd63468642976b353df644
4ing(Q747074)commune of Italy (P459)determination method or standard (P854)reference URL (Q13433)Avellino (Q13486)Andria (Q42983)Agnadello
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 prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?date_preferred_rank ?date_newer ?method_newerLabel ?source_URL
WHERE
{
?item wdt:P31 wd:Q747074 .
# Find a P1082 statement with preferred rank
?item p:P1082 ?stat_preferred_rank .
?stat_preferred_rank wikibase:rank wikibase:PreferredRank .
?stat_preferred_rank pq:P585 ?date_preferred_rank .
# Find a P1082 statement with normal rank, P459 qualificator, source with P854, and a newer date
?item p:P1082 ?stat_newer .
?stat_newer wikibase:rank wikibase:NormalRank .
?stat_newer pq:P585 ?date_newer .
FILTER (?date_newer > ?date_preferred_rank)
?stat_newer pq:P459 ?method_newer .
?stat_newer prov:wasDerivedFrom ?source_newer .
?source_newer pr:P854 ?source_URL .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,it" . }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?date_newer"):::projected
v2("?date_preferred_rank"):::projected
v3("?item"):::projected
v6("?method_newer")
v8("?source_URL"):::projected
v7("?source_newer")
v5("?stat_newer")
v4("?stat_preferred_rank")
c14(["#91;AUTO_LANGUAGE#93;,en,it"]):::literal
c5(["wikibase:PreferredRank"]):::iri
c7(["wikibase:NormalRank"]):::iri
c12(["bd:serviceParam"]):::iri
c2(["wd:Q747074"]):::iri
f0[["?date_newer > ?date_preferred_rank"]]
f0 --> v1
f0 --> v2
v3 --"p:direct/P31"--> c2
v3 --"p:P1082"--> v4
v4 --"wikibase:rank"--> c5
v4 --"p:qualifier/P585"--> v2
v3 --"p:P1082"--> v5
v5 --"wikibase:rank"--> c7
v5 --"p:qualifier/P585"--> v1
v5 --"p:qualifier/P459"--> v6
v5 --"prov:wasDerivedFrom"--> v7
v7 --"p:reference/P854"--> v8
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end