Permalink
Browse files

Add jsonld suffix so RDFLib can guess format from file name

  • Loading branch information...
1 parent 27de70a commit ae8e707b00771b8e43498461ebbc607c27edd388 @niklasl niklasl committed Aug 4, 2016
Showing with 9 additions and 0 deletions.
  1. +9 −0 rdflib_jsonld/parser.py
@@ -47,6 +47,15 @@
__all__ = ['JsonLDParser', 'to_rdf']
+# Add jsonld suffix so RDFLib can guess format from file name
+try:
+ from rdflib.util import SUFFIX_FORMAT_MAP
+ if 'jsonld' not in SUFFIX_FORMAT_MAP:
+ SUFFIX_FORMAT_MAP['jsonld'] = 'application/ld+json'
+except ImportError:
+ pass
+
+
TYPE_TERM = Term(unicode(RDF.type), TYPE, VOCAB)
ALLOW_LISTS_OF_LISTS = True # NOTE: Not allowed in JSON-LD 1.0

0 comments on commit ae8e707

Please sign in to comment.