Skip to content

Commit 6876b76

Browse files
committed
Remove support for the RDF-star CG version of quoted triples, leaving only triple terms.
1 parent ea3e888 commit 6876b76

14 files changed

Lines changed: 13 additions & 280 deletions

File tree

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,6 @@ A separate [SPARQL][SPARQL doc] gem builds on basic BGP support to provide full
265265
foaf[:name] #=> RDF::URI("http://xmlns.com/foaf/0.1/name")
266266
foaf['mbox'] #=> RDF::URI("http://xmlns.com/foaf/0.1/mbox")
267267

268-
## RDF-star CG
269-
270-
[RDF.rb][] includes provisional support for [RDF-star][] with an N-Triples/N-Quads syntax for quoted triples in the _subject_ or _object_ position.
271-
272-
Support for RDF-star quoted triples is now deprecated, use RDF 1.2 triple terms instead.
273-
274268
## RDF 1.2
275269

276270
[RDF.rb][] includes provisional support for [RDF 1.2][] with an N-Triples/N-Quads syntax for triple terms in the _object_ position.

lib/rdf/mixin/enumerable.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ def to_a
8484
# * `: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.
8585
# * `: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.
8686
# * `:rdf_full` supports RDF 1.2 Full profile, including support for embedded Triple Terms.
87-
# * `:quoted_triples` supports RDF-star quoted triples. (DEPRECATED)
8887
# * `:base_direction` supports RDF 1.2 directional language-tagged strings.
8988
#
9089
# @param [Symbol, #to_sym] feature

lib/rdf/mixin/writable.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,8 @@ def insert_graph(graph)
127127
def insert_statements(statements)
128128
each = statements.respond_to?(:each_statement) ? :each_statement : :each
129129
statements.__send__(each) do |statement|
130-
# FIXME: quoted triples are now deprecated
131-
if statement.embedded? && respond_to?(:supports?) && !(supports?(:quoted_triples) || supports?(:rdf_full))
132-
raise ArgumentError, "Writable does not support quoted triples"
130+
if statement.embedded? && respond_to?(:supports?) && !supports?(:rdf_full)
131+
raise ArgumentError, "Writable does not support triple terms"
133132
end
134133
if statement.object && statement.object.literal? && statement.object.direction? && respond_to?(:supports?) && !supports?(:base_direction)
135134
raise ArgumentError, "Writable does not support directional languaged-tagged strings"

lib/rdf/model/dataset.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ def isolation_level
104104
# @private
105105
# @see RDF::Enumerable#supports?
106106
def supports?(feature)
107-
# FIXME: quoted triples are now deprecated
108-
return true if %i(graph_name quoted_triples rdf_full).include?(feature)
107+
return true if %i(graph_name rdf_full).include?(feature)
109108
super
110109
end
111110

lib/rdf/model/graph.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,7 @@ def query_pattern(pattern, **options, &block)
335335
# @private
336336
# @see RDF::Mutable#insert
337337
def insert_statement(statement)
338-
# FIXME: quoted triples are now deprecated
339-
if statement.embedded? && !(@data.supports?(:quoted_triples) || @data.supports?(:rdf_full))
338+
if statement.embedded? && !@data.supports?(:rdf_full)
340339
raise ArgumentError, "Graph does not support the RDF Full profile"
341340
end
342341
if statement.object && statement.object.literal? && statement.object.direction? && !@data.supports?(:base_direction)

lib/rdf/model/statement.rb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def self.from(statement, graph_name: nil, **options)
7272
# Note, in RDF 1.1, a graph name MUST be an {Resource}.
7373
# @option options [Boolean] :inferred used as a marker to record that this statement was inferred based on semantic relationships (T-Box).
7474
# @option options [Boolean] :tripleTerm used as a marker to record that this statement appears as the object of another RDF::Statement.
75-
# @option options [Boolean] :quoted used as a marker to record that this statement quoted and appears as the subject or object of another RDF::Statement (deprecated).
7675
# @return [RDF::Statement]
7776
#
7877
# @overload initialize(subject, predicate, object, **options)
@@ -86,7 +85,6 @@ def self.from(statement, graph_name: nil, **options)
8685
# Note, in RDF 1.1, a graph name MUST be an {Resource}.
8786
# @option options [Boolean] :inferred used as a marker to record that this statement was inferred based on semantic relationships (T-Box).
8887
# @option options [Boolean] :tripleTerm used as a marker to record that this statement appears as the object of another RDF::Statement.
89-
# @option options [Boolean] :quoted used as a marker to record that this statement quoted and appears as the subject or object of another RDF::Statement (deprecated).
9088
# @return [RDF::Statement]
9189
def initialize(subject = nil, predicate = nil, object = nil, options = {})
9290
if subject.is_a?(Hash)
@@ -187,7 +185,7 @@ def variable?(*args)
187185
# Note: Nomenclature is evolving, alternatives could include `#complex?` and `#nested?`
188186
# @return [Boolean]
189187
def embedded?
190-
subject && subject.statement? || object && object.statement?
188+
object && object.statement?
191189
end
192190

