Project:SPARQL/examples: Difference between revisions

Line 537: Line 537:
</sparql>
</sparql>


===All places (by coordinate location on wikidata), filtering out places already listed as instance of location===
===All places (by coordinate location on wikidata), filtering out places already listed as instance of locality===


<sparql tryit="1">
<sparql tryit="1">
# All places (by coordinate location on wikidata), filtering out places already listed as instance of location
# All places (by coordinate location on wikidata), filtering out places already listed as instance of locality


PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
Line 560: Line 560:
   ?place bnwdt:P33 ?admin_area .  #select items with 'located in the administrative territorial entity' statements
   ?place bnwdt:P33 ?admin_area .  #select items with 'located in the administrative territorial entity' statements
   ?place bnwdt:P117 ?Qnumber .    #get wikidata ID
   ?place bnwdt:P117 ?Qnumber .    #get wikidata ID
   FILTER NOT EXISTS {?place bnwdt:P12 bnwd:Q2144 .}      #filter out places already listed as instance of location
   FILTER NOT EXISTS {?place bnwdt:P12 bnwd:Q2147 .}      #filter out places already listed as instance of locality
    
    
   #create reference to Wikibase entity
   #create reference to Wikibase entity