summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Car <nicholas.car@surroundaustralia.com>2021-09-10 10:06:41 +1000
committerGitHub <noreply@github.com>2021-09-10 10:06:41 +1000
commitfd935e2a7480d19a0c03a6757107767f94c01acd (patch)
tree14a42572ce95e35fe900d0536361a19b5e6b3627
parent27216580449033a11b2552cc2f9ff6f9aaedabd8 (diff)
parente778e9413510721c2fedaae56d4ff826df265c30 (diff)
downloadrdflib-fd935e2a7480d19a0c03a6757107767f94c01acd.tar.gz
Merge pull request #1403 from ajnelson-nist/add-json-ld-to-guess-format
Add JSON-LD to guess_format()
-rw-r--r--rdflib/util.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/rdflib/util.py b/rdflib/util.py
index fe32c7f2..28ca0836 100644
--- a/rdflib/util.py
+++ b/rdflib/util.py
@@ -364,6 +364,8 @@ SUFFIX_FORMAT_MAP = {
"svg": "rdfa",
"nq": "nquads",
"trig": "trig",
+ "json": "json-ld",
+ "jsonld": "json-ld",
}
@@ -378,6 +380,8 @@ def guess_format(fpath, fmap=None):
'xml'
>>> guess_format('path/to/file.ttl')
'turtle'
+ >>> guess_format('path/to/file.json')
+ 'json-ld'
>>> guess_format('path/to/file.xhtml')
'rdfa'
>>> guess_format('path/to/file.svg')