Skip to content

Releases: ruby-rdf/rdf

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.

Release 2.0.0

11 Apr 21:52
Compare
Choose a tag to compare

Ruby RDF 2.0

This is the 2.0 release of RDF.rb and related gems. This announces the general availability of RDF.rb 2.0.0 along with other gems collected in the linkeddata meta-gem. Note that this release introduces breaking changes from the 1.* version; in most cases, these are highlighted using deprecation messages if using 1.99.

New Features

  • Readers and Writers now using RDF::Util::Logger for managing error, warning, information, and debug messages, which allow them to be managed more flexibly and consistently.

  • Substantially revised RDF::Transaction, which now serves as a scope for ACID transactions. Transactions are now read-only by default; for read/write transactions, use Transaction.new(mutable: true) or Repository#transaction(mutable: true). Transactions can be applied to an RDF::Transactable (in the core: Repository or Graph).

  • Introduced RDF::Changeset as a set of deletes & inserts which can be applied to a Mutable. The default RDF::Transaction for custom Repository implementations uses aChangeset, which is applied to the Repository.

  • Introduced RDF::Dataset as a read-only super-class of Repository, which can be provided by using Repository#snapshot, among other methods.

  • The in-memory Repository implementation now uses Hamster::Hash to implement a fully functional interface for updating repositories, saving a number of explicit dup operations in queries and allowing fully isolated snapshots and serializable transactions at minimal cost. As a side-effect, there is no guarantee that insert order of statements in a Graph or Repository will be maintained.

  • The rdf command line executable is now pluggable, and can be extended by other gems implementing RDF::Format, RDF::Reader or RDF::Writer. Readers and Writers can define format-specific options, and individual commands can define their own options as well. Commands now have their own help messages.

  • List#initialize now uses keyword arguments instead of positional arguments.

  • Graph#initialize now uses keyword arguments instead of positional arguments.

  • A new class RDF::Changeset has been added. This is meant to replace any
    previous use of RDF::Transaction, which in fact used to in RDF.rb 1.x
    represent more of a buffered changeset than a genuine transaction scope.

    • Instead of RDF::Transaction.execute, use RDF::Changeset.apply.
    • Instead of RDF::Transaction#execute, use RDF::Changeset#apply.
  • The RDF::Transaction class has been substantially revamped, including
    some minor backwards-incompatible changes. These changes will mostly
    affect repository implementors, not so much general RDF.rb users.

    The changes reflect the expanded purpose of the class: instead of being a
    mere buffered changeset (for which, see RDF::Changeset), transactions
    are now intended to provide a proper ACID scope for repository queries and
    mutations.

    We always now also carefully distinguish between read-only and read/write
    transactions, in order to enable repository implementations to take out the
    appropriate locks for concurrency control. Note as well that transactions
    are now read-only by default; mutability must be explicitly requested on
    construction in order to obtain a read/write transaction.

    In case repository implementations should be unable to provide actual ACID
    guarantees for transactions, that must be clearly indicated in their
    documentation. Similarly, implementations should throw an exception when
    appropriate in case they don't provide write transaction support.

    • RDF::Transaction#initialize now takes the target repository as its
      first argument. Transactions are now always tied to a specific
      repository instance, instead of being free-floating objects as they used
      to be (for that, see RDF::Changeset).

    • RDF::Transaction now mixes in RDF::Queryable and RDF::Enumerable,
      enabling quad-pattern matches and BGP queries to execute in a proper
      transaction scope.

    • The RDF::Transaction#context accessor, and its aliases, have been
      removed. Transactions aren't necessarily scoped to a single graph only.

    • There is a new RDF::Transaction#repository accessor for retrieving the
      target repository object that the transaction operates upon.

    • There is a new RDF::Transaction#buffered? predicate for testing
      whether the changeset that constitutes a transaction is available for
      introspection. Particular repository implementations may support both
      options and permit the user the choice on transaction construction.

    • The RDF::Transaction#inserts and #deletes methods are deprecated.
      Instead, there is a new RDF::Transaction#changes accessor to retrieve
      an RDF::Changeset instance, which contains corresponding methods.
      For unbuffered transactions, #changes returns nil.

  • Enumerables vs. Enumerators

    • RDF::Queryable#query and RDF::Query#execute did not return an enumerable, which may be an enumerator. Most internal uses return an Array now, which aides performance for small result sets, but potentially causes problems for large result sets. Implementations may still return an Enumerator, and Enumerators may be passed as arguments.
    • RDF::Enumerable#statements, #quads, #triples, #subjects, #predicates, #objects, and #contexts now return an array rather than an Enumerator.