193191
##
@@ -208,7 +206,7 @@ def valid?
208206
##
209207
# @return [Boolean]
210208
def asserted?
211-
!quoted?
209+
!embedded?
212210
end
213211

214212
##
@@ -217,13 +215,6 @@ def tripleTerm?
217215
!!@options[:tripleTerm]
218216
end
219217

220-
##
221-
# @return [Boolean]
222-
# @deprecated Quoted triples are now deprecated
223-
def quoted?
224-
!!@options[:quoted]
225-
end
226-
227218
##
228219
# @return [Boolean]
229220
def inferred?

lib/rdf/nquads.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,9 @@ def read_triple
7575
elsif version = read_version
7676
@options[:version] = version
7777
else
78-
# FIXME: quoted triples are now deprecated
79-
subject = read_uriref || read_node || read_quotedTriple || fail_subject
78+
subject = read_uriref || read_node || fail_subject
8079
predicate = read_uriref(intern: true) || fail_predicate
81-
object = read_uriref || read_node || read_literal || read_tripleTerm || read_quotedTriple || fail_object
80+
object = read_uriref || read_node || read_literal || read_tripleTerm || fail_object
8281
graph_name = read_uriref || read_node
8382
if validate? && !read_eos
8483
log_error("Expected end of statement (found: #{current_line.inspect})", lineno: lineno, exception: RDF::ReaderError)

lib/rdf/ntriples.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ module RDF
1717
#
1818
# ## Triple terms
1919
#
20-
# Supports statements as resources using `<<(s p o)>>`.
21-
22-
# ## Quoted Triples (Deprecated)
23-
#
24-
# Supports statements as resources using `<<s p o>>`.
20+
# Supports statements as resources in the object postion using `<<(s p o)>>`.
2521
#
2622
# ## Installation
2723
#

lib/rdf/ntriples/reader.rb

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def read_value
203203
begin
204204
read_statement
205205
rescue RDF::ReaderError
206-
value = read_uriref || read_node || read_literal || read_tripleTerm || read_quotedTriple
206+
value = read_uriref || read_node || read_literal || read_tripleTerm
207207
log_recover
208208
value
209209
end
@@ -223,9 +223,9 @@ def read_triple
223223
elsif version = read_version
224224
@options[:version] = version
225225
else
226-
subject = read_uriref || read_node || read_quotedTriple || fail_subject
226+
subject = read_uriref || read_node || fail_subject
227227
predicate = read_uriref(intern: true) || fail_predicate
228-
object = read_uriref || read_node || read_literal || read_tripleTerm || read_quotedTriple || fail_object
228+
object = read_uriref || read_node || read_literal || read_tripleTerm || fail_object
229229

230230
if validate? && !read_eos
231231
log_error("Expected end of statement (found: #{current_line.inspect})", lineno: lineno, exception: RDF::ReaderError)
@@ -256,23 +256,6 @@ def read_tripleTerm
256256
end
257257
end
258258

259-
##
260-
# @return [RDF::Statement]
261-
# @deprecated Quoted triples are now deprecated (not supported when validating)
262-
def read_quotedTriple
263-
if @options[:rdfstar] && !match(TT_START) && match(QT_START) && !validate?
264-
warn "[DEPRECATION] RDF-star quoted triples are deprecated and will be removed in a future version.\n" +
265-
"Called from #{Gem.location_of_caller.join(':')}"
266-
subject = read_uriref || read_node || read_quotedTriple || fail_subject
267-
predicate = read_uriref(intern: true) || fail_predicate
268-
object = read_uriref || read_node || read_literal || read_quotedTriple || fail_object
269-
if !match(QT_END)
270-
log_error("Expected end of statement (found: #{current_line.inspect})", lineno: lineno, exception: RDF::ReaderError)
271-
end
272-
RDF::Statement.new(subject, predicate, object, quoted: true)
273-
end
274-
end
275-
276259
##
277260
# @return [Boolean]
278261
# @see http://www.w3.org/TR/rdf-testcases/#ntrip_grammar (comment)

lib/rdf/ntriples/writer.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,6 @@ def format_tripleTerm(statement, **options)
243243
"<<( %s %s %s )>>" % statement.to_a.map { |value| format_term(value, **options) }
244244
end
245245

246-
##
247-
# Returns the N-Triples representation of an RDF-star quoted triple.
248-
#
249-
# @param [RDF::Statement] statement
250-
# @param [Hash{Symbol => Object}] options ({})
251-
# @return [String]
252-
# @deprecated Quoted triples are now deprecated
253-
def format_quotedTriple(statement, **options)
254-
# FIXME: quoted triples are now deprecated
255-
"<<%s %s %s>>" % statement.to_a.map { |value| format_term(value, **options) }
256-
end
257-
258246
##
259247
# Returns the N-Triples representation of a triple.
260248
#

0 commit comments

Comments
 (0)