query-0e85047599aefc8992b8af44ba123eaa

rq turtle/ttl

title:Norske skip uten start dato, med artikkel på norsk SELECT DISTINCT ?item ?itemLabel ?start ?end ?imo ?mmsi ?dnvgl ?article WHERE { ?item (wdt:P31/(wdt:P279*)) wd:Q11446; (wdt:P8047|wdt:P17) wd:Q20. OPTIONAL { ?item wdt:P729 ?start. } OPTIONAL { ?item wdt:P730 ?end. } OPTIONAL { ?item wdt:P458 ?imo. } OPTIONAL { ?article schema:about ?item; schema:isPartOf https://no.wikipedia.org/. } OPTIONAL { ?item wdt:P587 ?mmsi. } FILTER(BOUND(?article)) FILTER(!BOUND(?start)) OPTIONAL { ?item wdt:P5006 ?dnvgl. } SERVICE wikibase:label { bd:serviceParam wikibase:language "nb,en". } } ORDER BY (?start) (?item)

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 bd: <http://www.bigdata.com/rdf#>
#title:Norske skip uten start dato, med artikkel på norsk
SELECT DISTINCT ?item ?itemLabel ?start ?end ?imo ?mmsi ?dnvgl ?article WHERE {
  ?item (wdt:P31/(wdt:P279*)) wd:Q11446;
    (wdt:P8047|wdt:P17) wd:Q20.
  OPTIONAL { ?item wdt:P729 ?start. }
  OPTIONAL { ?item wdt:P730 ?end. }
  OPTIONAL { ?item wdt:P458 ?imo. }
  OPTIONAL {
    ?article schema:about ?item;
      schema:isPartOf <https://no.wikipedia.org/>.
  }
  OPTIONAL { ?item wdt:P587 ?mmsi. }
  FILTER(BOUND(?article))
  FILTER(!BOUND(?start))
  OPTIONAL { ?item wdt:P5006 ?dnvgl. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nb,en". }
}
ORDER BY (?start) (?item)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?article"):::projected v7("?dnvgl"):::projected v4("?end"):::projected v5("?imo"):::projected v2("?item"):::projected v6("?mmsi"):::projected v1("?start"):::projected a1((" ")) c5(["wd:Q20"]):::iri c16(["bd:serviceParam"]):::iri c12([https://no.wikipedia.org/]):::iri c18(["nb,en"]):::literal c3(["wd:Q11446"]):::iri f0[["not bound(?start)"]] f0 --> v1 f1[["bound(?article)"]] f1 --> v3 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P17"--> c5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P8047"--> c5 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P729".-> v1 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:P458".-> v5 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v3 -."schema:about".-> v2 v3 --"schema:isPartOf"--> c12 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P587".-> v6 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P5006".-> v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end