aboutsummaryrefslogtreecommitdiff
path: root/gn/db/sources/wikidata.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gn/db/sources/wikidata.scm')
-rw-r--r--gn/db/sources/wikidata.scm9
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\").}"))