query-d68b168238240a57b00e8fd85a478e19

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT ?item ?type WHERE {
  VALUES ?item { # list of items to test, with wd: prefix, separated by spaces only
    wd:Q10000136 wd:Q1000257 wd:Q1000321 wd:Q1001543 wd:Q1009423 wd:Q1011703 # ... and so on; just extend the list here
  }
  { # blue links
    ?item wikibase:statements [] . 
    BIND('regular' as ?type) .
  } UNION { # redirects
    ?item owl:sameAs [] . 
    BIND('redirect' AS ?type) .
  } UNION { # red links
    MINUS { ?item owl:sameAs [] }
    FILTER NOT EXISTS { ?item schema:version [] }
    BIND('invalid' AS ?type) .
  }
} ORDER BY ASC(?type)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v3("?type"):::projected a1((" ")) a2((" ")) a4((" ")) a3((" ")) bind0[/VALUES ?item/] bind0-->v2 bind00(["wd:Q10000136"]) bind00 --> bind0 bind01(["wd:Q1000257"]) bind01 --> bind0 bind02(["wd:Q1000321"]) bind02 --> bind0 bind03(["wd:Q1001543"]) bind03 --> bind0 bind04(["wd:Q1009423"]) bind04 --> bind0 bind05(["wd:Q1011703"]) bind05 --> bind0 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; f1[["not "]] subgraph f1e0["Exists Clause"] e0v1 --"schema:version"--> e0a1 e0v1("?item"):::projected e0a1((" ")):::projected end f1--EXISTS--> f1e0 f1 --> v2 f1 --> c3 f1 --> a3 v2 --"schema:version"--> a3 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v2 --"owl:sameAs"--> a4 end bind3[/"'invalid'"/] bind3 --as--o v3 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"owl:sameAs"--> a2 bind4[/"'redirect'"/] bind4 --as--o v3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wikibase:statements"--> a1 bind5[/"'regular'"/] bind5 --as--o v3 end union0r <== or ==> union0l end