Skip to content

Query for type-constraint validation on Wikidata hits memory limit #2490

@nicolasferranti

Description

@nicolasferranti

Hi! I'm posting one of hte queries we were talking about at ISWC https://qlever.dev/wikidata/5uilMW

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
SELECT DISTINCT ?subject ?wd_property ?object ?statement WHERE {
  ?wd_property wikibase:directClaim wdt:P10689. # originally, processing for all PIDs
 ?wd_property p:P2302 ?statement . ?statement ps:P2302 wd:Q21503250. ## type constraint
  ?statement pq:P2309 wd:Q30208840. # instance or subclass-of    
  ?subject wdt:P10689 ?object .
  FILTER NOT EXISTS { ?statement pq:P2308 ?allowed_class . ?subject ( wdt:P31 / wdt:P279 * ) | wdt:P279 * ?allowed_class }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions