Project:SPARQL/examples: Difference between revisions

Jump to navigation Jump to search
Line 120: Line 120:
   BIND (ENCODE_FOR_URI(REPLACE(STR(?host), ".*Q", "Q")) AS ?qid) # article item
   BIND (ENCODE_FOR_URI(REPLACE(STR(?host), ".*Q", "Q")) AS ?qid) # article item
   BIND ("Q2" AS ?P18)
   BIND ("Q2" AS ?P18)
}
</sparql>
===Generate QuickStatements to add "instance of: placeholder taxon" to items with P28 statements===
P28 "representative sequence for placeholder taxon" is intended for placeholder taxa, i.e. items that are described in the literature like taxa or provisional taxa and have a published phylogenetic marker sequence, but where a matching taxon ID in NCBI Taxonomy is not yet assigned.
<sparql tryit="1">
PREFIX pp: <https://ppsdb.wikibase.cloud/entity/>
PREFIX ppt: <https://ppsdb.wikibase.cloud/prop/direct/>
PREFIX pps: <https://ppsdb.wikibase.cloud/prop/>
PREFIX ppss: <https://ppsdb.wikibase.cloud/prop/statement/>
PREFIX ppsq: <https://ppsdb.wikibase.cloud/prop/qualifier/>
SELECT DISTINCT ?qid ?P18 WHERE {
  ?item ppt:P28 ?repseq
  FILTER NOT EXISTS {
    ?item ppt:P18 pp:Q56
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  BIND (ENCODE_FOR_URI(REPLACE(STR(?item), ".*Q", "Q")) AS ?qid) # article item
  BIND ("Q56" AS ?P18)
}
}
</sparql>
</sparql>

Navigation menu