Releases: ruby-rdf/rdf
Release 2.2.8
Update CLI processor:
- Add
:controlfield toCLI::Optionsfor HTML layout - Allow
CLI::Options#callto provide options along withargbased on arity of receiver (this allows options to add other options). - Extract most built-in options to structure.
CLI.optionsdoes not use callback any longer. It takes anargvparameter and figures out commands from there.- CLI.commands now accept a
formatnamed parameter; if used with:json, it returns a JSON structure - CLI::Options now implements
#to_hash. - Add
argsaccessor toOptionParserto retain arguments after options have been extracted. - Note potential addition of
:messagescomponent to options passed to command lambda. - Note that status updates should be logged (info) rather than output to $stdout.
- Add
requiredparameter/option to Option to indicate that the option must be specified. - Overload
RDF::CLI.optionsto also return a JSON representation of options in addition to normal processing. - Make
class_nameoption required for Vocabulary CLI options. - In
CLI.parseif 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#requiredtoCLI::Option#usewith states:disabled,:removed,:required, and:optional. - Allow commands to override option use using
option_use.
Release 2.2.7
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
- In
Reader.open, only useformatto 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
OpenSSLis 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:trueandfalseare case insensitive in SPARQL and case sensitive in Turtle.TrUeis 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.eachandWriter.eachto depend onFormat, not instantiated subclasses, as these may have not been loaded when called. - Add links to
RDF::Repositorydocumentation - Fixup
Transactiondocumentation- 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_hashto#to_hand deprecate#to_hash. This is required because#to_hashis an implicit accessor, which causes problems for methods using keyword options. - Deprecate
Enumerator#to_aryandStatement#to_ary - Add
Literal#to_strfor 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_hashto#to_hand deprecate#to_hash. This is required because#to_hashis an implicit accessor, which causes problems for methods using keyword options. - Deprecate
Enumerator#to_aryandStatement#to_ary - Add
Literal#to_strfor 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 returntruewhen the transaction would change the repository if executed against it's state at transaction start time. We allow implementations to returntruein other cases, as well; there is no guarantee that afalseresult will be returned in any specific circumstances (or ever).- For the base transaction, we simply check whether
@changesis 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
SerializableTransactionincluded in the defaultRepositoryImplementation, we use#equal?on theHamster::Hashinstances. 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::Datasetas anEnumerable/Queryableover a static dataset specified at initialization. - Clarifies handling of the default graph, adopting the ususal definition of an RDF/SPARQL dataset for
RDF::Datasetand its subclasses (e.g.RDF::Repository). NormalEnumerable/Queryableobjects continue to not behave like RDF datasets. The accompanying changes tordf-specreflect 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_hashcalls and comparisons.
- In practice, these objects are either
- Inherit the correct isolation level with #snapshot. Fix a typo in
RDF::Repository#isolation_levelto 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_equalityflag to the default repository implementation.
- Adds
Vocabulary related changes
- Implement
RDF.enum_forandRDF.to_enum. Fixes #314. - Add
.ontologyto 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_graphto take an existing vocabulary forclass_nameto re-define it.
Other improvements
- Define
RDF::Statement#hashto support comparison operations in e.g.Array#- - Dispatch
Enumerator#to_arywith alias There's no need to use#method_missingto dispatch this. Preferringalias_methodoveralias, contrary to Ruby Style Guide. We want dynamic dispatch of the aliased method. - Added
Literal#squishand#squish!to remove leading/trailing whitespace and multiple internal whitespace characters from the value of a literal. - Support
:inferredoption toStatement#initializeand use when responding to#inferred?. This allows a reasoner to mark inferred/entailed statements. - Add
Format.accept_typesandFormat.accept_type. This allowsFormat.content_typeto be provided with priority parameters for thetype, andaliases. These are stripped out to allowFormat.reader_typesand 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_withfromURItoValueand add specs.
Misclaneous bug fixes
- Fix typo in IRI grammar
- Typo
A-zallows 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::URIandRDF::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.