Skip to content

Commit

Permalink
Fix lang processing
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Mar 24, 2023
1 parent d626f99 commit 38fb188
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions asset/js/uri-dereferencer-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ UriDereferencer.addService({
return `https://www.wikidata.org/wiki/Special:EntityData/${match[1]}.json`;
},
getMarkup(uri, text, lang) {
lang = lang ?? 'en';
if (!lang) lang = 'en';
const match = this.getMatch(uri);
const json = JSON.parse(text);
const data = new Map();
Expand Down Expand Up @@ -154,7 +154,7 @@ UriDereferencer.addService({
return `http://dbpedia.org/data/${match[1]}.json`;
},
getMarkup(uri, text, lang) {
lang = lang ?? 'en';
if (!lang) lang = 'en';
const match = this.getMatch(uri);
const json = JSON.parse(text);
const data = new Map();
Expand Down Expand Up @@ -195,7 +195,7 @@ UriDereferencer.addService({
return (null !== this.getMatch(uri));
},
getResourceUrl(uri, lang) {
lang = lang ?? 'en';
if (!lang) lang = 'en';
// Note that Getty doesn't enable cross-origin resource sharing (CORS),
// so we can't directly fetch the JSON representations. Use the SPARQL
// endpoint instead.
Expand Down Expand Up @@ -435,7 +435,7 @@ UriDereferencer.addService({
return `http://rdaregistry.info/termList/${match[1]}.jsonld`;
},
getMarkup(uri, text, lang) {
lang = lang ?? 'en';
if (!lang) lang = 'en';
const match = this.getMatch(uri);
const canonicalUri = `http://rdaregistry.info/termList/${match[1]}/${match[2]}`;
const json = JSON.parse(text);
Expand Down

0 comments on commit 38fb188

Please sign in to comment.