More robust Wikidata entity name lookup
authorDan Scott <dscott@laurentian.ca>
Wed, 24 May 2017 04:34:39 +0000 (00:34 -0400)
committerDan Scott <dscott@laurentian.ca>
Mon, 17 Jul 2017 16:09:02 +0000 (12:09 -0400)
Check the alternate labels and nicknames as well.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/web/js/ui/default/opac/wikidata_music_card.js

index 8174871..e7ffa8e 100644 (file)
@@ -48,7 +48,7 @@
   function findPerformer(performer, entity_name) {
     var url = 'https://query.wikidata.org/sparql';
     var query = 'SELECT DISTINCT ?item ?itemLabel ?itemDescription ?image ?website ?songKick WHERE {' +
-        '?item rdfs:label "' + entity_name + '"@en . ' +
+        '?item rdfs:label|skos:altLabel|wdt:P1449 "' + entity_name + '"@en . ' +
         '{ ?item wdt:P31 wd:Q215380 . } ' + // band
         'UNION ' +
         '{ ?item wdt:P31 wd:Q5741069 . } ' + // rock band