Add rdf:XMLLiteral for test support
rdf/rdf.scm
18 | 18 | (define-module (rdf rdf) | |
19 | 19 | #:use-module (srfi srfi-1) | |
20 | 20 | #:use-module (srfi srfi-9) | |
21 | + | #:use-module (sxml simple) | |
21 | 22 | #:use-module (ice-9 match) | |
22 | 23 | #:export (rdf-datatype | |
23 | 24 | make-rdf-datatype | |
… | |||
30 | 31 | rdf-datatype-value->lexical | |
31 | 32 | ||
32 | 33 | rdf:langString | |
34 | + | rdf:XMLLiteral | |
33 | 35 | ||
34 | 36 | rdf-dataset | |
35 | 37 | make-rdf-dataset | |
… | |||
104 | 106 | string-downcase | |
105 | 107 | identity)) | |
106 | 108 | ||
109 | + | (define rdf:XMLLiteral | |
110 | + | (make-rdf-datatype | |
111 | + | '("http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral") | |
112 | + | "RDF provides for XML content as a possible literal value. Such content | |
113 | + | is indicated in an RDF graph using a literal whose datatype is set to | |
114 | + | rdf:XMLLiteral. This datatype is defined as non-normative because it depends | |
115 | + | on [DOM4], a specification that has not yet reached W3C Recommendation status." | |
116 | + | (lambda (l) | |
117 | + | (false-if-exception (xml->sxml l))) | |
118 | + | (lambda (v) | |
119 | + | (false-if-exception (sxml->xml v))) | |
120 | + | xml->sxml | |
121 | + | sxml->xml)) | |
122 | + | ||
107 | 123 | ;; From the specification: | |
108 | 124 | ;; An RDF dataset is a collection of RDF graphs, and comprises: | |
109 | 125 | ;; |
test-modules/online.scm
157 | 157 | (recognized | |
158 | 158 | (map | |
159 | 159 | (lambda (iri) | |
160 | - | (let loop ((types xsd:datatypes)) | |
160 | + | (let loop ((types (cons* rdf:XMLLiteral rdf:langString | |
161 | + | xsd:datatypes))) | |
161 | 162 | (match types | |
162 | - | (() #f) | |
163 | + | (() (throw 'didnotrecognize iri)) | |
163 | 164 | ((type types ...) | |
164 | 165 | (if (member iri (rdf-datatype-iris type)) | |
165 | 166 | (pk 'recognized-type type) |