User:Azertus/SPARQL

Resources

edit
Wikidata:SPARQL query service/queries
Wikidata:SPARQL query service/query limits
Wikidata:SPARQL query service/query optimization
Wikidata:SPARQL query service/suggestions

Queries

edit
SELECT ?variant_of_interest ?variant_of_interestLabel ?startTime ?name WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?variant_of_interest wdt:P31 wd:Q107059450.
  OPTIONAL {
    ?variant_of_interest p:P31 _:b14.
    _:b14 pq:P580 ?startTime.
    ?variant_of_interest wdt:P1448 ?name.
  }
}
LIMIT 100
Try it!
  • # Description: Finds family name items that are linked to a dab using different from,
    #              but which don't have the correct criterion.
    # QuickStatements: https://tools.wmflabs.org/quickstatements/#/batch/4287
    
    SELECT ?item ?dab
    WHERE 
    {
      ?item wdt:P31 wd:Q101352.
      ?item p:P1889 ?dabStatement.
      ?dabStatement ps:P1889 ?dab.
      MINUS {?dabStatement pq:P1013 wd:Q27924673}
      MINUS {?item wdt:P31 wd:Q777342}
      #?dabStatement pq:P1013 ?crit. # uncomment to find items with the *wrong* criterion
      ?dab wdt:P31 wd:Q4167410.
    }
    #LIMIT 10
    
    family name dabs
Used for https://tools.wmflabs.org/quickstatements/#/batch/4287