augment before checking consistency

Julien LepillerSun Apr 05 04:15:18+0200 2020

322ee95

augment before checking consistency

rdf/entailment/rdf.scm

6666
                                     '())))))))))
6767
6868
  (and (d:consistent-graph? graph vocabulary)
69-
       (compatible-types? (recognize graph vocabulary))))
69+
       (compatible-types? (augment (recognize graph vocabulary)))))
7070
7171
;; G entails E if E has an instance (where blank nodes are replaced by literals
7272
;; or IRIs) that is a subgraph of G.

191191
192192
(define (entails? g e vocabulary)
193193
  "Return true if g entails e"
194-
  (let ((g (recognize g vocabulary)))
194+
  (let* ((g (recognize g vocabulary))
195+
         (g (augment g)))
195196
    (or (not (consistent-graph? g vocabulary))
196-
        (d:entails? (augment g) e vocabulary))))
197+
        (d:entails? g e vocabulary))))

rdf/entailment/rdfs.scm

4242
           (valid-subclasses? graph)))
4343
      ((_ graph ...)
4444
       (valid-subclasses? graph))))
45-
  (and (valid-subclasses? (recognize graph vocabulary))
45+
  (and (valid-subclasses? (augment (recognize graph vocabulary)
46+
                                   (rdf-vocabulary-datatypes vocabulary)))
4647
       (rdf:consistent-graph? graph vocabulary)))
4748
4849
;; G entails E if E has an instance (where blank nodes are replaced by literals

313314
314315
(define (entails? g e vocabulary)
315316
  "Return true if g entails e recognizing d"
316-
  (let* ((g (recognize g vocabulary)))
317+
  (let* ((g (recognize g vocabulary))
318+
         (g (augment g (rdf-vocabulary-datatypes vocabulary))))
317319
    (or (not (consistent-graph? g vocabulary))
318-
        (d:entails? (augment g (rdf-vocabulary-datatypes vocabulary))
319-
                    e vocabulary))))
320+
        (d:entails? g e vocabulary))))