Change WRITE-RDF/TURTLE-TRIPLES to elide unreferenced bnodes.
authorChris Hanson <org/chris-hanson/cph>
Thu, 22 Feb 2007 18:39:43 +0000 (18:39 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 22 Feb 2007 18:39:43 +0000 (18:39 +0000)
v7/src/xml/turtle.scm

index 6b239bed847c48716424a666a56c01b7a92a1473..56c4edbe9c47d186f44b67065c6a8f8d38c7f116 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: turtle.scm,v 1.21 2007/02/22 18:39:13 cph Exp $
+$Id: turtle.scm,v 1.22 2007/02/22 18:39:43 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -603,14 +603,13 @@ USA.
                       3
                       (lambda (t)
                         (let ((s (rdf-triple-subject t)))
-                          (if (uri? s)
-                              0
-                              (if (= (count-matching-items triples
-                                       (lambda (t)
-                                         (eq? (rdf-triple-object t) s)))
-                                     1)
-                                  1
-                                  2)))))
+                          (cond ((uri? s) 0)
+                                ((= (count-matching-items triples
+                                      (lambda (t)
+                                        (eq? (rdf-triple-object t) s)))
+                                    1)
+                                 1)
+                                (else 2)))))
       (let ((inline-bnode
             (let ((in-line (group-triples-by-subject in-line)))
               (lambda (bnode)