Project:SPARQL/examples: Difference between revisions

Jump to navigation Jump to search
Line 588: Line 588:
   FILTER NOT EXISTS {
   FILTER NOT EXISTS {
     ?item ppt:P29 ?parent.
     ?item ppt:P29 ?parent.
  }
  BIND (ENCODE_FOR_URI(REPLACE(STR(?item), ".*Q", "Q")) AS ?qid)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
</sparql>
===Formally named taxon items not mapped to Wikidata===
<sparql tryit="1">
PREFIX pp: <https://ppsdb.wikibase.cloud/entity/>
PREFIX ppt: <https://ppsdb.wikibase.cloud/prop/direct/>
SELECT DISTINCT ?item ?qid ?itemLabel WHERE {
  ?item ppt:P18 pp:Q2206.
  #FILTER NOT EXISTS { ?item ppt:P18 pp:Q1488. } # not a higher taxon
  FILTER NOT EXISTS {
    ?item ppt:P2 ?parent.
   }
   }
   BIND (ENCODE_FOR_URI(REPLACE(STR(?item), ".*Q", "Q")) AS ?qid)
   BIND (ENCODE_FOR_URI(REPLACE(STR(?item), ".*Q", "Q")) AS ?qid)

Navigation menu