query-4292255380fc1bb3fb9da6493937d5da

rq turtle/ttl

Ship classes mislabelled as ships

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 ?name WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul"}
  {
    SELECT DISTINCT ?item ?name WHERE {
      ?item wdt:P31/wdt:P279* wd:Q11446.
      ?item rdfs:label ?label. FILTER (lang(?label) = "en")
      FILTER(CONTAINS(?label, "class")).
      OPTIONAL {
        ?item wdt:P1448 ?officialname.
      }
      BIND(COALESCE(?officialname,?label) AS ?name)
    }
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?label") v4("?name"):::projected v3("?officialname") a1((" ")) c4(["en-gb,en,mul"]):::literal c2(["bd:serviceParam"]):::iri c9(["wd:Q11446"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end f0[["contains(?label,'class')"]] f0 --> v1 f1[["?label = 'en'"]] f1 --> v1 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c9 v2 --"rdfs:label"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P1448".-> v3 end bind2[/"?officialname?label"/] v3 --o bind2 v1 --o bind2 bind2 --as--o v4