Removed Interfaces from 1.*

These changes result in a DEPRECATION warning in 1.99, and errors in 2.*:

  • Minimum Ruby version no MRI 2.0 or equivalent 2.3 or greater preferred.
  • Numerous vocabularies have been moved to the rdf-vocab gem, for example RDF::Vocab::FOAF instead of RDF::FOAF.
  • Many interfaces would take a :context option, this has been replaced with :graph_name to more properly correspond to RDF 1.1 concepts. This also includes #context and #context=, #has_context?, and #each_context methods in various modules and classes.
  • Vocabulary.label_for is replaced with Vocabulary::Term#label* Vocabulary.comment_for is replaced with Vocabulary::Term#comment
  • #write_graph and #write_statements are replaced with RDF::Writable#insert
  • Writer#format_value is deprecated in favor of Writer#format_term
  • NTriples::Reader no longer supports Surrogate Pairs.
  • Many interfaces now use [keyword arguments][https://robots.thoughtbot.com/ruby-2-keyword-arguments] instead of positional arguments.
  • List#initialize no longer uses positional arguments. This is a breaking change which cannot support backwards compatibility, but shouldn't affect most normal use.
  • Graph#initialize no longer uses positional arguments.
  • Transaction is completely changed, and existing use from 1.x is unlikely to work without modification in 2.x. Users of the 1.x Transaction who are not interested in ACID transactions should look at RDF::Changeset, which is more similar to the old interface.
  • Vocabulary.load is deprecated, use Vocabulary.from_graph.

The following vocabularies are deprecated and have been moved to the rdf-vocab gem.

  • RDF::CC - Creative Commons (CC)
  • RDF::CERT - W3 Authentication Certificate (CERT)
  • RDF::DC - Dublin Core (DC)
  • RDF::DC11 - Dublin Core 1.1 (DC11) deprecated
  • RDF::DOAP - Description of a Project (DOAP)
  • RDF::EXIF - Exchangeable Image File Format (EXIF)
  • RDF::FOAF - Friend of a Friend (FOAF)
  • RDF::GEO - WGS84 Geo Positioning (GEO)
  • RDF::GR - GoodRelations (GR)
  • RDF::HT - Hypertext Transfer Protocol (HT)
  • RDF::ICAL - RDF Calendar Workspace (ICAL)
  • RDF::MA - Media Resources (MA)
  • RDF::MO - Music Ontology (MO)
  • RDF::OG - Open Graph protocol (OG)
  • RDF::PROV - Provenance on the web (PROV)
  • RDF::RSA - W3 RSA Keys (RSA)
  • RDF::RSS - RDF Site Summary (RSS)
  • RDF::SCHEMA - Schema.org (SCHEMA)
  • RDF::SIOC - Semantically-Interlinked Online Communities (SIOC)
  • RDF::SKOS - Simple Knowledge Organization System (SKOS)
  • RDF::SKOSXL - SKOS eXtension for Labels (SKOSXL)
  • RDF::V - RDF data vocabulary (V)
  • RDF::VCARD - Ontology for vCards (VCARD)
  • RDF::VMD - Data-Vocabulary.org (VMD)
  • RDF::VOID - Vocabulary of Interlinked Datasets (VOID)
  • RDF::VS - SemWeb Vocab Status ontology (VS)
  • RDF::WDRS - Protocol for Web Description Resources (WDRS)
  • RDF::WOT - Web of Trust (WOT)
  • RDF::XHTML - Extensible HyperText Markup Language (XHTML)
  • RDF::XHV - XHTML Vocabulary (XHV)

Ruby gems will not automatically load beta gems via gem update. To get these gems you must explicitly include them using gem install --pre linkeddata.

2.0.0.beta2

07 Apr 00:02
Compare
Choose a tag to compare
2.0.0.beta2 Pre-release
Pre-release

respond_to_missing in RDF::Query::Solution
Freeze Literal, Node and URI values on instantiation.
Freeze Term#to_base result.
Use symbol, rather than string, to index intern cache.
Change "rdf" executable to take a pipeline of commands, so that multiple commands can be stacked.
Remove vocab-fetch
Deprecate Vocabulary.load in favor of Vocabulary.from_graph.
Change vocabulary generation in Rakefile to use rdf cli.