Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing not found error #47

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion organisations/organisations.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ function findAuthorityData (trigger, searchterm, fid) {
var references = [];
for (var key in organisation_gnd_results) {
if (Number(key) != 'NaN') {
references.push(organisation_gnd_results[key].dnb.toUpperCase());
var dnb_id = getDnbId(organisation_gnd_results[key].recordID);
references.push(dnb_id);
}
}
console.log('FindAuthorityData: results (type is corporate and has DNB entry): ' + cnt);
Expand All @@ -45,6 +46,15 @@ function findAuthorityData (trigger, searchterm, fid) {
}


function getDnbId(viaf_id) {
var links = JSON.parse($.ajax({
url: 'http://www.viaf.org/viaf/' + viaf_id + '/justlinks.json',
dataType: 'json',
async: false,
}).responseText);
return links.DNB[0].substring(21);
}

function addLinksFromObjectToCollection(obj, collection){
/* Use SameAs relations to propagate further links.
* JSON-LD from culturegraph looks like:
Expand Down