17,522
edits
No edit summary |
|||
Line 376: | Line 376: | ||
</sparql> | </sparql> | ||
=== Generate QuickStatements to link | === Generate QuickStatements to link taxa to Wikidata items by matching NCBI taxon ID === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
Line 386: | Line 386: | ||
PREFIX ppsr: <https://ppsdb.wikibase.cloud/prop/reference/> | PREFIX ppsr: <https://ppsdb.wikibase.cloud/prop/reference/> | ||
SELECT DISTINCT ?qid ?P2 | SELECT DISTINCT ?qid ?P2 | ||
WITH { | WITH { | ||
SELECT DISTINCT ? | SELECT DISTINCT ?ppitem ?qid ?ncbi ?pplabel | ||
WHERE { | WHERE { | ||
? | ?ppitem ppt:P11 ?ncbi. | ||
?ppitem rdfs:label ?pplabel. | |||
? | FILTER NOT EXISTS { ?ppitem ppt:P2 ?wikidata_mapping. } | ||
FILTER NOT EXISTS { ? | BIND (ENCODE_FOR_URI(REPLACE(STR(?ppitem), ".*Q", "Q")) AS ?qid) | ||
BIND (ENCODE_FOR_URI(REPLACE(STR(? | |||
} | } | ||
} AS %ncbis | } AS %ncbis | ||
Line 401: | Line 399: | ||
INCLUDE %ncbis | INCLUDE %ncbis | ||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
?wditem wdt:P685 ?ncbi; | |||
? | |||
rdfs:label ?wdlabel. | rdfs:label ?wdlabel. | ||
FILTER ( LANG(?wdlabel) = "en" ) | FILTER ( LANG(?wdlabel) = "en" ) | ||
BIND (CONCAT('\"', STR(?wditem), '\"') AS ?P2) | |||
} | } | ||
} | } | ||
</sparql> | </sparql> | ||
===Graph of all classes=== | ===Graph of all classes=== |