[isidorus-cvs] r116 - in trunk/src: unit_tests xml/rdf

Lukas Giessmann lgiessmann at common-lisp.net
Tue Aug 18 17:16:22 UTC 2009


Author: lgiessmann
Date: Tue Aug 18 13:16:21 2009
New Revision: 116

Log:
rdf-importer: fixed a bug with parsing property nodes

Modified:
   trunk/src/unit_tests/rdf_importer_test.lisp
   trunk/src/xml/rdf/importer.lisp
   trunk/src/xml/rdf/rdf_tools.lisp

Modified: trunk/src/unit_tests/rdf_importer_test.lisp
==============================================================================
--- trunk/src/unit_tests/rdf_importer_test.lisp	(original)
+++ trunk/src/unit_tests/rdf_importer_test.lisp	Tue Aug 18 13:16:21 2009
@@ -332,7 +332,6 @@
 	  (dom:set-attribute-ns prop *rdf-ns* "unknown" "unknown")
 	  (is-true (rdf-importer::parse-property prop 0))
 	  (dom:append-child prop text-node)
-	  (signals error (rdf-importer::parse-property prop 0))
 	  (dom:remove-child prop text-node)
 	  (is-true (rdf-importer::parse-property prop 0))
 	  (dom:remove-attribute-ns prop *rdf-ns* "unknown")

Modified: trunk/src/xml/rdf/importer.lisp
==============================================================================
--- trunk/src/xml/rdf/importer.lisp	(original)
+++ trunk/src/xml/rdf/importer.lisp	Tue Aug 18 13:16:21 2009
@@ -876,8 +876,8 @@
       (error "~aliteral content not allowed here: ~a"
 	     err-pref content))
     (loop for arc across content
-       do (import-arc arc tm-id start-revision :document-id document-id
-		      :xml-base fn-xml-base :xml-lang fn-xml-lang))))
+       collect (import-arc arc tm-id start-revision :document-id document-id
+			   :xml-base fn-xml-base :xml-lang fn-xml-lang))))
 
 
 (defun make-recursion-from-arc (arc tm-id start-revision

Modified: trunk/src/xml/rdf/rdf_tools.lisp
==============================================================================
--- trunk/src/xml/rdf/rdf_tools.lisp	(original)
+++ trunk/src/xml/rdf/rdf_tools.lisp	Tue Aug 18 13:16:21 2009
@@ -359,24 +359,29 @@
     (when (and nodeID resource)
       (error "~aondly one of rdf:nodeID and rdf:resource is allowed: (~a) (~a)!"
 	     err-pref nodeID resource))
-    (when (and (or nodeID resource type)
+    (when (and (or nodeID resource type literals)
 	       datatype)
       (error "~aonly one of ~a and rdf:datatype (~a) is allowed!"
 	     err-pref
 	     (cond
 	       (nodeID (concatenate 'string "rdf:nodeID (" nodeID ")"))
 	       (resource (concatenate 'string "rdf:resource (" resource ")"))
-	       (type (concatenate 'string "rdf:type (" type ")")))
+	       (type (concatenate 'string "rdf:type (" type ")"))
+	       (literals literals))
 	     datatype))
-    (when (and (or type nodeID resource)
+    (when (and (or nodeID resource)
 	       (> (length content) 0))
       (error "~awhen ~a is set no content is allowed: ~a!"
 	     err-pref
 	     (cond
-	       (type (concatenate 'string "rdf:type (" type ")"))
 	       (nodeID (concatenate 'string "rdf:nodeID (" nodeID ")"))
 	       (resource (concatenate 'string "rdf:resource (" resource ")")))
 	     content))
+    (when (and type
+	       (stringp content)
+	       (> (length content) 0))
+      (error "~awhen rdf:type is set no literal content is allowed: ~a!"
+	     err-pref content))
     (when (and (or type
 		   (and (string= node-name "type")
 			(string= node-ns *rdf-ns*))




More information about the Isidorus-cvs mailing list