query-d81819eec7fbb215bbf28ddb3b158ab7
MH protégés en 2023
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 schema: <http://schema.org/>
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#>
SELECT DISTINCT ?item ?itemLabel ?articleWikipédia ?villeLabel ?departLabel ?regionLabel ?protectionLabel ?merimeeLabel ?coord ?pic ?protDate WHERE {
# ?item wdt:P131/wdt:P131/wdt:P131 wd:Q18678265 . # en Occ
# ?item p:P380 [] . #immeubles
?item p:P1435 ?stat .
{ ?stat ps:P1435 wd:Q10387575 ; pq:P580 ?protDate . } UNION { ?stat ps:P1435 wd:Q10387684 ; pq:P580 ?protDate . } #MH
?stat ps:P1435 ?protection ;
FILTER(year(?protDate) = 2023 )
?item wdt:P380 ?merimee ;
wdt:P131 ?ville ;
wdt:P131/wdt:P131 ?depart .
{ ?depart wdt:P31 wd:Q6465 ;
wdt:P131 ?region ;
wdt:P131/wdt:P31 wd:Q36784 . # region
}
UNION
{ ?depart wdt:P31 wd:Q56061 ; # entité Alsace
wdt:P131 ?region .
}
UNION
{ ?depart wdt:P31 wd:Q202216 ; # DOM
wdt:P131 ?region .
}
UNION
{ ?depart wdt:P131 wd:Q90 ;
wdt:P131/wdt:P131/wdt:P131 ?region .
}
UNION
{ ?ville wdt:P131 wd:Q90 ;
wdt:P131/wdt:P131/wdt:P131 ?region .
} # departement ou Paris
UNION
{ ?item wdt:P131 wd:Q90 ;
wdt:P131/wdt:P131/wdt:P131 ?region .
} # departement ou Paris
OPTIONAL {?item wdt:P625 ?coord.}
OPTIONAL {?item wdt:P18 ?pic.}
OPTIONAL {?articleWikipédia schema:about ?item .
?articleWikipédia schema:isPartOf <https://fr.wikipedia.org/>. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v11("?articleWikipédia"):::projected
v9("?coord"):::projected
v7("?depart")
v2("?item"):::projected
v5("?merimee")
v10("?pic"):::projected
v1("?protDate"):::projected
v4("?protection")
v8("?region")
v3("?stat")
v6("?ville")
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
a7((" "))
a8((" "))
c14(["wd:Q90"]):::iri
c19([https://fr.wikipedia.org/]):::iri
c23(["fr"]):::literal
c12(["wd:Q56061"]):::iri
c13(["wd:Q202216"]):::iri
c11(["wd:Q36784"]):::iri
c6(["wd:Q10387684"]):::iri
c4(["wd:Q10387575"]):::iri
c21(["bd:serviceParam"]):::iri
c10(["wd:Q6465"]):::iri
f0[["year-from-dateTime(?protDate) = '2023^^xsd:integer'"]]
f0 --> v1
v2 --"p:P1435"--> v3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 --"p:statement/P1435"--> c6
v3 --"p:qualifier/P580"--> v1
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:statement/P1435"--> c4
v3 --"p:qualifier/P580"--> v1
end
union0r <== or ==> union0l
end
v3 --"p:statement/P1435"--> v4
v2 --"p:direct/P380"--> v5
v2 --"p:direct/P131"--> v6
v2 --"p:direct/P131"--> a1
a1 --"p:direct/P131"--> v7
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
subgraph union3[" Union "]
subgraph union3l[" "]
style union3l fill:#abf,stroke-dasharray: 3 3;
subgraph union4[" Union "]
subgraph union4l[" "]
style union4l fill:#abf,stroke-dasharray: 3 3;
subgraph union5[" Union "]
subgraph union5l[" "]
style union5l fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P131"--> c14
v2 --"p:direct/P131"--> a7
a7 --"p:direct/P131"--> a8
a8 --"p:direct/P131"--> v8
end
subgraph union5r[" "]
style union5r fill:#abf,stroke-dasharray: 3 3;
v6 --"p:direct/P131"--> c14
v6 --"p:direct/P131"--> a5
a5 --"p:direct/P131"--> a6
a6 --"p:direct/P131"--> v8
end
union5r <== or ==> union5l
end
end
subgraph union4r[" "]
style union4r fill:#abf,stroke-dasharray: 3 3;
v7 --"p:direct/P131"--> c14
v7 --"p:direct/P131"--> a3
a3 --"p:direct/P131"--> a4
a4 --"p:direct/P131"--> v8
end
union4r <== or ==> union4l
end
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
v7 --"p:direct/P31"--> c13
v7 --"p:direct/P131"--> v8
end
union3r <== or ==> union3l
end
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v7 --"p:direct/P31"--> c12
v7 --"p:direct/P131"--> v8
end
union2r <== or ==> union2l
end
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v7 --"p:direct/P31"--> c10
v7 --"p:direct/P131"--> v8
v7 --"p:direct/P131"--> a2
a2 --"p:direct/P31"--> c11
end
union1r <== or ==> union1l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P625".-> v9
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P18".-> v10
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v11 -."schema:about".-> v2
v11 --"schema:isPartOf"--> c19
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c21 --"wikibase:language"--> c23
end