Skip to content

Releases: ruby-rdf/rdf

Release 2.2.8

17 Aug 16:00

Choose a tag to compare

Update CLI processor:

  • Add :control field to CLI::Options for HTML layout
  • Allow CLI::Options#call to provide options along with arg based on arity of receiver (this allows options to add other options).
  • Extract most built-in options to structure.
  • CLI.options does not use callback any longer. It takes an argv parameter and figures out commands from there.
  • CLI.commands now accept a format named parameter; if used with :json, it returns a JSON structure
  • CLI::Options now implements #to_hash.
  • Add args accessor to OptionParser to retain arguments after options have been extracted.
  • Note potential addition of :messages component to options passed to command lambda.
  • Note that status updates should be logged (info) rather than output to $stdout.
  • Add required parameter/option to Option to indicate that the option must be specified.
  • Overload RDF::CLI.options to also return a JSON representation of options in addition to normal processing.
  • Make class_name option required for Vocabulary CLI options.
  • In CLI.parse if using evaluated input, take sample to use if no format is specified.
  • Make sure CLI logger is set in options, using that from option_parser if not provided explicitly.
  • In CLI runner, if messages are set, display them. This is in preference to text formatting in the command.
  • Change CLI::Option#required to CLI::Option#use with states :disabled, :removed, :required, and :optional.
  • Allow commands to override option use using option_use.

Release 2.2.7

17 Aug 15:59

Choose a tag to compare

Fix broken RDF::Node.uuid. Note that the :grammar option is deprecated and provide some documentation for the :format option. Requires that either uuid or uuidtools gems be loaded.

Release 2.2.6

17 Aug 15:58

Choose a tag to compare

  • In Reader.open, only use format to find a concrete reader, not other options. This allows the content-type and actual file content to be used to select a reader, in preference to filename and extensions.

Release 2.2.5

17 Aug 15:57

Choose a tag to compare

  • Require 'openssl', as OpenSSL is used as a constant.
  • Ensure that finding the path from a filename always results in a string (e.g., when file_name is a pathless URI).

Release 2.2.4

15 Mar 23:10

