[Python-modules-commits] [python-pyld] 93/276: Update to fix value compaction when there is a default language.

Wolfgang Borgert debacle at moszumanska.debian.org
Wed Oct 8 23:47:57 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository python-pyld.

commit f3976d987f3b111910e505a1a2804bd5325684cd
Author: Dave Longley <dlongley at digitalbazaar.com>
Date:   Tue Jun 12 20:35:37 2012 -0400

    Update to fix value compaction when there is a default language.
---
 lib/pyld/jsonld.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/pyld/jsonld.py b/lib/pyld/jsonld.py
index c78011e..45f6db0 100644
--- a/lib/pyld/jsonld.py
+++ b/lib/pyld/jsonld.py
@@ -1009,9 +1009,13 @@ class JsonLdProcessor:
         if _is_object(element):
             # element is a @value
             if _is_value(element):
-                # if @value is the only key, return its value
+                # if @value is the only key
                 if len(element) == 1:
-                    return element['@value']
+                    # if there is no default language, return value of @value
+                    if '@language' not in ctx:
+                        return element['@value']
+                    # return full element
+                    return element
 
                 # get type and language context rules
                 type = JsonLdProcessor.get_context_value(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pyld.git



More information about the Python-modules-commits mailing list