rdf 3.1.7 → 3.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -13
- data/VERSION +1 -1
- data/lib/rdf.rb +24 -0
- data/lib/rdf/cli.rb +13 -4
- data/lib/rdf/model/list.rb +29 -4
- data/lib/rdf/model/node.rb +2 -6
- data/lib/rdf/model/uri.rb +3 -6
- data/lib/rdf/nquads.rb +2 -2
- data/lib/rdf/ntriples/reader.rb +6 -6
- data/lib/rdf/ntriples/writer.rb +1 -1
- data/lib/rdf/query.rb +1 -1
- data/lib/rdf/reader.rb +6 -19
- data/lib/rdf/util/cache.rb +6 -3
- data/lib/rdf/writer.rb +2 -2
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2becf1b8beb0505402d0b4d2a6f7795cca3657bc579ffac31f3b6037d34e550
|
4
|
+
data.tar.gz: 14b57058dab38a7f7a23df435b83ce8e45c56c51ef718a107e1f1fedb6939a63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 685797b5318d90aeba5755a88cc4aa0acc37b69bcc209d579d52910f0940cdf93d2b453cb3b60a0779cfadda80a2bc050afad2d18b276d973b21e6f1e3f79317
|
7
|
+
data.tar.gz: a13b21146dfa64967464026e99d80bff9f6b472f4ef7d8079ee53a7e80d80f8577b4b7deee9b60643697354e6b42d093b4229d21978f93b5c65b4a2fa050270f
|
data/README.md
CHANGED
@@ -6,9 +6,9 @@ This is a pure-Ruby library for working with [Resource Description Framework
|
|
6
6
|
* <https://ruby-rdf.github.com/rdf>
|
7
7
|
|
8
8
|
[![Gem Version](https://badge.fury.io/rb/rdf.png)](https://badge.fury.io/rb/rdf)
|
9
|
-
[![Build Status](https://
|
10
|
-
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf/badge.svg)](https://coveralls.io/
|
11
|
-
[![
|
9
|
+
[![Build Status](https://github.com/ruby-rdf/rdf/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf/actions?query=workflow%3ACI)
|
10
|
+
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf/badge.svg)](https://coveralls.io/github/ruby-rdf/rdf)
|
11
|
+
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
|
12
12
|
|
13
13
|
## Features
|
14
14
|
|
@@ -39,6 +39,22 @@ resources. Clients may also consider using [RestClient Components][] to enable
|
|
39
39
|
client-side caching of HTTP results using [Rack::Cache][] or other Rack
|
40
40
|
middleware.
|
41
41
|
|
42
|
+
See {RDF::Util::File} for configuring other mechanisms for retrieving resources.
|
43
|
+
|
44
|
+
### Term caching and configuration.
|
45
|
+
|
46
|
+
RDF.rb uses a weak-reference cache for storing internalized versions of URIs and Nodes. This is particularly useful for Nodes as two nodes are equivalent only if they're the same node.
|
47
|
+
|
48
|
+
By default, each cache can grow to an unlimited size, but this can be configured using {RDF.config}, for general limits, along with URI- or Node-specific limits.
|
49
|
+
|
50
|
+
For example, to limit the size of the URI intern cache only:
|
51
|
+
|
52
|
+
RDF.config.uri_cache_size = 10_000
|
53
|
+
|
54
|
+
The default for creating new caches without a specific initialization size can be set using:
|
55
|
+
|
56
|
+
RDF.config.cache_size = 100_000
|
57
|
+
|
42
58
|
## Differences between RDF 1.0 and RDF 1.1
|
43
59
|
|
44
60
|
This version of RDF.rb is fully compatible with [RDF 1.1][], but it creates some
|
@@ -246,17 +262,10 @@ By default, the N-Triples reader will reject a document containing a subject res
|
|
246
262
|
end
|
247
263
|
# => RDF::ReaderError
|
248
264
|
|
249
|
-
Readers support a `rdfstar` option
|
250
|
-
|
251
|
-
graph = RDF::Graph.new do |graph|
|
252
|
-
RDF::NTriples::Reader.new(nt, rdfstar: :PG) {|reader| graph << reader}
|
253
|
-
end
|
254
|
-
graph.count #=> 2
|
255
|
-
|
256
|
-
When using the `:SA` mode, only one statement is asserted, although the reified statement is contained within the graph.
|
265
|
+
Readers support a boolean valued `rdfstar` option.
|
257
266
|
|
258
267
|
graph = RDF::Graph.new do |graph|
|
259
|
-
RDF::NTriples::Reader.new(nt, rdfstar:
|
268
|
+
RDF::NTriples::Reader.new(nt, rdfstar: true) {|reader| graph << reader}
|
260
269
|
end
|
261
270
|
graph.count #=> 1
|
262
271
|
|
@@ -478,7 +487,7 @@ see <https://unlicense.org/> or the accompanying {file:UNLICENSE} file.
|
|
478
487
|
[RDF::TriX]: https://ruby-rdf.github.com/rdf-trix
|
479
488
|
[RDF::Turtle]: https://ruby-rdf.github.com/rdf-turtle
|
480
489
|
[RDF::Raptor]: https://ruby-rdf.github.com/rdf-raptor
|
481
|
-
[RDF*]: https://
|
490
|
+
[RDF*]: https://w3c.github.io/rdf-star/rdf-star-cg-spec.html
|
482
491
|
[LinkedData]: https://ruby-rdf.github.com/linkeddata
|
483
492
|
[JSON::LD]: https://ruby-rdf.github.com/json-ld
|
484
493
|
[RestClient]: https://rubygems.org/gems/rest-client
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.8
|
data/lib/rdf.rb
CHANGED
@@ -2,6 +2,7 @@ require 'stringio'
|
|
2
2
|
require 'bigdecimal'
|
3
3
|
require 'date'
|
4
4
|
require 'time'
|
5
|
+
require "ostruct"
|
5
6
|
|
6
7
|
require 'rdf/version'
|
7
8
|
require 'rdf/extensions'
|
@@ -79,6 +80,29 @@ module RDF
|
|
79
80
|
# CLI
|
80
81
|
autoload :CLI, 'rdf/cli'
|
81
82
|
|
83
|
+
##
|
84
|
+
# Configuration, used open for configuring constants used within the codebase.
|
85
|
+
#
|
86
|
+
# @example set default cache size to be at most 10,000 entries
|
87
|
+
#
|
88
|
+
# RDF.config.cache_size = 10_000
|
89
|
+
#
|
90
|
+
# @example set cache size for interned URIs to 5,000 entries
|
91
|
+
#
|
92
|
+
# RDF.config.uri_cache_size = 5_000
|
93
|
+
#
|
94
|
+
# Defaults:
|
95
|
+
# * `cache_size`: -1
|
96
|
+
# * `uri_cache_size`: `cache_size`
|
97
|
+
# * `node_cache_size`: `cache_size`
|
98
|
+
#
|
99
|
+
# @note cache configurations must be set before initial use, when the caches are allocated.
|
100
|
+
# @see RDF::Util::Cache.new
|
101
|
+
# @return [Object]
|
102
|
+
def self.config
|
103
|
+
@config ||= OpenStruct.new(cache_size: -1, uri_cache_size: nil, node_cache_size: nil)
|
104
|
+
end
|
105
|
+
|
82
106
|
##
|
83
107
|
# Alias for `RDF::Resource.new`.
|
84
108
|
#
|
data/lib/rdf/cli.rb
CHANGED
@@ -162,6 +162,7 @@ module RDF
|
|
162
162
|
# * `lambda` code run to execute command.
|
163
163
|
# * `filter` Option values that must match for command to be used
|
164
164
|
# * `control` Used to indicate how (if) command is displayed
|
165
|
+
# * `repository` Use this repository, if set
|
165
166
|
# * `options` an optional array of `RDF::CLI::Option` describing command-specific options.
|
166
167
|
# * `option_use`: A hash of option symbol to option usage, used for overriding the default status of an option for this command.
|
167
168
|
# @return [Hash{Symbol => Hash{Symbol => Object}}]
|
@@ -493,6 +494,9 @@ module RDF
|
|
493
494
|
raise ArgumentError, "Incompatible command #{c} used with option #{opt}=#{options[opt]}"
|
494
495
|
end
|
495
496
|
end
|
497
|
+
|
498
|
+
# The command may specify a repository instance to use
|
499
|
+
options[:repository] ||= COMMANDS[c.to_sym][:repository]
|
496
500
|
end
|
497
501
|
|
498
502
|
# Hacks for specific options
|
@@ -501,9 +505,11 @@ module RDF
|
|
501
505
|
options[:format] = options[:format].to_sym if options[:format]
|
502
506
|
options[:output_format] = options[:output_format].to_sym if options[:output_format]
|
503
507
|
|
504
|
-
|
505
|
-
|
506
|
-
|
508
|
+
# Allow repository to be set via option.
|
509
|
+
@repository = options[:repository] ||
|
510
|
+
(options[:ordered] ?
|
511
|
+
[].extend(RDF::Enumerable, RDF::Queryable) :
|
512
|
+
RDF::Repository.new)
|
507
513
|
|
508
514
|
# Parse input files if any command requires it
|
509
515
|
if cmds.any? {|c| COMMANDS[c.to_sym][:parse]}
|
@@ -518,7 +524,10 @@ module RDF
|
|
518
524
|
|
519
525
|
# Run each command in sequence
|
520
526
|
cmds.each do |command|
|
521
|
-
COMMANDS[command.to_sym][:lambda].call(args,
|
527
|
+
COMMANDS[command.to_sym][:lambda].call(args,
|
528
|
+
output: output,
|
529
|
+
messages: messages,
|
530
|
+
**options.merge(repository: repository))
|
522
531
|
end
|
523
532
|
|
524
533
|
# Normalize messages
|
data/lib/rdf/model/list.rb
CHANGED
@@ -49,14 +49,23 @@ module RDF
|
|
49
49
|
# g = RDF::Graph.new << l
|
50
50
|
# g.count # => l.count
|
51
51
|
#
|
52
|
+
# @example use a transaction for block initialization
|
53
|
+
# l = RDF::List(graph: graph, wrap_transaction: true) do |list|
|
54
|
+
# list << RDF::Literal(1)
|
55
|
+
# # list.graph.rollback will rollback all list changes within this block.
|
56
|
+
# end
|
57
|
+
# list.count #=> 1
|
58
|
+
#
|
52
59
|
# @param [RDF::Resource] subject (RDF.nil)
|
53
60
|
# Subject should be an {RDF::Node}, not a {RDF::URI}. A list with an IRI head will not validate, but is commonly used to detect if a list is valid.
|
54
61
|
# @param [RDF::Graph] graph (RDF::Graph.new)
|
55
62
|
# @param [Array<RDF::Term>] values
|
56
63
|
# Any values which are not terms are coerced to `RDF::Literal`.
|
64
|
+
# @param [Boolean] wrap_transaction (false)
|
65
|
+
# Wraps the callback in a transaction, and replaces the graph with that transaction for the duraction of the callback. This has the effect of allowing any list changes to be made atomically, or rolled back.
|
57
66
|
# @yield [list]
|
58
67
|
# @yieldparam [RDF::List] list
|
59
|
-
def initialize(subject: nil, graph: nil, values: nil, &block)
|
68
|
+
def initialize(subject: nil, graph: nil, values: nil, wrap_transaction: false, &block)
|
60
69
|
@subject = subject || RDF.nil
|
61
70
|
@graph = graph || RDF::Graph.new
|
62
71
|
is_empty = @graph.query({subject: subject, predicate: RDF.first}).empty?
|
@@ -78,9 +87,25 @@ module RDF
|
|
78
87
|
end
|
79
88
|
|
80
89
|
if block_given?
|
81
|
-
|
82
|
-
|
83
|
-
|
90
|
+
if wrap_transaction
|
91
|
+
old_graph = @graph
|
92
|
+
begin
|
93
|
+
Transaction.begin(@graph, graph_name: @graph.graph_name, mutable: @graph.mutable?) do |trans|
|
94
|
+
@graph = trans
|
95
|
+
case block.arity
|
96
|
+
when 1 then block.call(self)
|
97
|
+
else instance_eval(&block)
|
98
|
+
end
|
99
|
+
trans.execute if trans.mutated?
|
100
|
+
end
|
101
|
+
ensure
|
102
|
+
@graph = old_graph
|
103
|
+
end
|
104
|
+
else
|
105
|
+
case block.arity
|
106
|
+
when 1 then block.call(self)
|
107
|
+
else instance_eval(&block)
|
108
|
+
end
|
84
109
|
end
|
85
110
|
end
|
86
111
|
end
|
data/lib/rdf/model/node.rb
CHANGED
@@ -13,18 +13,14 @@ module RDF
|
|
13
13
|
include RDF::Resource
|
14
14
|
|
15
15
|
##
|
16
|
-
#
|
17
|
-
# cached in memory at any one time.
|
16
|
+
# Cache size may be set through {RDF.config} using `node_cache_size`.
|
18
17
|
#
|
19
18
|
# @note caching interned nodes means that two different invocations using the same symbol will result in the same node, which may not be appropriate depending on the graph from which it is used. RDF requires that bnodes with the same label are, in fact, different bnodes, unless they are used within the same document.
|
20
|
-
CACHE_SIZE = -1 # unlimited by default
|
21
|
-
|
22
|
-
##
|
23
19
|
# @return [RDF::Util::Cache]
|
24
20
|
# @private
|
25
21
|
def self.cache
|
26
22
|
require 'rdf/util/cache' unless defined?(::RDF::Util::Cache)
|
27
|
-
@cache ||= RDF::Util::Cache.new(
|
23
|
+
@cache ||= RDF::Util::Cache.new(RDF.config.node_cache_size)
|
28
24
|
end
|
29
25
|
|
30
26
|
##
|
data/lib/rdf/model/uri.rb
CHANGED
@@ -27,11 +27,6 @@ module RDF
|
|
27
27
|
class URI
|
28
28
|
include RDF::Resource
|
29
29
|
|
30
|
-
##
|
31
|
-
# Defines the maximum number of interned URI references that can be held
|
32
|
-
# cached in memory at any one time.
|
33
|
-
CACHE_SIZE = -1 # unlimited by default
|
34
|
-
|
35
30
|
# IRI components
|
36
31
|
UCSCHAR = Regexp.compile(<<-EOS.gsub(/\s+/, ''))
|
37
32
|
[\\u00A0-\\uD7FF]|[\\uF900-\\uFDCF]|[\\uFDF0-\\uFFEF]|
|
@@ -117,11 +112,13 @@ module RDF
|
|
117
112
|
).freeze
|
118
113
|
|
119
114
|
##
|
115
|
+
# Cache size may be set through {RDF.config} using `uri_cache_size`.
|
116
|
+
#
|
120
117
|
# @return [RDF::Util::Cache]
|
121
118
|
# @private
|
122
119
|
def self.cache
|
123
120
|
require 'rdf/util/cache' unless defined?(::RDF::Util::Cache)
|
124
|
-
@cache ||= RDF::Util::Cache.new(
|
121
|
+
@cache ||= RDF::Util::Cache.new(RDF.config.uri_cache_size)
|
125
122
|
end
|
126
123
|
|
127
124
|
##
|
data/lib/rdf/nquads.rb
CHANGED
@@ -69,9 +69,9 @@ module RDF
|
|
69
69
|
|
70
70
|
begin
|
71
71
|
unless blank? || read_comment
|
72
|
-
subject = read_uriref || read_node ||
|
72
|
+
subject = read_uriref || read_node || read_embTriple || fail_subject
|
73
73
|
predicate = read_uriref(intern: true) || fail_predicate
|
74
|
-
object = read_uriref || read_node || read_literal ||
|
74
|
+
object = read_uriref || read_node || read_literal || read_embTriple || fail_object
|
75
75
|
graph_name = read_uriref || read_node
|
76
76
|
if validate? && !read_eos
|
77
77
|
log_error("Expected end of statement (found: #{current_line.inspect})", lineno: lineno, exception: RDF::ReaderError)
|
data/lib/rdf/ntriples/reader.rb
CHANGED
@@ -213,7 +213,7 @@ module RDF::NTriples
|
|
213
213
|
begin
|
214
214
|
read_statement
|
215
215
|
rescue RDF::ReaderError
|
216
|
-
value = read_uriref || read_node || read_literal ||
|
216
|
+
value = read_uriref || read_node || read_literal || read_embTriple
|
217
217
|
log_recover
|
218
218
|
value
|
219
219
|
end
|
@@ -229,9 +229,9 @@ module RDF::NTriples
|
|
229
229
|
|
230
230
|
begin
|
231
231
|
unless blank? || read_comment
|
232
|
-
subject = read_uriref || read_node ||
|
232
|
+
subject = read_uriref || read_node || read_embTriple || fail_subject
|
233
233
|
predicate = read_uriref(intern: true) || fail_predicate
|
234
|
-
object = read_uriref || read_node || read_literal ||
|
234
|
+
object = read_uriref || read_node || read_literal || read_embTriple || fail_object
|
235
235
|
|
236
236
|
if validate? && !read_eos
|
237
237
|
log_error("Expected end of statement (found: #{current_line.inspect})", lineno: lineno, exception: RDF::ReaderError)
|
@@ -247,11 +247,11 @@ module RDF::NTriples
|
|
247
247
|
|
248
248
|
##
|
249
249
|
# @return [RDF::Statement]
|
250
|
-
def
|
250
|
+
def read_embTriple
|
251
251
|
if @options[:rdfstar] && match(ST_START)
|
252
|
-
subject = read_uriref || read_node ||
|
252
|
+
subject = read_uriref || read_node || read_embTriple || fail_subject
|
253
253
|
predicate = read_uriref(intern: true) || fail_predicate
|
254
|
-
object = read_uriref || read_node || read_literal ||
|
254
|
+
object = read_uriref || read_node || read_literal || read_embTriple || fail_object
|
255
255
|
if !match(ST_END)
|
256
256
|
log_error("Expected end of statement (found: #{current_line.inspect})", lineno: lineno, exception: RDF::ReaderError)
|
257
257
|
end
|
data/lib/rdf/ntriples/writer.rb
CHANGED
@@ -227,7 +227,7 @@ module RDF::NTriples
|
|
227
227
|
# @param [RDF::Statement] statement
|
228
228
|
# @param [Hash{Symbol => Object}] options ({})
|
229
229
|
# @return [String]
|
230
|
-
def
|
230
|
+
def format_embTriple(statement, **options)
|
231
231
|
"<<%s %s %s>>" % statement.to_a.map { |value| format_term(value, **options) }
|
232
232
|
end
|
233
233
|
##
|
data/lib/rdf/query.rb
CHANGED
@@ -255,7 +255,7 @@ module RDF
|
|
255
255
|
# @see RDF::Query::Pattern#cost
|
256
256
|
# @since 0.3.0
|
257
257
|
def optimize!(**options)
|
258
|
-
optional, required = @patterns.partition(&:optional?)
|
258
|
+
optional, required = @patterns.uniq.partition(&:optional?)
|
259
259
|
required.sort! do |a, b|
|
260
260
|
(a.cost || 0) <=> (b.cost || 0)
|
261
261
|
end
|
data/lib/rdf/reader.rb
CHANGED
@@ -160,10 +160,10 @@ module RDF
|
|
160
160
|
end,
|
161
161
|
RDF::CLI::Option.new(
|
162
162
|
symbol: :rdfstar,
|
163
|
-
|
164
|
-
|
165
|
-
on: ["--
|
166
|
-
description: "Parse RDF
|
163
|
+
datatype: TrueClass,
|
164
|
+
control: :checkbox,
|
165
|
+
on: ["--rdfstar"],
|
166
|
+
description: "Parse RDF*."),
|
167
167
|
RDF::CLI::Option.new(
|
168
168
|
symbol: :validate,
|
169
169
|
datatype: TrueClass,
|
@@ -276,10 +276,8 @@ module RDF
|
|
276
276
|
# the encoding of the input stream
|
277
277
|
# @param [Boolean] intern (true)
|
278
278
|
# whether to intern all parsed URIs
|
279
|
-
# @param [
|
279
|
+
# @param [Boolean] rdfstar (false)
|
280
280
|
# support parsing RDF* statement resources.
|
281
|
-
# If `:PG`, referenced statements are also emitted.
|
282
|
-
# If `:SA`, referenced statements are not emitted.
|
283
281
|
# @param [Hash] prefixes (Hash.new)
|
284
282
|
# the prefix mappings to use (not supported by all readers)
|
285
283
|
# @param [Hash{Symbol => Object}] options
|
@@ -295,7 +293,7 @@ module RDF
|
|
295
293
|
encoding: Encoding::UTF_8,
|
296
294
|
intern: true,
|
297
295
|
prefixes: Hash.new,
|
298
|
-
rdfstar:
|
296
|
+
rdfstar: false,
|
299
297
|
validate: false,
|
300
298
|
**options,
|
301
299
|
&block)
|
@@ -401,9 +399,6 @@ module RDF
|
|
401
399
|
# Statements are yielded in the order that they are read from the input
|
402
400
|
# stream.
|
403
401
|
#
|
404
|
-
# If the `rdfstar` option is `:PG` and triples include
|
405
|
-
# embedded statements, they are also enumerated.
|
406
|
-
#
|
407
402
|
# @overload each_statement
|
408
403
|
# @yield [statement]
|
409
404
|
# each statement
|
@@ -423,7 +418,6 @@ module RDF
|
|
423
418
|
loop do
|
424
419
|
st = read_statement
|
425
420
|
block.call(st)
|
426
|
-
each_pg_statement(st, &block) if options[:rdfstar] == :PG
|
427
421
|
end
|
428
422
|
rescue EOFError
|
429
423
|
rewind rescue nil
|
@@ -441,9 +435,6 @@ module RDF
|
|
441
435
|
# Triples are yielded in the order that they are read from the input
|
442
436
|
# stream.
|
443
437
|
#
|
444
|
-
# If the `rdfstar` option is `:PG` and triples include
|
445
|
-
# embedded statements, they are also enumerated.
|
446
|
-
#
|
447
438
|
# @overload each_triple
|
448
439
|
# @yield [subject, predicate, object]
|
449
440
|
# each triple
|
@@ -464,10 +455,6 @@ module RDF
|
|
464
455
|
loop do
|
465
456
|
triple = read_triple
|
466
457
|
block.call(*triple)
|
467
|
-
if options[:rdfstar] == :PG
|
468
|
-
block.call(*triple[0].to_a) if triple[0].is_a?(Statement)
|
469
|
-
block.call(*triple[2].to_a) if triple[2].is_a?(Statement)
|
470
|
-
end
|
471
458
|
end
|
472
459
|
rescue EOFError
|
473
460
|
rewind rescue nil
|
data/lib/rdf/util/cache.rb
CHANGED
@@ -17,6 +17,9 @@ module RDF; module Util
|
|
17
17
|
# @see http://en.wikipedia.org/wiki/Weak_reference
|
18
18
|
# @since 0.2.0
|
19
19
|
class Cache
|
20
|
+
# The configured cache capacity.
|
21
|
+
attr_reader :capacity
|
22
|
+
|
20
23
|
##
|
21
24
|
# @private
|
22
25
|
def self.new(*args)
|
@@ -36,8 +39,8 @@ module RDF; module Util
|
|
36
39
|
|
37
40
|
##
|
38
41
|
# @param [Integer] capacity
|
39
|
-
def initialize(capacity =
|
40
|
-
@capacity = capacity
|
42
|
+
def initialize(capacity = nil)
|
43
|
+
@capacity = capacity || RDF.config.cache_size
|
41
44
|
@cache ||= {}
|
42
45
|
@index ||= {}
|
43
46
|
end
|
@@ -106,7 +109,7 @@ module RDF; module Util
|
|
106
109
|
class WeakRefCache < Cache
|
107
110
|
##
|
108
111
|
# @param [Integer] capacity
|
109
|
-
def initialize(capacity =
|
112
|
+
def initialize(capacity = nil)
|
110
113
|
require 'weakref' unless defined?(::WeakRef)
|
111
114
|
super
|
112
115
|
end
|
data/lib/rdf/writer.rb
CHANGED
@@ -516,7 +516,7 @@ module RDF
|
|
516
516
|
when RDF::Literal then format_literal(term, **options)
|
517
517
|
when RDF::URI then format_uri(term, **options)
|
518
518
|
when RDF::Node then format_node(term, **options)
|
519
|
-
when RDF::Statement then
|
519
|
+
when RDF::Statement then format_embTriple(term, **options)
|
520
520
|
else nil
|
521
521
|
end
|
522
522
|
end
|
@@ -574,7 +574,7 @@ module RDF
|
|
574
574
|
# @return [String]
|
575
575
|
# @raise [NotImplementedError] unless implemented in subclass
|
576
576
|
# @abstract
|
577
|
-
def
|
577
|
+
def format_embTriple(value, **options)
|
578
578
|
raise NotImplementedError.new("#{self.class}#format_statement") # override in subclasses
|
579
579
|
end
|
580
580
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arto Bendiken
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-12-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: link_header
|
@@ -164,42 +164,42 @@ dependencies:
|
|
164
164
|
requirements:
|
165
165
|
- - "~>"
|
166
166
|
- !ruby/object:Gem::Version
|
167
|
-
version: 0.9
|
167
|
+
version: '0.9'
|
168
168
|
type: :development
|
169
169
|
prerelease: false
|
170
170
|
version_requirements: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
172
|
- - "~>"
|
173
173
|
- !ruby/object:Gem::Version
|
174
|
-
version: 0.9
|
174
|
+
version: '0.9'
|
175
175
|
- !ruby/object:Gem::Dependency
|
176
176
|
name: faraday
|
177
177
|
requirement: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
179
|
- - "~>"
|
180
180
|
- !ruby/object:Gem::Version
|
181
|
-
version: '
|
181
|
+
version: '1.2'
|
182
182
|
type: :development
|
183
183
|
prerelease: false
|
184
184
|
version_requirements: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
186
|
- - "~>"
|
187
187
|
- !ruby/object:Gem::Version
|
188
|
-
version: '
|
188
|
+
version: '1.2'
|
189
189
|
- !ruby/object:Gem::Dependency
|
190
190
|
name: faraday_middleware
|
191
191
|
requirement: !ruby/object:Gem::Requirement
|
192
192
|
requirements:
|
193
193
|
- - "~>"
|
194
194
|
- !ruby/object:Gem::Version
|
195
|
-
version: '0
|
195
|
+
version: '1.0'
|
196
196
|
type: :development
|
197
197
|
prerelease: false
|
198
198
|
version_requirements: !ruby/object:Gem::Requirement
|
199
199
|
requirements:
|
200
200
|
- - "~>"
|
201
201
|
- !ruby/object:Gem::Version
|
202
|
-
version: '0
|
202
|
+
version: '1.0'
|
203
203
|
description: RDF.rb is a pure-Ruby library for working with Resource Description Framework
|
204
204
|
(RDF) data.
|
205
205
|
email: public-rdf-ruby@w3.org
|
@@ -303,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
303
303
|
- !ruby/object:Gem::Version
|
304
304
|
version: '0'
|
305
305
|
requirements: []
|
306
|
-
rubygems_version: 3.
|
306
|
+
rubygems_version: 3.2.3
|
307
307
|
signing_key:
|
308
308
|
specification_version: 4
|
309
309
|
summary: A Ruby library for working with Resource Description Framework (RDF) data.
|