query-fdd8509e80e87fe31f8c443539fd0cee
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
- https://query.wikidata.org/sparql
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 .
}
}