WolfgangFahl / PyGenericSpreadSheet

Generic Spreadsheet Editing API
Apache License 2.0
0 stars 0 forks source link

allow items as values in getValuesClause #6

Closed WolfgangFahl closed 2 years ago

WolfgangFahl commented 2 years ago
# 
# get Continent records 
#  
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX schema: <http://schema.org/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?itemLabel ?itemDescription

  ?population
  ?Library_of_Congress_authority_ID ?Library_of_Congress_authority_IDUrl
WHERE {
  ?item rdfs:label ?itemLabel.
  FILTER(LANG(?itemLabel) = "en")
  OPTIONAL { 
    ?item schema:description ?itemDescription.
    FILTER(LANG(?itemDescription) = "en")
  }

  ?item wdt:P31 wd:Q5107.
  OPTIONAL {
    ?item wdt:P1082 ?population.
  }
  OPTIONAL {
    ?item wdt:P244 ?Library_of_Congress_authority_ID.
    wd:P244 wdt:P1630 ?Library_of_Congress_authority_IDFormatterUrl.
    BIND(IRI(REPLACE(?Library_of_Congress_authority_ID, '^(.+)$', ?Library_of_Congress_authority_IDFormatterUrl)) AS ?Library_of_Congress_authority_IDUrl).
  }

  VALUES(?item) {
   ( wd:Q15 )
   ( wd:Q51 )
   ( wd:Q48 )
   ( wd:Q46 )
   ( wd:Q49 )
   ( wd:Q538 )
   ( wd:Q18 )
  }.
}
ORDER BY ?item