query-c985367a70f1fbc30a00125ac712a16b

rq turtle/ttl

Locations of battles Locations of battles Localisation des batailles Locations of battles Locations of battles Locaties van gevechten Stridsplatser Locations of battles Locations of battles Locations of battles

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#added before 2016-10
#defaultView:Map
SELECT ?label ?coord ?subj ?year
WHERE
{
    ?subj wdt:P31 wd:Q178561 .
    ?subj wdt:P625 ?coord .
    OPTIONAL {?subj wdt:P580 ?d1}
    OPTIONAL {?subj wdt:P585 ?d2}
    OPTIONAL {?subj wdt:P582 ?d3}
    BIND(IF(!BOUND(?d1),(IF(!BOUND(?d2),?d3,?d2)),?d1) as ?date)
    BIND(YEAR(?date) as ?year)
    ?subj rdfs:label ?label filter (lang(?label) = "en")
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?coord"):::projected v4("?d1") v5("?d2") v6("?d3") v7("?date") v1("?label"):::projected v2("?subj"):::projected v8("?year"):::projected c3(["wd:Q178561"]):::iri f0[["?label = 'en'"]] f0 --> v1 v2 --"wdt:P31"--> c3 v2 --"wdt:P625"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P580".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P585".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P582".-> v6 end bind1[/"if(not bound(?d1),if(not bound(?d2),?d3,?d2),?d1)"/] v4 --o bind1 v5 --o bind1 v6 --o bind1 bind1 --as--o v7 bind2[/"year-from-dateTime(?date)"/] v7 --o bind2 bind2 --as--o v8 v2 --"rdfs:label"--> v1