Skip to content

Commit

Permalink
Update to name algorithm RDFC-1.0 instead of URDNA2015.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Jun 10, 2023
1 parent da4a6ed commit ea96e02
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 132 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ to serialize normalized statements.
Algorithms implemented:

* [URGNA2012](https://www.w3.org/TR/rdf-canon/#dfn-urgna2012)
* [URDNA2015](https://www.w3.org/TR/rdf-canon/#dfn-urdna2015)
* [RDFC-1.0](https://www.w3.org/TR/rdf-canon/#dfn-rdfc-1-0)

Install with `gem install rdf-normalize`

Expand Down Expand Up @@ -45,7 +45,7 @@ Full documentation available on [GitHub][Normalize doc]
* {RDF::Normalize::Format}
* {RDF::Normalize::Writer}
* {RDF::Normalize::URGNA2012}
* {RDF::Normalize::URDNA2015}
* {RDF::Normalize::RDFC10}

## Dependencies

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.1
0.6.0
236 changes: 118 additions & 118 deletions etc/earl.ttl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/test022.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
run manifest-urdna2015#test022ca:
run manifest-rdfc10#test022ca:
log point: Entering the canonicalization function (4.5.3).
ca.2:
log point: Extract quads for each bnode (4.5.3 (2)).
Expand Down
10 changes: 5 additions & 5 deletions lib/rdf/normalize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module Normalize
autoload :Base, 'rdf/normalize/base'
autoload :Carroll2001,'rdf/normalize/carroll2001'
autoload :URGNA2012, 'rdf/normalize/urgna2012'
autoload :URDNA2015, 'rdf/normalize/urdna2015'
autoload :RDFC10, 'rdf/normalize/rdfc10'
autoload :VERSION, 'rdf/normalize/version'
autoload :Writer, 'rdf/normalize/writer'

Expand All @@ -43,19 +43,19 @@ module Normalize
ALGORITHMS = {
carroll2001: :Carroll2001,
urgna2012: :URGNA2012,
urdna2015: :URDNA2015
rdfc10: :RDFC10
}.freeze

##
# Creates a new normalizer instance using either the specified or default normalizer algorithm
# @param [RDF::Enumerable] enumerable
# @param [Hash{Symbol => Object}] options
# @option options [Base] :algorithm (:urdna2015)
# One of `:carroll2001`, `:urgna2012`, or `:urdna2015`
# @option options [Base] :algorithm (:rdfc10)
# One of `:carroll2001`, `:urgna2012`, or `:rdfc10`
# @return [RDF::Normalize::Base]
# @raise [ArgumentError] selected algorithm not defined
def new(enumerable, **options)
algorithm = options.fetch(:algorithm, :urdna2015)
algorithm = options.fetch(:algorithm, :rdfc10)
raise ArgumentError, "No algoritm defined for #{algorithm.to_sym}" unless ALGORITHMS.has_key?(algorithm)
algorithm_class = const_get(ALGORITHMS[algorithm])
algorithm_class.new(enumerable, **options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
end

module RDF::Normalize
class URDNA2015
class RDFC10
include RDF::Enumerable
include RDF::Util::Logger
include Base
Expand Down
4 changes: 2 additions & 2 deletions lib/rdf/normalize/urgna2012.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module RDF::Normalize
class URGNA2012 < URDNA2015
class URGNA2012 < RDFC10

def each(&block)
ns = NormalizationState.new(@options)
normalize_statements(ns, &block)
end

class NormalizationState < URDNA2015::NormalizationState
class NormalizationState < RDFC10::NormalizationState
protected

# 2012 version uses SHA-1
Expand Down
2 changes: 1 addition & 1 deletion script/tc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ end

earl_preamble(options) if options[:earl]

%w(urdna2015).each do |variant|
%w(rdfc10).each do |variant|
manifest = Fixtures::SuiteTest::BASE + "manifest-#{variant}.jsonld"

Fixtures::SuiteTest::Manifest.open(manifest, manifest[0..-8]) do |m|
Expand Down
2 changes: 1 addition & 1 deletion spec/suite_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
describe RDF::Normalize::Writer do
require_relative 'suite_helper'

%w(urdna2015).each do |variant|
%w(rdfc10).each do |variant|
describe "w3c Normalization #{variant.upcase} tests" do
manifest = Fixtures::SuiteTest::BASE + "manifest-#{variant}.jsonld"

Expand Down

0 comments on commit ea96e02

Please sign in to comment.