Fix expansion for nested keys with local context.
jsonld.scm
53 | 53 | ;; 4 | |
54 | 54 | (when (json-has-key? context "@context") | |
55 | 55 | (set! context (assoc-ref context "@context"))) | |
56 | - | (pk expanded-input) | |
57 | - | (pk context) | |
58 | 56 | (let* ((base-iri (or (jsonld-options-base options) | |
59 | 57 | (and (jsonld-options-compact-to-relative? options) | |
60 | 58 | (string? input) | |
… | |||
72 | 70 | #:ordered? (jsonld-options-ordered? options) | |
73 | 71 | #:processing-mode | |
74 | 72 | (jsonld-options-processing-mode options)))) | |
75 | - | (pk 'compacted-output compacted-output) | |
76 | 73 | (if (equal? compacted-output #()) | |
77 | 74 | (set! compacted-output '()) | |
78 | 75 | (when (json-array? compacted-output) | |
… | |||
195 | 192 | (expand-with-base input #:options options)) | |
196 | 193 | ;; 2 and 3 | |
197 | 194 | (lambda (expanded-input context-base) | |
198 | - | (pk 'expanded expanded-input) | |
199 | 195 | (let* ((generate-blank-node (get-generate-blank-node-identifier)) | |
200 | 196 | (generate-node-map (get-node-map-generation generate-blank-node)) | |
201 | 197 | (node-map (generate-node-map expanded-input '())) | |
202 | 198 | (node-map (assoc-ref node-map "node-map"))) | |
203 | - | (pk node-map) | |
204 | 199 | (deserialize-jsonld | |
205 | 200 | generate-blank-node node-map (make-rdf-dataset '() '()) | |
206 | 201 | #:produce-generalized-rdf? |
jsonld/expansion.scm
681 | 681 | (not (json-key-expanded-to? active-context nested-value "@value"))) | |
682 | 682 | (throw 'invalid-@nest-value)) | |
683 | 683 | ;; 14.2.2 | |
684 | - | (let ((exec-result | |
685 | - | (execute-13 active-context active-property | |
686 | - | nested-value property-scoped-context | |
687 | - | type-scoped-context result '() | |
688 | - | input-type base-url options))) | |
684 | + | (let* ((active-property nesting-key) | |
685 | + | (active-property-term-definition | |
686 | + | (term-definition-ref active-context active-property)) | |
687 | + | (property-scoped-context | |
688 | + | (if (and (term-definition? active-property-term-definition) | |
689 | + | (not (equal? (term-definition-context active-property-term-definition) #f))) | |
690 | + | (term-definition-context active-property-term-definition) | |
691 | + | property-scoped-context)) | |
692 | + | (active-context | |
693 | + | (if property-scoped-context | |
694 | + | (context-processing active-context property-scoped-context | |
695 | + | base-url | |
696 | + | #:override-protected? #t | |
697 | + | #:options options) | |
698 | + | active-context)) | |
699 | + | (exec-result | |
700 | + | (execute-13 active-context active-property | |
701 | + | nested-value property-scoped-context | |
702 | + | type-scoped-context result '() | |
703 | + | input-type base-url options))) | |
689 | 704 | (set! result (assoc-ref exec-result "result")) | |
690 | 705 | (set! nests (assoc-ref exec-result "nests")) | |
691 | 706 | (let ((exec-result |