query-7e356ced777ca2143eae2e17115edc3c

rq turtle/ttl

MH sans identifiant SELECT DISTINCT ?item ?itemLabel WHERE { { ?item wdt:P1435 wd:Q10387575 . } UNION { ?item wdt:P1435 wd:Q10387684 . } #MH OPTIONAL { ?item p:P1435 [ ps:P1435 [] ; pq:P580 ?dateDebut ] . } FILTER(year(?dateDebut) < year(now())-2 ) #protégé il y a plus de deux ans MINUS { ?item wdt:P380 [] } #sans d'identifiant Mérimée MINUS { ?item wdt:P481 [] } #sans d'identifiant Palissy MINUS { ?item wdt:P131+ wd:Q33788 } #hors Nouvelle-Calédonie SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" } . }

Use at

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#>
#MH sans identifiant
SELECT DISTINCT ?item ?itemLabel WHERE {
    { ?item wdt:P1435 wd:Q10387575 . } UNION { ?item wdt:P1435 wd:Q10387684 . } #MH
    OPTIONAL { ?item p:P1435 [ ps:P1435 [] ; pq:P580 ?dateDebut ] . }
    FILTER(year(?dateDebut) < year(now())-2 ) #protégé il y a plus de deux ans
    MINUS { ?item wdt:P380 [] } #sans d'identifiant Mérimée
    MINUS { ?item wdt:P481 [] } #sans d'identifiant Palissy
    MINUS { ?item wdt:P131+ wd:Q33788 } #hors Nouvelle-Calédonie
    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; v1("?dateDebut") v2("?item"):::projected a2((" ")) a3((" ")) a4((" ")) a1((" ")) c15(["fr"]):::literal c4(["wd:Q10387684"]):::iri c3(["wd:Q10387575"]):::iri c13(["bd:serviceParam"]):::iri c11(["wd:Q33788"]):::iri f0[["year-from-dateTime(?dateDebut) < year-from-dateTime(NOW()) + '-2^^xsd:integer'"]] f0 --> v1 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P1435"--> c4 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P1435"--> c3 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; a1 -."p:statement/P1435".-> a2 a1 --"p:qualifier/P580"--> v1 v2 --"p:P1435"--> a1 end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P380"--> a3 end subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P481"--> a4 end subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P131"--> c11 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end