query-6c576cf41df9590f3ba92e4072fd5af4

rq turtle/ttl

List of countries in 1754 SELECT DISTINCT ?h ?hLabel ?inception ?dissolved ?l { ?h wdt:P31/wdt:P279 wd:Q38723 . OPTIONAL { ?h wdt:P571 ?inception } . ?h wdt:P131 ?l . ?l wdt:P131 wd:Q64 OPTIONAL { ?h wdt:P576 ?dissolved } . FILTER (?inception < "1891-00-0T00:00:00Z"^^xsd:dateTime \u007C\u007C !BOUND(?inception) ) FILTER (?dissolved > "1891-00-0T00:00:00Z"^^xsd:dateTime \u007C\u007C !Bound(?dissolved) ) SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en" } } ORDER BY ?inception

Use at

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 bd: <http://www.bigdata.com/rdf#>
#List of countries in 1754
SELECT DISTINCT ?h ?hLabel ?inception ?dissolved ?l
{
    ?h wdt:P31/wdt:P279* wd:Q38723  .
    OPTIONAL { ?h wdt:P571 ?inception } .
    ?h wdt:P131 ?l . ?l wdt:P131* wd:Q64 
    OPTIONAL { ?h wdt:P576 ?dissolved } .
    FILTER (?inception < "1891-00-0T00:00:00Z"^^xsd:dateTime \u007C\u007C !BOUND(?inception) )
    FILTER (?dissolved > "1891-00-0T00:00:00Z"^^xsd:dateTime \u007C\u007C !Bound(?dissolved) )
    SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en" }
}
ORDER BY ?inception

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?dissolved"):::projected v3("?h"):::projected v1("?inception"):::projected v4("?l"):::projected a1((" ")) c10(["bd:serviceParam"]):::iri c7(["wd:Q64"]):::iri c12(["de,en"]):::literal c4(["wd:Q38723"]):::iri f0[["(?dissolved > '1891-00-0T00:00:00Z^^xsd:dateTime' || not bound(?dissolved))"]] f0 --> v2 f1[["(?inception < '1891-00-0T00:00:00Z^^xsd:dateTime' || not bound(?inception))"]] f1 --> v1 v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P571".-> v1 end v3 --"wdt:P131"--> v4 v4 --"wdt:P131"--> c7 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P576".-> v2 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end