query-d074b28417bad4c71347ad1f558f5852

rq turtle/ttl

Warship official names and languages

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
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#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel 
  (GROUP_CONCAT(DISTINCT ?name;     SEPARATOR = ", ") AS ?names)
  (GROUP_CONCAT(DISTINCT ?lang;     SEPARATOR = ", ") AS ?langs)
  WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul"}
  {
    SELECT DISTINCT ?item ?name ?lang WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul"}
      ?item wdt:P31/wdt:P279* wd:Q2031121.
      ?item wdt:P1448 ?name.
      ?item rdfs:label ?name1
      BIND (lang(?name) AS ?lang)
    }
  }
} GROUP BY ?item ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected v4("?lang"):::projected v6("?langs") v2("?name"):::projected v3("?name1") v5("?names") a1((" ")) c4(["en-gb,en,mul"]):::literal c7(["wd:Q2031121"]):::iri c2(["bd:serviceParam"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c7 v1 --"wdt:P1448"--> v2 v1 --"rdfs:label"--> v3 bind0[/"?name"/] v2 --o bind0 bind0 --as--o v4 bind3[/"?name"/] v2 --o bind3 bind3 --as--o v5 bind4[/"?lang"/] v4 --o bind4 bind4 --as--o v6