augment before checking consistency
rdf/entailment/rdf.scm
| 66 | 66 | '()))))))))) | |
| 67 | 67 | ||
| 68 | 68 | (and (d:consistent-graph? graph vocabulary) | |
| 69 | - | (compatible-types? (recognize graph vocabulary)))) | |
| 69 | + | (compatible-types? (augment (recognize graph vocabulary))))) | |
| 70 | 70 | ||
| 71 | 71 | ;; G entails E if E has an instance (where blank nodes are replaced by literals | |
| 72 | 72 | ;; or IRIs) that is a subgraph of G. | |
… | |||
| 191 | 191 | ||
| 192 | 192 | (define (entails? g e vocabulary) | |
| 193 | 193 | "Return true if g entails e" | |
| 194 | - | (let ((g (recognize g vocabulary))) | |
| 194 | + | (let* ((g (recognize g vocabulary)) | |
| 195 | + | (g (augment g))) | |
| 195 | 196 | (or (not (consistent-graph? g vocabulary)) | |
| 196 | - | (d:entails? (augment g) e vocabulary)))) | |
| 197 | + | (d:entails? g e vocabulary)))) | |
rdf/entailment/rdfs.scm
| 42 | 42 | (valid-subclasses? graph))) | |
| 43 | 43 | ((_ graph ...) | |
| 44 | 44 | (valid-subclasses? graph)))) | |
| 45 | - | (and (valid-subclasses? (recognize graph vocabulary)) | |
| 45 | + | (and (valid-subclasses? (augment (recognize graph vocabulary) | |
| 46 | + | (rdf-vocabulary-datatypes vocabulary))) | |
| 46 | 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 | |
… | |||
| 313 | 314 | ||
| 314 | 315 | (define (entails? g e vocabulary) | |
| 315 | 316 | "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)))) | |
| 317 | 319 | (or (not (consistent-graph? g vocabulary)) | |
| 318 | - | (d:entails? (augment g (rdf-vocabulary-datatypes vocabulary)) | |
| 319 | - | e vocabulary)))) | |
| 320 | + | (d:entails? g e vocabulary)))) | |