diff --git a/examples/duplicate-paths.yml b/examples/duplicate-paths.yml index ab61b10..f522a3c 100644 --- a/examples/duplicate-paths.yml +++ b/examples/duplicate-paths.yml @@ -66,7 +66,7 @@ ca: log point: Hash N-Degree Quads function (4.9.3 (3)). with: - quad: _:e0 _:e1 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: o @@ -115,7 +115,7 @@ ca: log point: Hash N-Degree Quads function (4.9.3 (3)). with: - quad: _:e0 _:e1 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: s @@ -123,7 +123,7 @@ ca: input: "s_:b0" hash: 924a034861aa3fbdaf67a939abc4a2f4e233351bccb26718cb8c151b1746f677 - quad: _:e1 "Foo" . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: Hash to bnodes: @@ -181,7 +181,7 @@ ca: log point: Hash N-Degree Quads function (4.9.3 (3)). with: - quad: _:e2 _:e3 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: o @@ -230,7 +230,7 @@ ca: log point: Hash N-Degree Quads function (4.9.3 (3)). with: - quad: _:e2 _:e3 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: s @@ -238,7 +238,7 @@ ca: input: "s_:b0" hash: 924a034861aa3fbdaf67a939abc4a2f4e233351bccb26718cb8c151b1746f677 - quad: _:e3 "Foo" . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: Hash to bnodes: @@ -282,17 +282,17 @@ ca: log point: Leaving Hash N-Degree Quads function (4.9.3). hash: 39d609fcd8236b74c70744f492cd2baaf0a55765b380ff9e0811ce23e2f409d7 issuer: {e2: b0, e3: b1} - ca5.3: + ca.5.3: - result: 39d609fcd8236b74c70744f492cd2baaf0a55765b380ff9e0811ce23e2f409d7 issuer: {e0: b0, e1: b1} - ca5.3.1: + ca.5.3.1: - existing identifier: e0 cid: c14n0 - existing identifier: e1 cid: c14n1 - result: 39d609fcd8236b74c70744f492cd2baaf0a55765b380ff9e0811ce23e2f409d7 issuer: {e2: b0, e3: b1} - ca5.3.1: + ca.5.3.1: - existing identifier: e2 cid: c14n2 - existing identifier: e3 diff --git a/examples/shared-hashes.yml b/examples/shared-hashes.yml index 4fac6c1..c4fd883 100644 --- a/examples/shared-hashes.yml +++ b/examples/shared-hashes.yml @@ -64,119 +64,123 @@ ca: log point: Calculate hashes for identifiers with shared hashes (4.5.3 (5)). with: - identifier: e0 - log point: Hash N-Degree Quads function (4.9.3). - issuer: {e0: b0} - hndq.2: - log point: Quads for identifier (4.9.3 (2)). - quads: + hndq: + log point: Hash N-Degree Quads function (4.9.3). + identifier: e0 + issuer: {e0: b0} + hndq.2: + log point: Quads for identifier (4.9.3 (2)). + quads: - _:e0 . - _:e0 _:e2 . - hndq.3: - log point: Hash N-Degree Quads function (4.9.3 (3)). - with: - - quad: _:e0 . - hndq3.1: - log point: Hash related bnode component (4.9.3 (3.1)) - with: - - quad: _:e0 _:e2 . - hndq3.1: - log point: Hash related bnode component (4.9.3 (3.1)) - with: - - position: o - related: e2 - input: "o_:c14n0" - hash: 29cf7e22790bc2ed395b81b3933e5329fc7b25390486085cac31ce7252ca60fa - Hash to bnodes: - 29cf7e22790bc2ed395b81b3933e5329fc7b25390486085cac31ce7252ca60fa: - - e2: - hndq.5: - log point: Hash N-Degree Quads function (4.9.3 (5)), entering loop. - with: - - related hash: 29cf7e22790bc2ed395b81b3933e5329fc7b25390486085cac31ce7252ca60fa - data to hash: "" - hndq.5.4: - log point: Hash N-Degree Quads function (4.9.3 (5.4)), entering loop. - with: - - perm: [ "e2"] - hndq.5.4.4: - log point: Hash N-Degree Quads function (4.9.3 (5.4.4)), entering loop. - with: - - related: e2 - path: "" - hndq.5.4.5: - log point: Hash N-Degree Quads function (4.9.3 (5.4.5)), before possible recursion. - recursion list: [] - path: "_:c14n0" - hndq.5.5: - log point: Hash N-Degree Quads function (4.9.3 (5.5). End of current loop with Hn hashes. - chosen path: "_:c14n0" - data to hash: "29cf7e22790bc2ed395b81b3933e5329fc7b25390486085cac31ce7252ca60fa_:c14n0" - hndq.6: - log point: Leaving Hash N-Degree Quads function (4.9.3). - hash: fbc300de5afafd97a4b9ee1e72b57754dcdcb7ebb724789ac6a94a5b82a48d30 - issuer: {e0: b0} + hndq.3: + log point: Hash N-Degree Quads function (4.9.3 (3)). + with: + - quad: _:e0 . + hndq.3.1: + log point: Hash related bnode component (4.9.3 (3.1)) + with: + - quad: _:e0 _:e2 . + hndq.3.1: + log point: Hash related bnode component (4.9.3 (3.1)) + with: + - position: o + related: e2 + input: "o_:c14n0" + hash: 29cf7e22790bc2ed395b81b3933e5329fc7b25390486085cac31ce7252ca60fa + Hash to bnodes: + 29cf7e22790bc2ed395b81b3933e5329fc7b25390486085cac31ce7252ca60fa: + - e2: + hndq.5: + log point: Hash N-Degree Quads function (4.9.3 (5)), entering loop. + with: + - related hash: 29cf7e22790bc2ed395b81b3933e5329fc7b25390486085cac31ce7252ca60fa + data to hash: "" + hndq.5.4: + log point: Hash N-Degree Quads function (4.9.3 (5.4)), entering loop. + with: + - perm: [ "e2"] + hndq.5.4.4: + log point: Hash N-Degree Quads function (4.9.3 (5.4.4)), entering loop. + with: + - related: e2 + path: "" + hndq.5.4.5: + log point: Hash N-Degree Quads function (4.9.3 (5.4.5)), before possible recursion. + recursion list: [] + path: "_:c14n0" + hndq.5.5: + log point: Hash N-Degree Quads function (4.9.3 (5.5). End of current loop with Hn hashes. + chosen path: "_:c14n0" + data to hash: "29cf7e22790bc2ed395b81b3933e5329fc7b25390486085cac31ce7252ca60fa_:c14n0" + hndq.6: + log point: Leaving Hash N-Degree Quads function (4.9.3). + hash: fbc300de5afafd97a4b9ee1e72b57754dcdcb7ebb724789ac6a94a5b82a48d30 + issuer: {e0: b0} with: - identifier: e1 - log point: Hash N-Degree Quads function (4.9.3). - issuer: {e1: b0} - hndq.2: - log point: Quads for identifier (4.9.3 (2)). - quads: + hndq: + log point: Hash N-Degree Quads function (4.9.3). + identifier: e1 + issuer: {e1: b0} + hndq.2: + log point: Quads for identifier (4.9.3 (2)). + quads: - _:e1 . - _:e1 _:e3 . - hndq.3: - log point: Hash N-Degree Quads function (4.9.3 (3)). - with: - - quad: _:e1 . - hndq3.1: - log point: Hash related bnode component (4.9.3 (3.1)) - with: - - quad: _:e1 _:e3 . - hndq3.1: - log point: Hash related bnode component (4.9.3 (3.1)) - with: - - position: o - related: e3 - input: "o_:c14n1" - hash: b7956ea1d654d5824496eb439a1f2b79478bd7d02d4a115f4c97cbff6b098216 - Hash to bnodes: - b7956ea1d654d5824496eb439a1f2b79478bd7d02d4a115f4c97cbff6b098216: - - e3: - hndq.5: - log point: Hash N-Degree Quads function (4.9.3 (5)), entering loop. - with: - - related hash: b7956ea1d654d5824496eb439a1f2b79478bd7d02d4a115f4c97cbff6b098216 - data to hash: "" - hndq.5.4: - log point: Hash N-Degree Quads function (4.9.3 (5.4)), entering loop. - with: - - perm: [ "e3"] - hndq.5.4.4: - log point: Hash N-Degree Quads function (4.9.3 (5.4.4)), entering loop. - with: - - related: e3 - path: "" - hndq.5.4.5: - log point: Hash N-Degree Quads function (4.9.3 (5.4.5)), before possible recursion. - recursion list: [] - path: "_:c14n1" - hndq.5.5: - log point: Hash N-Degree Quads function (4.9.3 (5.5). End of current loop with Hn hashes. - chosen path: "_:c14n1" - data to hash: "b7956ea1d654d5824496eb439a1f2b79478bd7d02d4a115f4c97cbff6b098216_:c14n1" - hndq.6: - log point: Leaving Hash N-Degree Quads function (4.9.3). - hash: 2c0b377baf86f6c18fed4b0df6741290066e73c932861749b172d1e5560f5045 - issuer: {e1: b0} - ca5.3: + hndq.3: + log point: Hash N-Degree Quads function (4.9.3 (3)). + with: + - quad: _:e1 . + hndq.3.1: + log point: Hash related bnode component (4.9.3 (3.1)) + with: + - quad: _:e1 _:e3 . + hndq.3.1: + log point: Hash related bnode component (4.9.3 (3.1)) + with: + - position: o + related: e3 + input: "o_:c14n1" + hash: b7956ea1d654d5824496eb439a1f2b79478bd7d02d4a115f4c97cbff6b098216 + Hash to bnodes: + b7956ea1d654d5824496eb439a1f2b79478bd7d02d4a115f4c97cbff6b098216: + - e3: + hndq.5: + log point: Hash N-Degree Quads function (4.9.3 (5)), entering loop. + with: + - related hash: b7956ea1d654d5824496eb439a1f2b79478bd7d02d4a115f4c97cbff6b098216 + data to hash: "" + hndq.5.4: + log point: Hash N-Degree Quads function (4.9.3 (5.4)), entering loop. + with: + - perm: [ "e3"] + hndq.5.4.4: + log point: Hash N-Degree Quads function (4.9.3 (5.4.4)), entering loop. + with: + - related: e3 + path: "" + hndq.5.4.5: + log point: Hash N-Degree Quads function (4.9.3 (5.4.5)), before possible recursion. + recursion list: [] + path: "_:c14n1" + hndq.5.5: + log point: Hash N-Degree Quads function (4.9.3 (5.5). End of current loop with Hn hashes. + chosen path: "_:c14n1" + data to hash: "b7956ea1d654d5824496eb439a1f2b79478bd7d02d4a115f4c97cbff6b098216_:c14n1" + hndq.6: + log point: Leaving Hash N-Degree Quads function (4.9.3). + hash: 2c0b377baf86f6c18fed4b0df6741290066e73c932861749b172d1e5560f5045 + issuer: {e1: b0} + ca.5.3: - result: 2c0b377baf86f6c18fed4b0df6741290066e73c932861749b172d1e5560f5045 issuer: {e1: b0} - ca5.3.1: + ca.5.3.1: - existing identifier: e1 cid: c14n2 - result: fbc300de5afafd97a4b9ee1e72b57754dcdcb7ebb724789ac6a94a5b82a48d30 issuer: {e0: b0} - ca5.3.1: + ca.5.3.1: - existing identifier: e0 cid: c14n3 ca.6: diff --git a/examples/test022.yml b/examples/test022.yml index eb76c20..e936617 100644 --- a/examples/test022.yml +++ b/examples/test022.yml @@ -61,7 +61,7 @@ run manifest-urdna2015#test022ca: log point: Hash N-Degree Quads function (4.9.3 (3)). with: - quad: _:e0 _:e1 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: o @@ -77,7 +77,7 @@ run manifest-urdna2015#test022ca: input: "o60dc8fc7b5481014b6ea38efb05455676d1e93e19b99119ab294941dacc16b3b" hash: 20bb08971220a5382a9a06ba2977c5fb859e63192e0b2015a378af89e453f25e - quad: _:e0 _:e1 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: o @@ -93,7 +93,7 @@ run manifest-urdna2015#test022ca: input: "o60dc8fc7b5481014b6ea38efb05455676d1e93e19b99119ab294941dacc16b3b" hash: 1e4e55ba02b8b0b527c32e2343fbcfee2e2bd9c1972c67cc01f85fabde7bc42d - quad: _:e1 _:e0 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: s @@ -109,7 +109,7 @@ run manifest-urdna2015#test022ca: input: "s60dc8fc7b5481014b6ea38efb05455676d1e93e19b99119ab294941dacc16b3b" hash: 56d0774755aaf8d9cf4da8af3728e5589f94e5cd7d9aee86f0c5a7bc1d71c7ca - quad: _:e1 _:e0 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: s @@ -168,7 +168,7 @@ run manifest-urdna2015#test022ca: log point: Hash N-Degree Quads function (4.9.3 (3)). with: - quad: _:e0 _:e1 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: s @@ -176,7 +176,7 @@ run manifest-urdna2015#test022ca: input: "s_:b0" hash: fedd7e23f27219a0bfe4c5dd88920ff3c0bb0b2df2d15b956e5a4754cbcc8587 - quad: _:e0 _:e1 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: s @@ -184,7 +184,7 @@ run manifest-urdna2015#test022ca: input: "s_:b0" hash: 2271d4a38ab18871a59367113128e490261466f10fec31d3e9654531f7c08fef - quad: _:e1 _:e0 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: o @@ -192,7 +192,7 @@ run manifest-urdna2015#test022ca: input: "o_:b0" hash: 9e8ddf2abce731d9bb3b56caa83f1d2c4d76f7c649b8c286b1b372830d5d706f - quad: _:e1 _:e0 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: o @@ -377,7 +377,7 @@ run manifest-urdna2015#test022ca: log point: Hash N-Degree Quads function (4.9.3 (3)). with: - quad: _:e0 _:e1 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: s @@ -393,7 +393,7 @@ run manifest-urdna2015#test022ca: input: "s60dc8fc7b5481014b6ea38efb05455676d1e93e19b99119ab294941dacc16b3b" hash: 56d0774755aaf8d9cf4da8af3728e5589f94e5cd7d9aee86f0c5a7bc1d71c7ca - quad: _:e0 _:e1 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: s @@ -409,7 +409,7 @@ run manifest-urdna2015#test022ca: input: "s60dc8fc7b5481014b6ea38efb05455676d1e93e19b99119ab294941dacc16b3b" hash: 2a5dd448b9467a08479008a5350829441868b7f913343cd500fe8619e047cff4 - quad: _:e1 _:e0 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: o @@ -425,7 +425,7 @@ run manifest-urdna2015#test022ca: input: "o60dc8fc7b5481014b6ea38efb05455676d1e93e19b99119ab294941dacc16b3b" hash: 20bb08971220a5382a9a06ba2977c5fb859e63192e0b2015a378af89e453f25e - quad: _:e1 _:e0 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: o @@ -484,7 +484,7 @@ run manifest-urdna2015#test022ca: log point: Hash N-Degree Quads function (4.9.3 (3)). with: - quad: _:e0 _:e1 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: o @@ -492,7 +492,7 @@ run manifest-urdna2015#test022ca: input: "o_:b0" hash: 9e8ddf2abce731d9bb3b56caa83f1d2c4d76f7c649b8c286b1b372830d5d706f - quad: _:e0 _:e1 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: o @@ -500,7 +500,7 @@ run manifest-urdna2015#test022ca: input: "o_:b0" hash: ee5c2a18a94cc31daa5c15313e5c824083ff5a9215ab296634dd849b787a8177 - quad: _:e1 _:e0 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: s @@ -508,7 +508,7 @@ run manifest-urdna2015#test022ca: input: "s_:b0" hash: fedd7e23f27219a0bfe4c5dd88920ff3c0bb0b2df2d15b956e5a4754cbcc8587 - quad: _:e1 _:e0 . - hndq3.1: + hndq.3.1: log point: Hash related bnode component (4.9.3 (3.1)) with: - position: s @@ -676,17 +676,17 @@ run manifest-urdna2015#test022ca: log point: Leaving Hash N-Degree Quads function (4.9.3). hash: e332b4b59e1c4794ee72a4df0f63723326ffb6d6a5c0d0cb4d2dd8d8d5ebf5a4 issuer: {e1: b0, e0: b1} - ca5.3: + ca.5.3: - result: e332b4b59e1c4794ee72a4df0f63723326ffb6d6a5c0d0cb4d2dd8d8d5ebf5a4 issuer: {e0: b0, e1: b1} - ca5.3.1: + ca.5.3.1: - existing identifier: e0 cid: c14n0 - existing identifier: e1 cid: c14n1 - result: e332b4b59e1c4794ee72a4df0f63723326ffb6d6a5c0d0cb4d2dd8d8d5ebf5a4 issuer: {e1: b0, e0: b1} - ca5.3.1: + ca.5.3.1: - existing identifier: e1 cid: c14n1 - existing identifier: e0 diff --git a/lib/rdf/normalize/urdna2015.rb b/lib/rdf/normalize/urdna2015.rb index 484cdd0..26046ef 100644 --- a/lib/rdf/normalize/urdna2015.rb +++ b/lib/rdf/normalize/urdna2015.rb @@ -99,11 +99,11 @@ def normalize_statements(ns, &block) end # Create canonical replacements for nodes - log_debug(" ca5.3:") unless hash_path_list.empty? + log_debug(" ca.5.3:") unless hash_path_list.empty? hash_path_list.sort_by(&:first).each do |result, issuer| log_debug(" - result") {result} log_depth(depth: 4) {log_debug("issuer") {issuer.inspect}} - log_debug(" ca5.3.1:") + log_debug(" ca.5.3.1:") issuer.issued.each do |node| id = ns.canonical_issuer.issue_identifier(node) log_debug(" - existing identifier") {node.id} @@ -230,7 +230,7 @@ def hash_n_degree_quads(identifier, issuer) log_debug(" with:") unless bnode_to_statements[identifier].empty? bnode_to_statements[identifier].each do |statement| log_debug {" - quad: #{statement.to_nquads.strip}"} - log_debug(" hndq3.1:") + log_debug(" hndq.3.1:") log_debug(" log point", "Hash related bnode component (4.9.3 (3.1))") log_depth(depth: 10) {hash_related_statement(identifier, statement, issuer, hn)} end