Recognize both graphs before entailment

Julien LepillerSun Apr 05 14:01:58+0200 2020

46c112c

Recognize both graphs before entailment

rdf/entailment/d.scm

165165
166166
(define (entails? g e vocabulary)
167167
  "Return true if g entails e"
168-
  (let ((g (recognize g vocabulary)))
168+
  (let ((g (recognize g vocabulary))
169+
        (e (recognize e vocabulary)))
169170
    (or (not (consistent-graph? g vocabulary))
170171
        (let* ((constraints (fold (lambda (t constraints)
171172
                                    (list 'and (generate-constraints t g)

rdf/entailment/rdf.scm

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

rdf/entailment/rdfs.scm

315315
(define (entails? g e vocabulary)
316316
  "Return true if g entails e recognizing d"
317317
  (let* ((g (recognize g vocabulary))
318-
         (g (augment g (rdf-vocabulary-datatypes vocabulary))))
318+
         (g (augment g (rdf-vocabulary-datatypes vocabulary)))
319+
         (e (recognize e vocabulary)))
319320
    (or (not (consistent-graph? g vocabulary))
320321
        (d:entails? g e vocabulary))))