diff options
author | Pjotr Prins | 2025-07-16 10:55:41 +0200 |
---|---|---|
committer | Pjotr Prins | 2025-07-16 10:55:41 +0200 |
commit | 7b80128e3e706bc44eb60d565634cac2eba8c7a1 (patch) | |
tree | 4928e5eb07e568024a9ff0d7905ee8b269b47b8e /gn/db/sources/wikidata.scm | |
parent | 32d4b0c0bb60723d4fcaa61d85d97ecba37ecb5b (diff) | |
download | gn-guile-7b80128e3e706bc44eb60d565634cac2eba8c7a1.tar.gz |
aliases: we now have a list of deduplicatied aliases
Diffstat (limited to 'gn/db/sources/wikidata.scm')
-rw-r--r-- | gn/db/sources/wikidata.scm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gn/db/sources/wikidata.scm b/gn/db/sources/wikidata.scm index fe495c5..954ce93 100644 --- a/gn/db/sources/wikidata.scm +++ b/gn/db/sources/wikidata.scm @@ -55,10 +55,11 @@ curl -G https://query.wikidata.org/sparql -H "Accept: application/json; charset= ?wikidata_id rdfs:label \"" gene_name "\"@en .}")) (define (wikidata-query-gene-aliases wikidata_id) - "SPARQL query to get a list of gene aliases based on a wikidata identifier, e.g. for Q24420953" + "SPARQL query to get a list of gene aliases based on a wikidata identifier, e.g. for Q24420953. This +version supports the expanded id only, so <http://www.wikidata.org/entity/Q24420953> including the <,>." (string-append - "SELECT DISTINCT ?alias - WHERE { - wd:" wikidata_id " rdfs:label ?name ; + "SELECT DISTINCT ?stripped_alias + WHERE { " wikidata_id " rdfs:label ?name ; skos:altLabel ?alias . + BIND (STR(?alias) AS ?stripped_alias) . FILTER(LANG(?name) = \"en\" && LANG(?alias) = \"en\").}")) |