query-fdd8509e80e87fe31f8c443539fd0cee

rq turtle/ttl

Look for empty items (no sitelinks, no statements, no use in other items) SELECT ?item { ?item wikibase:sitelinks 0 . # no sitelinks (sometimes unreliable); alternative: ?sitelinkCount . FILTER(?sitelinkCount = 0) . ?item wikibase:statements 0 . # no statements (sometimes unreliable); alternative: ?statementCount . FILTER(?statementCount = 0) . MINUS { # not used in other items (mainsnak) ?mainsnakProperty wikibase:propertyType wikibase:WikibaseItem; wikibase:claim ?claim; wikibase:statementProperty ?statementProperty; wikibase:directClaim ?directClaim . [] ?claim [ ?statementProperty ?item ] . } MINUS { # not used in other items (as qualifier) ?qualifierProperty wikibase:propertyType wikibase:WikibaseItem; wikibase:qualifier ?qualifier . [] ?qualifier ?item . } MINUS { # not used in other items (as reference) ?referenceProperty wikibase:propertyType wikibase:WikibaseItem; wikibase:reference ?reference . [] prov:wasDerivedFrom [ ?reference ?item ] . } MINUS { # second check: no statements ?anyProperty a wikibase:Property; wikibase:claim ?anyClaim . ?item ?anyClaim [] . } MINUS { # second check: no sitelinks; unreliable as well ?sitelink schema:about ?item . } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
PREFIX prov: <http://www.w3.org/ns/prov#>
# Look for empty items (no sitelinks, no statements, no use in other items)
SELECT ?item {
  ?item wikibase:sitelinks 0 . # no sitelinks (sometimes unreliable); alternative: ?sitelinkCount . FILTER(?sitelinkCount = 0) .
  ?item wikibase:statements 0 . # no statements (sometimes unreliable); alternative: ?statementCount . FILTER(?statementCount = 0) .
  MINUS { # not used in other items (mainsnak)
    ?mainsnakProperty wikibase:propertyType wikibase:WikibaseItem; wikibase:claim ?claim; wikibase:statementProperty ?statementProperty; wikibase:directClaim ?directClaim .
    [] ?claim [ ?statementProperty ?item ] .
  }
  MINUS { # not used in other items (as qualifier)
    ?qualifierProperty wikibase:propertyType wikibase:WikibaseItem; wikibase:qualifier ?qualifier .
    [] ?qualifier ?item .
  }
  MINUS { # not used in other items (as reference)
    ?referenceProperty wikibase:propertyType wikibase:WikibaseItem; wikibase:reference ?reference .
    [] prov:wasDerivedFrom [ ?reference ?item ] .
  }
  MINUS { # second check: no statements
    ?anyProperty a wikibase:Property; wikibase:claim ?anyClaim .
    ?item ?anyClaim [] .
  }
  MINUS { # second check: no sitelinks; unreliable as well
    ?sitelink schema:about ?item .
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v11("?anyClaim") v10("?anyProperty") v3("?claim") v5("?directClaim") v1("?item"):::projected v2("?mainsnakProperty") v7("?qualifier") v6("?qualifierProperty") v9("?reference") v8("?referenceProperty") v12("?sitelink") v4("?statementProperty") a2((" ")) a3((" ")) a5((" ")) a1((" ")) a4((" ")) a6((" ")) c13(["wikibase:Property"]):::iri c5(["wikibase:WikibaseItem"]):::iri c2(["0^^xsd:integer"]):::literal v1 --"wikibase:sitelinks"--> c2 v1 --"wikibase:statements"--> c2 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v2 --"wikibase:propertyType"--> c5 v2 --"wikibase:claim"--> v3 v2 --"wikibase:statementProperty"--> v4 v2 --"wikibase:directClaim"--> v5 a1 -->v4--> v1 a2 -->v3--> a1 end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v6 --"wikibase:propertyType"--> c5 v6 --"wikibase:qualifier"--> v7 a3 -->v7--> v1 end subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v8 --"wikibase:propertyType"--> c5 v8 --"wikibase:reference"--> v9 a4 -->v9--> v1 a5 --"prov:wasDerivedFrom"--> a4 end subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v10 --"a"--> c13 v10 --"wikibase:claim"--> v11 v1 -->v11--> a6 end subgraph minus4["MINUS"] style minus4 stroke-width:6px,fill:pink,stroke:red; v12 --"schema:about"--> v1 end