DebugQueries
This page contains several SPARQL-Queries to help debug the graph.
Missing Properties
No Resources
Returns all Items, that don't have any resource that they link to.
Note: Only searches through items that have a subclass, to avoid duplicates {{#widget:SPARQLquery|code=
- All Items with no linked resources
- defaultView:Table
PREFIX wdt: <https://graphit.ur.de/prop/direct/> PREFIX wd: <https://graphit.ur.de/entity/> SELECT ?source ?sourceLabel ?resource ?resourceLabel WHERE {
# Selects all items that have a subclass (as all should) that do not have a resource
?source wdt:P2 ?class.
MINUS {?source wdt:P21 ?resource. }
service wikibase:label { bd:serviceParam wikibase:language "en". }
} }}
No Subclass
Returns all Items, that don't have a property subclass. {{#widget:SPARQLquery|code=
- All Items no subclass
- defaultView:Table
PREFIX wdt: <https://graphit.ur.de/prop/direct/> PREFIX wd: <https://graphit.ur.de/entity/> SELECT ?source ?sourceLabel ?resource ?resourceLabel WHERE {
?source wdt:P1 ?dependency.
MINUS {?source wdt:P2 ?class. }
service wikibase:label { bd:serviceParam wikibase:language "en" }
} }}
No Dependencies
Returns all Items, that don't link any other items as dependency.
These items don't have a property depends on. This could mean, that they are a source or that they are orphaned. {{#widget:SPARQLquery|code=
- All items that don't linkt to another item (no dependency)
- defaultView:Table
PREFIX wdt: <https://graphit.ur.de/prop/direct/> PREFIX wd: <https://graphit.ur.de/entity/> SELECT ?source ?sourceLabel ?resource ?resourceLabel WHERE {
?source wdt:P2 ?class.
MINUS {?source wdt:P1 ?dependency.}
service wikibase:label { bd:serviceParam wikibase:language "en" }
} }}
Orphans
Returns all items, that don't link to any other items and are not linked to in return.
NOTE: Not sure if this works. {{#widget:SPARQLquery|code=
- All items that don't linkt to another item (no dependency)
- defaultView:Table
PREFIX wdt: <https://graphit.ur.de/prop/direct/> PREFIX wd: <https://graphit.ur.de/entity/> SELECT ?source ?sourceLabel ?resource ?resourceLabel WHERE {
?source wdt:P2 ?class. # get all items that have a subclass.
MINUS {?dependency wdt:P1 ?source}. # Remove all items that have the ?source as a dependency
MINUS {?source wdt:P1 ?dependency}. # Remove all items that have a dependency
service wikibase:label { bd:serviceParam wikibase:language "en" }
} }}