Skip to content

Releases: ruby-rdf/rdf

Release 2.2.6

17 Aug 15:58
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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.

Release 2.0.2

08 Jul 17:45
Compare
Choose a tag to compare
  • Adding this documentation might help clarify pattern matching within RDF::Query::Pattern, too.

  • do not fail with Encoding::CompatibilityError when normalizing unicode IRIs.

  • Fix RDF::List#== comparisons to RDF::Values

    Ruby 2.3.0 changed the behavior of Comparable#== to avoid hiding errors. This led to NoMethodErrors for comparisons that return false for previous Rubies.

    This introduces a custom RDF::List#== implementation for explicitly
    supported comparisons between RDF::Value classes. We return false
    immediately for RDF::Values which are not #list?; falling back on
    Comparable for other types.

    Further, RDF::Lists with three elements that happen to coincide with
    the terms of an RDF::Statement would previously return true. E.g.:
    RDF::List[:s, :p, :o] == RDF::Statement(:s, :p, :o). This unusual edge
    case is patched by way of the changes described above.

  • Adjust List#<=> to avoid error cases

    Using Array(other) instead of other.to_a avoids throwing errors when
    comparing. This minor tweak slightly improves the solution to #304 given
    in #305.

RDF.rb 2.0.1

29 Apr 20:32
Compare
Choose a tag to compare
  • Remove code duplication.
  • Remove deprecated Vocabulary.load
  • Improve grammar for Literal::Double and improve general validation testing of literals.
  • Improve heuristics for generating term statements based on value inspection.
  • CLI improvements.
  • Work around odd Rubinius problem involing variable arguments and super. Fixes #298.