Choose a tag to compare

  • In Reader.open, attempt to locate a concrete reader before opening, and pass specific accept types for that reader. Otherwise, fallback to passing accept types for all readers.
  • "TRUE", "tRuE", etc are not valid boolean values, but may be used to create boolean values. This is different than SPARQL. From RDF 1.1 Concepts: Lexical space: {“true”, “false”, “1”, “0”}
    From Turtle:

    true and false are case insensitive in SPARQL and case sensitive in Turtle. TrUe is not a valid boolean value in Turtle.

  • Fix problem reporting on need for linkeddata gem.
  • Tighten up double regexp.
    • Allows .1
    • Disallows +INF, and InF.
    • Disallows NAN
  • Protect against mutating a frozen URI in Util::File.
  • Do not use Array() to uses to_ary which has been deprecated (#351) (@abrisse)

Release 2.2.2

15 Mar 23:06

Choose a tag to compare

  • Update Reader.each and Writer.each to depend on Format, not instantiated subclasses, as these may have not been loaded when called.
  • Add links to RDF::Repository documentation
  • Fixup Transaction documentation
    • There were some quote mismatches in Transaction documentation. These are fixed, and some YARD-style links are added.
  • Make DEPRECATION messages more prescriptive in how to avoid warnings.

Release 2.2.0

08 Jan 01:19

Choose a tag to compare

  • Add support for Ruby 2.4
  • Change most remaining interfaces to use keyword options. (Change most of the remaining options = {} to **options.)
  • Change implementation of #to_hash to #to_h and deprecate #to_hash. This is required because #to_hash is an implicit accessor, which causes problems for methods using keyword options.
  • Deprecate Enumerator#to_ary and Statement#to_ary
  • Add Literal#to_str for string-like datatypes

As methods taking keyword options implicitly try to turn the last argument into a hash (using #to_hash), this problem can be avoided by ensuring that the last argument is always a hash (empty if necessary). This mostly affects URI#initialize, and Query#initialize.

Array() uses implicit #to_ary. As this pattern is fairly pervasive, DEPRECATION warnings are not issued. In a future release both #to_ary and #to_hash will be removed entirely, which will make interfaces more consistent. The plan is for this to be done in a future 3.0 release.

Pre-release 2.2.0-rc1

31 Dec 20:17

Choose a tag to compare

Pre-release 2.2.0-rc1 Pre-release
Pre-release
  • Add support for Ruby 2.4
  • Change most remaining interfaces to use keyword options. (Change most of the remaining options = {} to **options.)
  • Change implementation of #to_hash to #to_h and deprecate #to_hash. This is required because #to_hash is an implicit accessor, which causes problems for methods using keyword options.
  • Deprecate Enumerator#to_ary and Statement#to_ary
  • Add Literal#to_str for string-like datatypes

As methods taking keyword options implicitly try to turn the last argument into a hash (using #to_hash), this problem can be avoided by ensuring that the last argument is always a hash (empty if necessary). This mostly affects URI#initialize, and Query#initialize.

Array() uses implicit #to_ary. As this pattern is fairly pervasive, DEPRECATION warnings are not issued. In a future release both #to_ary and #to_hash will be removed entirely, which will make interfaces more consistent. The plan is for this to be done in a future 3.0 release.

Release 2.1.1

11 Dec 18:12

Choose a tag to compare

Repository/Dataset improvements

  • Implement Transaction#mutated?
    • #mutated? must return true when the transaction would change the repository if executed against it's state at transaction start time. We allow implementations to return true in other cases, as well; there is no guarantee that a false result will be returned in any specific circumstances (or ever).
    • For the base transaction, we simply check whether @changes is empty. This can give false positives, but avoids a worst-case linear check.
    • For subclasses with no custom implementation, we raise a NotImplementedError.
    • For the SerializableTransaction included in the default RepositoryImplementation, we use #equal? on the Hamster::Hash instances. This will always give a correct response for the actual implementation, moreover, it is guaranteed not to give false negatives even if a user messes with the snapshot using #send.
  • Make Dataset concrete
    • RDF::Dataset previously served as little more than an abstract class. Instantiating one was possible, but didn't provide any useful functionality. This implements a basic RDF::Dataset as an Enumerable/Queryable over a static dataset specified at initialization.
    • Clarifies handling of the default graph, adopting the ususal definition of an RDF/SPARQL dataset for RDF::Dataset and its subclasses (e.g. RDF::Repository). Normal Enumerable/Queryable objects continue to not behave like RDF datasets. The accompanying changes to rdf-spec reflect this while running the shared examples over such a generic Queryable.
  • Avoid expensive hash comparison on Hamster::Hash
    • In practice, these objects are either #equal? or won't be #==. This avoids potentially expensive #to_hash calls and comparisons.
  • Inherit the correct isolation level with #snapshot. Fix a typo in RDF::Repository#isolation_level to inherit the correct level when snapshot is implemented. This affects Repositories implementing snapshots, but not overriding the default #isolation_level.
  • Fix RDF::Repository::Implementation#supports?(:literal_equality).
    • Adds :literal_equality flag to the default repository implementation.

Vocabulary related changes

  • Implement RDF.enum_for and RDF.to_enum. Fixes #314.
  • Add .ontology to vocabulary, and use for defining ontologies. This allows ontology statements that are not the same as the namespace (e.g., missing trailing '/' or '#'). Fixes #315.
  • When parsing "extra" arguments for vocabulary writer, make sure all keys are symbolized.
  • Allow Vocabulary#from_graph to take an existing vocabulary for class_name to re-define it.

Other improvements

  • Define RDF::Statement#hash to support comparison operations in e.g. Array#-
  • Dispatch Enumerator#to_ary with alias There's no need to use #method_missing to dispatch this. Preferring alias_method over alias, contrary to Ruby Style Guide. We want dynamic dispatch of the aliased method.
  • Added Literal#squish and #squish! to remove leading/trailing whitespace and multiple internal whitespace characters from the value of a literal.
  • Support :inferred option to Statement#initialize and use when responding to #inferred?. This allows a reasoner to mark inferred/entailed statements.
  • Add Format.accept_types and Format.accept_type. This allows Format.content_type to be provided with priority parameters for the type, and aliases. These are stripped out to allow Format.reader_types and so-forth, to continue to return values without parameters. Fixes #327.
  • Require rest-client ~> 2.0. Update redirection logic based on changed interface in rest-client 2.0.0. Fixes #331.
  • Move #start_with from URI to Value and add specs.

Misclaneous bug fixes

  • Fix typo in IRI grammar
    • Typo A-z allows matches for a wide range of invalid schemes, including common blank node id formats like "_:123".
  • CLI does not set @readers when evaluating from the command line, causing exception.
  • Reset memoized hash values when canonicalizing RDF::URI and RDF::Statement.
  • Add more hacks to set quality level in Accept content header. This is related to structured-data/linter#38 and #327.
  • Do not consider case when validating double values.
  • Remove code climate, as it's changed it's requirements and isn't particularly useful anyway.
  • Fix a bug where RDF::Literal::Integer.new("0123") was interpreted as an Octal value.

Release 2.1.0

14 Aug 18:46

Choose a tag to compare

This release updates the minor number due to a change in the minimum Ruby version to 2.2.2. This is required because of updates to dependent gems.

Other changes include:

  • Fix bug when loading vocabularies that didn't remove previous term definitions from term cache.
  • Fix vocabulary term attributes to only contain symbol keys.