From 462519578603071331e84a2b93dfa230cb2c1756 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 12 Oct 2007 01:24:33 +0000 Subject: [PATCH] Implement READ-RDF/TURTLE. --- v7/src/xml/turtle.scm | 27 ++++++++++++++++----------- v7/src/xml/xml.pkg | 3 ++- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/v7/src/xml/turtle.scm b/v7/src/xml/turtle.scm index 1c7e70327..aaede2c8f 100644 --- a/v7/src/xml/turtle.scm +++ b/v7/src/xml/turtle.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: turtle.scm,v 1.34 2007/10/08 03:05:41 cph Exp $ +$Id: turtle.scm,v 1.35 2007/10/12 01:24:33 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -35,16 +35,21 @@ USA. (let ((pathname (pathname-default-type pathname "ttl"))) (call-with-input-file pathname (lambda (port) - (port/set-coding port 'UTF-8) - (with-rdf-input-port port - (lambda () - (post-process-parser-output - (parse-turtle-doc (input-port->parser-buffer port)) - (if (default-object? base-uri) - (pathname->uri (merge-pathnames pathname)) - (merge-uris - (file-namestring pathname) - (->absolute-uri base-uri 'READ-RDF/TURTLE-FILE)))))))))) + (read-rdf/turtle + port + (if (default-object? base-uri) + (pathname->uri (merge-pathnames pathname)) + (merge-uris + (file-namestring pathname) + (->absolute-uri base-uri 'READ-RDF/TURTLE-FILE)))))))) + +(define (read-rdf/turtle port base-uri) + (port/set-coding port 'UTF-8) + (with-rdf-input-port port + (lambda () + (post-process-parser-output + (parse-turtle-doc (input-port->parser-buffer port)) + (->absolute-uri base-uri 'READ-RDF/TURTLE))))) (define parse-turtle-doc (*parser diff --git a/v7/src/xml/xml.pkg b/v7/src/xml/xml.pkg index 33a2bc704..2c38dcf89 100644 --- a/v7/src/xml/xml.pkg +++ b/v7/src/xml/xml.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: xml.pkg,v 1.99 2007/08/16 14:42:08 cph Exp $ +$Id: xml.pkg,v 1.100 2007/10/12 01:24:33 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -628,6 +628,7 @@ USA. (files "turtle") (parent (runtime rdf)) (export () + read-rdf/turtle read-rdf/turtle-file write-rdf/turtle write-rdf/turtle-file -- 2.25.1