Register named blank nodes

Julien LepillerThu Apr 02 14:18:41+0200 2020

fe8814c

Register named blank nodes

turtle/tordf.scm

8484
    (() "")))
8585
8686
(define (parse-iri iri state)
87-
  (pk 'iri iri)
8887
  (match iri
8988
    (('iri ('prefixed-name ('pname-ln ('pname-ns ns) ('pn-local suffix))))
9089
     `(("iri" . ,(string-append (assoc-ref (parser-state-namespaces state) ns)

222221
    (('blank-node ('blank-node-label label))
223222
     (let* ((node
224223
              (or (assoc-ref (parser-state-bnode-labels state) label)
225-
                  ((parser-state-blank-node-gen state)))))
224+
                  ((parser-state-blank-node-gen state))))
225+
            (state
226+
              (if (assoc-ref (parser-state-bnode-labels state) label)
227+
                  state
228+
                  (update-parser-state state
229+
                    #:bnode-labels
230+
                    (cons
231+
                      (cons label node)
232+
                      (parser-state-bnode-labels state))))))
226233
       (update-parser-state state
227234
         #:cur-object node
228235
         #:result