Fix augmenting RDFS and RDF consistency
rdf/entailment/rdf.scm
42 | 42 | ((a b ...) | |
43 | 43 | (and (null? (filter | |
44 | 44 | (lambda (t) | |
45 | - | ((rdf-vocabulary-compatible? vocabulary) a t)) | |
45 | + | (not ((rdf-vocabulary-compatible? vocabulary) a t))) | |
46 | 46 | b)) | |
47 | 47 | (compatible? b))))) | |
48 | 48 |
rdf/entailment/rdfs.scm
42 | 42 | (valid-subclasses? graph))) | |
43 | 43 | ((_ graph ...) | |
44 | 44 | (valid-subclasses? graph)))) | |
45 | - | (and (valid-subclasses? (augment (recognize graph vocabulary) vocabulary)) | |
46 | - | (rdf:consistent-graph? graph vocabulary))) | |
45 | + | (let ((graph (augment (recognize graph vocabulary) vocabulary))) | |
46 | + | (and (valid-subclasses? graph) | |
47 | + | (rdf:consistent-graph? graph vocabulary)))) | |
47 | 48 | ||
48 | 49 | ;; G entails E if E has an instance (where blank nodes are replaced by literals | |
49 | 50 | ;; or IRIs) that is a subgraph of G. | |
… | |||
266 | 267 | (map | |
267 | 268 | (lambda (t) | |
268 | 269 | (make-rdf-triple t (rdf-iri "type") (rdfs-iri "Datatype"))) | |
269 | - | (rdf-vocabulary-datatypes voc)))) | |
270 | + | (rdf-vocabulary-datatypes voc)) | |
271 | + | g)) | |
270 | 272 | (g (append | |
271 | 273 | (append-map rdfs-axioms-container (rdf-container-properties g)) | |
272 | 274 | g))) | |
… | |||
293 | 295 | added? augment-set) | |
294 | 296 | (let ((p (rdf-triple-predicate t))) | |
295 | 297 | (cond | |
296 | - | ((is-iri? p "subClassOf") | |
298 | + | ((is-iri? p (rdfs-iri "subClassOf")) | |
297 | 299 | (inner-loop (cons t graph) (cons t subclasses) subprops | |
298 | 300 | ranges domains types #t augment-set)) | |
299 | - | ((is-iri? p "subPropertyOf") | |
301 | + | ((is-iri? p (rdfs-iri "subPropertyOf")) | |
300 | 302 | (inner-loop (cons t graph) subclasses (cons t subprops) | |
301 | 303 | ranges domains types #t augment-set)) | |
302 | - | ((is-iri? p "range") | |
304 | + | ((is-iri? p (rdfs-iri "range")) | |
303 | 305 | (inner-loop (cons t graph) subclasses subprops | |
304 | 306 | (cons t ranges) domains types #t augment-set)) | |
305 | - | ((is-iri? p "domain") | |
307 | + | ((is-iri? p (rdfs-iri "domain")) | |
306 | 308 | (inner-loop (cons t graph) subclasses subprops | |
307 | 309 | ranges (cons t domains) types #t augment-set)) | |
308 | - | ((is-iri? p "type") | |
310 | + | ((is-iri? p (rdf-iri "type")) | |
309 | 311 | (inner-loop (cons t graph) subclasses subprops | |
310 | 312 | ranges domains (cons t types) #t augment-set)) | |
311 | 313 | (else |
rdf/rdf.scm
187 | 187 | ;; be well-formed according to section 2.2.9 of [BCP47]. | |
188 | 188 | ||
189 | 189 | (define-record-type rdf-literal | |
190 | - | (make-rdf-literal lexical-form type language-tag) | |
190 | + | (make-rdf-literal lexical-form type langtag) | |
191 | 191 | rdf-literal? | |
192 | 192 | (lexical-form rdf-literal-lexical-form) | |
193 | 193 | (type rdf-literal-type) | |
194 | - | (language-tag rdf-literal-language-tag)) | |
194 | + | (langtag rdf-literal-langtag)) | |
195 | 195 | ||
196 | 196 | ;; From the specification: | |
197 | 197 | ;; Blank nodes are disjoint from IRIs and literals. Otherwise, the set of |