From 2a94ae57916198d099cb22169b62ec3dc17aa70f Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 3 Aug 2024 12:40:31 -0700 Subject: [PATCH] Don't parse quoted triples when validating. --- lib/rdf/mixin/enumerable.rb | 2 +- lib/rdf/ntriples/reader.rb | 4 ++-- lib/rdf/repository.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rdf/mixin/enumerable.rb b/lib/rdf/mixin/enumerable.rb index 03a6fc11..c82709dd 100644 --- a/lib/rdf/mixin/enumerable.rb +++ b/lib/rdf/mixin/enumerable.rb @@ -84,7 +84,7 @@ def to_a # * `:validity` allows a concrete Enumerable implementation to indicate that it does or does not support valididty checking. By default implementations are assumed to support validity checking. # * `:skolemize` supports [Skolemization](https://www.w3.org/wiki/BnodeSkolemization) of an `Enumerable`. Implementations supporting this feature must implement a `#skolemize` method, taking a base URI used for minting URIs for BNodes as stable identifiers and a `#deskolemize` method, also taking a base URI used for turning URIs having that prefix back into the same BNodes which were originally skolemized. # * `:rdf_full` supports RDF 1.2 Full profile, including support for embedded Triple Terms. - # * `:quoted_triples` supports RDF-star quoted triples. + # * `:quoted_triples` supports RDF-star quoted triples. (DEPRECATED) # * `:base_direction` supports RDF 1.2 directional language-tagged strings. # # @param [Symbol, #to_sym] feature diff --git a/lib/rdf/ntriples/reader.rb b/lib/rdf/ntriples/reader.rb index 7894d4d7..54b90d72 100644 --- a/lib/rdf/ntriples/reader.rb +++ b/lib/rdf/ntriples/reader.rb @@ -259,9 +259,9 @@ def read_tripleTerm ## # @return [RDF::Statement] - # @deprecated Quoted triples are now deprecated + # @deprecated Quoted triples are now deprecated (not supported when validating) def read_quotedTriple - if @options[:rdfstar] && !match(TT_START) && match(QT_START) + if @options[:rdfstar] && !match(TT_START) && match(QT_START) && !validate? warn "[DEPRECATION] RDF-star quoted triples are deprecated and will be removed in a future version.\n" + "Called from #{Gem.location_of_caller.join(':')}" subject = read_uriref || read_node || read_quotedTriple || fail_subject diff --git a/lib/rdf/repository.rb b/lib/rdf/repository.rb index c7cfb0ca..64545834 100644 --- a/lib/rdf/repository.rb +++ b/lib/rdf/repository.rb @@ -273,7 +273,7 @@ def supports?(feature) when :literal_equality then true when :atomic_write then true when :rdf_full then true - when :quoted_triples then true + when :quoted_triples then true # DEPRECATED when :base_direction then true when :snapshots then true else false