Releases: ruby-rdf/rdf
Release 2.2.6
- In
Reader.open
, only useformat
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
- 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
- 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
andfalse
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
, andInF
. - Disallows
NAN
- Allows
- 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
- Update
Reader.each
andWriter.each
to depend onFormat
, 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
- 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
andStatement#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
- 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
andStatement#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
Repository/Dataset improvements
- Implement
Transaction#mutated?
#mutated?
must returntrue
when the transaction would change the repository if executed against it's state at transaction start time. We allow implementations to returntrue
in other cases, as well; there is no guarantee that afalse
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 defaultRepositoryImplementation
, we use#equal?
on theHamster::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 anEnumerable
/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
). NormalEnumerable
/Queryable
objects continue to not behave like RDF datasets. The accompanying changes tordf-spec
reflect this while running the shared examples over such a genericQueryable
.
- 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
- 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.
- In practice, these objects are either
- 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.
- Adds
Vocabulary related changes
- Implement
RDF.enum_for
andRDF.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 V
ocabulary#from_graph
to take an existing vocabulary forclass_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. Preferringalias_method
overalias
, 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 toStatement#initialize
and use when responding to#inferred?
. This allows a reasoner to mark inferred/entailed statements. - Add
Format.accept_types
andFormat.accept_type
. This allowsFormat.content_type
to be provided with priority parameters for thetype
, andaliases
. These are stripped out to allowFormat.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
fromURI
toValue
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"
.
- Typo
- CLI does not set @readers when evaluating from the command line, causing exception.
- Reset memoized hash values when canonicalizing
RDF::URI
andRDF::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
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
-
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 toRDF::Values
Ruby 2.3.0 changed the behavior of
Comparable#==
to avoid hiding errors. This led toNoMethodError
s for comparisons that returnfalse
for previous Rubies.This introduces a custom
RDF::List#==
implementation for explicitly
supported comparisons betweenRDF::Value
classes. We returnfalse
immediately forRDF::Value
s which are not#list?
; falling back on
Comparable
for other types.Further,
RDF::List
s with three elements that happen to coincide with
the terms of an RDF::Statement would previously returntrue
. 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 casesUsing
Array(other)
instead ofother.to_a
avoids throwing errors when
comparing. This minor tweak slightly improves the solution to #304 given
in #305.
RDF.rb 2.0.1
- 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.