[Python-modules-commits] [python-pyld] 19/276: Removed xsd:anyURI usage.

Wolfgang Borgert debacle at moszumanska.debian.org
Wed Oct 8 23:47:49 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 33e3601ad268af8d17403738a077d026347db4d1
Author: Dave Longley <dlongley at digitalbazaar.com>
Date:   Thu Aug 25 20:13:41 2011 -0400

    Removed xsd:anyURI usage.
---
 lib/pyld/jsonld.py | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/lib/pyld/jsonld.py b/lib/pyld/jsonld.py
index 1f77dd2..2f8cb2b 100644
--- a/lib/pyld/jsonld.py
+++ b/lib/pyld/jsonld.py
@@ -16,11 +16,9 @@ ns = {
 }
 
 xsd = {
-    'anyType': ns['xsd'] + 'anyType',
     'boolean': ns['xsd'] + 'boolean',
     'double': ns['xsd'] + 'double',
-    'integer': ns['xsd'] + 'integer',
-    'anyURI': ns['xsd'] + 'anyURI'
+    'integer': ns['xsd'] + 'integer'
 }
 
 ##
@@ -577,7 +575,7 @@ class Processor:
                         type = value['@datatype']
                     # datatype is IRI
                     elif '@iri' in value:
-                        type = xsd['anyURI']
+                        type = '@iri'
                     # can be coerced to any type
                     else:
                         type = coerce
@@ -629,7 +627,7 @@ class Processor:
                 rval = copy.copy(value)
 
             # compact IRI
-            if type == xsd['anyURI']:
+            if type == '@iri':
                 if isinstance(rval, dict):
                     rval[keywords['@iri']] = _compactIri(
                         ctx, rval[keywords['@iri']], usedCtx)
@@ -720,7 +718,7 @@ class Processor:
                 rval = {}
 
                 # expand IRI
-                if coerce == xsd['anyURI']:
+                if coerce == '@iri':
                     rval['@iri'] = _expandTerm(ctx, value, None)
                 # other datatype
                 else:
@@ -801,7 +799,7 @@ class Processor:
 
         # built-in type coercion JSON-LD-isms
         if p == '@subject' or p == ns['rdf'] + 'type':
-            rval = xsd['anyURI']
+            rval = '@iri'
 
         # check type coercion for property
         elif '@coerce' in ctx:
@@ -819,11 +817,6 @@ class Processor:
                     # property found
                     if i == p:
                         rval = _expandTerm(ctx, type, usedCtx)
-
-                        # '@iri' is shortcut for xsd['anyURI']
-                        if rval == '@iri':
-                           rval = xsd['anyURI']
-
                         if usedCtx is not None:
                             if '@coerce' not in usedCtx:
                                 usedCtx['@coerce'] = {}

-- 
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