query-ea93f65b62461db7f80ed0b5634ef601

rq turtle/ttl

Battles, Sieges, Military Campaigns, Wars, Rebellions in the Sengoku Period

Show label, link to English Wikipedia, year, coordinates, startTime

SELECT ?battle ?battleLabel ?wikipedia_link_en ?year ?coordinates (GROUP_CONCAT(DISTINCT ?participantLabel; SEPARATOR = " // ") AS ?participants) WHERE { { ?battle (wdt:P361|wdt:P2348) wd:Q204023. } OPTIONAL { ?battle wdt:P710 ?participant. } OPTIONAL { ?battle (wdt:P585|wdt:P580) ?year. } OPTIONAL { ?battle wdt:P625 ?coordinates. } OPTIONAL { ?wikipedia_link_en schema:about ?battle ; schema:isPartOf https://en.wikipedia.org/. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,ja". ?battle rdfs:label ?battleLabel. ?participant rdfs:label ?participantLabel. } } GROUP BY ?battle ?battleLabel ?wikipedia_link_en ?year ?typeBattle ?coordinates ORDER BY (?year)

Use at

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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Battles, Sieges, Military Campaigns, Wars, Rebellions in the Sengoku Period
#Show label, link to English Wikipedia, year, coordinates, startTime
SELECT ?battle ?battleLabel ?wikipedia_link_en ?year ?coordinates
  (GROUP_CONCAT(DISTINCT ?participantLabel; SEPARATOR = " // ") AS ?participants)
WHERE {
  { ?battle (wdt:P361|wdt:P2348) wd:Q204023. }
  OPTIONAL { ?battle wdt:P710 ?participant. }
  OPTIONAL { ?battle (wdt:P585|wdt:P580) ?year. }
  OPTIONAL { ?battle wdt:P625 ?coordinates. }
  OPTIONAL { ?wikipedia_link_en schema:about ?battle ; schema:isPartOf <https://en.wikipedia.org/>. }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,ja".
    ?battle rdfs:label ?battleLabel.
    ?participant rdfs:label ?participantLabel.
  }
}
GROUP BY ?battle ?battleLabel ?wikipedia_link_en ?year ?typeBattle ?coordinates
ORDER BY (?year)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?battle"):::projected v6("?battleLabel"):::projected v4("?coordinates"):::projected v3("?participant") v7("?participantLabel"):::projected v8("?participants") v5("?wikipedia_link_en"):::projected v1("?year"):::projected c2(["wd:Q204023"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en,ja"]):::literal c10([https://en.wikipedia.org/]):::iri c12(["bd:serviceParam"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P2348"--> c2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P361"--> c2 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P710".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v2 -."wdt:P580".-> v1 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P585"--> v1 end union1r <== or ==> union1l end end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P625".-> v4 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v5 -."schema:about".-> v2 v5 --"schema:isPartOf"--> c10 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 v2 --"rdfs:label"--> v6 v3 --"rdfs:label"--> v7 end bind1[/"?participantLabel"/] v7 --o bind1 bind1 --as--o v8