mirror of
https://github.com/zotero/zotero.git
synced 2026-09-25 01:01:20 +00:00
Zotero.Translate.IO._RDFSandbox.getResourceURI should return the contents of rdf:value where available
This commit is contained in:
parent
83e261930e
commit
89782e78bf
1 changed files with 5 additions and 0 deletions
|
|
@ -2639,6 +2639,11 @@ Zotero.Translate.IO._RDFSandbox.prototype = {
|
|||
*/
|
||||
"getResourceURI":function(resource) {
|
||||
if(typeof(resource) == "string") return resource;
|
||||
|
||||
const rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
|
||||
var values = this.getTargets(resource, rdf + 'value');
|
||||
if(values && values.length) return this.getResourceURI(values[0]);
|
||||
|
||||
if(resource.uri) return resource.uri;
|
||||
if(resource.toNT == undefined) throw new Error("Zotero.RDF: getResourceURI called on invalid resource");
|
||||
return resource.toNT();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue