Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle @type blank node IRIs.

  • Loading branch information...
commit 5f9bba309482c58c897cfe5777b01bbff3b6e83c 1 parent a91ceef
@dlongley dlongley authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 js/jsonld.js
View
8 js/jsonld.js
@@ -2352,8 +2352,8 @@ function _flatten(input, graphs, graph, namer, name, list) {
continue;
}
- // copy keywords
- if(_isKeyword(prop)) {
+ // copy non-@type keywords
+ if(prop !== '@type' && _isKeyword(prop)) {
subject[prop] = input[prop];
continue;
}
@@ -2379,6 +2379,10 @@ function _flatten(input, graphs, graph, namer, name, list) {
_flatten(o['@list'], graphs, graph, namer, name, _list);
o = {'@list': _list};
}
+ // special-handle @type IRIs
+ else if(prop === '@type' && o.indexOf('_:') === 0) {
+ o = namer.getName(o);
+ }
// add non-subject
jsonld.addValue(subject, prop, o, true);
Please sign in to comment.
Something went wrong with that request. Please try again.