Skip to content

Commit

Permalink
Added documentation to clarify that term canonicalization is not the …
Browse files Browse the repository at this point in the history
…same as Graph/Dataset canonicalization, which is impleented in the rdf-normalize gem.
  • Loading branch information
gkellogg committed Aug 19, 2023
1 parent 018969c commit f868294
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/rdf/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module RDF
# RDF::CLI::Option.new(
# symbol: :canonicalize,
# on: ["--canonicalize"],
# description: "Canonicalize input/output.") {true},
# description: "Canonicalize URI/literal forms.") {true},
# RDF::CLI::Option.new(
# symbol: :uri,
# on: ["--uri STRING"],
Expand Down
2 changes: 1 addition & 1 deletion lib/rdf/model/statement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def terms
end

##
# Canonicalizes each unfrozen term in the statement
# Canonicalizes each unfrozen term in the statement.
#
# @return [RDF::Statement] `self`
# @since 1.0.8
Expand Down
8 changes: 5 additions & 3 deletions lib/rdf/reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def self.options
on: ["--canonicalize"],
control: :checkbox,
default: false,
description: "Canonicalize input/output.") {true},
description: "Canonicalize URI/literal forms") {true},
RDF::CLI::Option.new(
symbol: :encoding,
datatype: Encoding,
Expand Down Expand Up @@ -271,7 +271,7 @@ def to_sym
# the base URI to use when resolving relative URIs (not supported by
# all readers)
# @param [Boolean] canonicalize (false)
# whether to canonicalize parsed literals
# whether to canonicalize parsed URIs and Literals.
# @param [Encoding] encoding (Encoding::UTF_8)
# the encoding of the input stream
# @param [Boolean] intern (true)
Expand Down Expand Up @@ -608,7 +608,9 @@ def validate?
end

##
# Returns `true` if parsed values should be canonicalized.
# Returns `true` if parsed values should be in canonical form.
#
# @note This is for term canonicalization, for graph/dataset canonicalization use `RDF::Normalize`.
#
# @return [Boolean] `true` or `false`
# @since 0.3.0
Expand Down
4 changes: 3 additions & 1 deletion lib/rdf/writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ def validate?
end

##
# Returns `true` if terms should be canonicalized.
# Returns `true` if terms should be in canonical form.
#
# @note This is for term canonicalization, for graph/dataset canonicalization use `RDF::Normalize`.
#
# @return [Boolean] `true` or `false`
# @since 1.0.8
Expand Down

0 comments on commit f868294

Please sign in to comment.