query-af0ce96333ace1560f0f4d33c6632a9a

rq turtle/ttl

Norske skip (registert eller opererer i Norge) SELECT ?item ?itemLabel ?start ?end ?manufacturer ?manufacturerLabel ?imo ?mmsi ?dnvgl WHERE { ?item (wdt:P31/(wdt:P279*)) wd:Q11446. { ?item wdt:P8047 wd:Q20. } UNION { ?item wdt:P17 wd:Q20. } OPTIONAL { ?item wdt:P729 ?start. } OPTIONAL { ?item wdt:P730 ?end. } OPTIONAL { ?item wdt:P176 ?manufacturer. } OPTIONAL { ?item wdt:P458 ?imo. } OPTIONAL { ?item wdt:P587 ?mmsi. } OPTIONAL { ?item wdt:P5006 ?dnvgl. } SERVICE wikibase:label { bd:serviceParam wikibase:language "nb". } filter not exists {?item rdfs:label ?itemLabelnb. filter(lang(?itemLabelnb)="nb")} }

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#>
#Norske skip (registert eller opererer i Norge)
SELECT ?item ?itemLabel ?start ?end ?manufacturer ?manufacturerLabel ?imo ?mmsi ?dnvgl WHERE {
  ?item (wdt:P31/(wdt:P279*)) wd:Q11446.
  { ?item wdt:P8047 wd:Q20. }
  UNION
  { ?item wdt:P17 wd:Q20. }
  OPTIONAL { ?item wdt:P729 ?start. }
  OPTIONAL { ?item wdt:P730 ?end. }
  OPTIONAL { ?item wdt:P176 ?manufacturer. }
  OPTIONAL { ?item wdt:P458 ?imo. }
  OPTIONAL { ?item wdt:P587 ?mmsi. }
  OPTIONAL { ?item wdt:P5006 ?dnvgl. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nb". }
  filter not exists {?item rdfs:label ?itemLabelnb. filter(lang(?itemLabelnb)="nb")}
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?dnvgl"):::projected v4("?end"):::projected v6("?imo"):::projected v2("?item"):::projected v1("?itemLabelnb") v5("?manufacturer"):::projected v7("?mmsi"):::projected v3("?start"):::projected a1((" ")) c7(["wd:Q20"]):::iri c16(["bd:serviceParam"]):::iri c1(["nb"]):::literal c5(["wd:Q11446"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0f0[["?itemLabelnb = 'nb'"]] e0f0 --> e0v1 e0v2 --"rdfs:label"--> e0v1 e0v2("?item"):::projected e0v1("?itemLabelnb"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> v2 f0 --> c2 f1[["?itemLabelnb = 'nb'"]] f1 --> v1 v2 --"rdfs:label"--> v1 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P17"--> c7 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P8047"--> c7 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P729".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P730".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P176".-> v5 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P458".-> v6 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P587".-> v7 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P5006".-> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c1 end