Permalink
Browse files

The key in the @context must use a CURIE whenever that is defined in …

…the file, and not the expanded vocabulary
  • Loading branch information...
1 parent 8dff8a4 commit bf0f380f6b5fa97b0289124355a38597ece42e3a @iherman iherman committed Dec 5, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 pyRdfaExtras/serializers/jsonserializer.py
@@ -16,9 +16,8 @@
#along with this program. If not, see <http://www.gnu.org/licenses/>.
# Modified by Ivan Herman, 2012, to produce a JSON-LD serialization: http://json-ld.org/spec/latest/json-ld-syntax
-
"""
-
+ $Id: jsonserializer.py,v 1.4 2012-12-05 19:18:17 ivan Exp $
"""
import sys
@@ -189,7 +188,8 @@ def _build(self, base=None, prefix_map=None, encode_literal=None, **kwds):
if p not in predicate_handled :
typ = OrderedDict()
typ['@type'] = '@id'
- context[p] = typ
+ cp = self.prefix_map.shrink(p)
+ context[cp if cp != None else p] = typ
# Context is done
_json_obj["@context"] = context

0 comments on commit bf0f380

Please sign in to comment.