semantic-ko icon indicating copy to clipboard operation
semantic-ko copied to clipboard

env undefined error on json-ld value "@graph"

Open drewp opened this issue 13 years ago • 0 comments

When I run this: var store = new rdfstore.Store({}, function () { }); store.load('remote', 'somejsonld.js', function (success, results) {});

What happens is jsonld.toTriples in its callback calls Utils.lexicalFormTerm(p) (no second arg), and then that calls Utils.lexicalFormBaseUri(term, ns) (ns is undefined), which contains this line: uri = (env.base||"") + uri; // typeerror since undefined has no attribute 'base'

It seems like lexicalFormBaseUri should be able tolerate an omitted env, or toTriples should pass something like {}.

FYI, in my case the value of p was {token:"uri", value:"@graph"}.

drewp avatar Dec 24 '12 03:12 drewp