rdf 2.2.6 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rdf/model/node.rb +16 -7
- data/lib/rdf/util/uuid.rb +1 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb99255dac04c747b9392d7f487ec45e31ef79bc
|
4
|
+
data.tar.gz: 213f13c8b38eaf7a8324c6002c7bf412f22933e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00d4369281d4945fa1252c79c284928655d5f57c5b96c094be795025cd3db52b8a2f693a52d692cb0e1646921d5cc8137c47039acd1dfb63ec18918a55162176
|
7
|
+
data.tar.gz: 94df47f23a50f7c45f40456d444e2a133df3d71b778663184998824e7496f08b78f5419d2a233697a338b43e4efe31466bb887aef3de0a8be6616e2b7f7363dc
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.7
|
data/lib/rdf/model/node.rb
CHANGED
@@ -30,19 +30,28 @@ module RDF
|
|
30
30
|
##
|
31
31
|
# Returns a blank node with a random UUID-based identifier.
|
32
32
|
#
|
33
|
+
# (Depends on availability of either `uuid` or `uuidtools` gems).
|
34
|
+
#
|
35
|
+
# @param [:default, :compact] format (:default)
|
36
|
+
# Formats supported by the UUID generator:
|
37
|
+
# * `:default` Produces 36 characters, including hyphens separating the UUID value parts
|
38
|
+
# * `:compact` Produces a 32 digits (hexadecimal) value with no hyphens
|
39
|
+
# * `:urn` Adds the prefix urn:uuid: to the default format
|
33
40
|
# @param [Regexp] grammar (nil)
|
34
41
|
# a grammar specification that the generated UUID must match
|
42
|
+
# The UUID is generated such that its initial part is guaranteed
|
43
|
+
# to match the given `grammar`, e.g. `/^[A-Za-z][A-Za-z0-9]*/`.
|
44
|
+
# Some RDF storage systems (e.g. AllegroGraph) require this.
|
45
|
+
# Requires that the `uuid` gem be loadable to use `format`
|
35
46
|
# @return [RDF::Node]
|
36
|
-
def self.uuid(grammar: nil)
|
47
|
+
def self.uuid(format: :default, grammar: nil)
|
37
48
|
case
|
38
49
|
when grammar
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
# @see http://github.com/bendiken/rdf/pull/43
|
43
|
-
uuid = RDF::Util::UUID.generate(options) until uuid =~ grammar
|
50
|
+
warn "[DEPRECATION] The grammar parameter to RDF::Node#uri is deprecated.\n" +
|
51
|
+
"Called from #{Gem.location_of_caller.join(':')}"
|
52
|
+
uuid = RDF::Util::UUID.generate(format: format) until uuid =~ grammar
|
44
53
|
else
|
45
|
-
uuid = RDF::Util::UUID.generate(
|
54
|
+
uuid = RDF::Util::UUID.generate(format: format)
|
46
55
|
end
|
47
56
|
self.new(uuid)
|
48
57
|
end
|
data/lib/rdf/util/uuid.rb
CHANGED
@@ -14,13 +14,11 @@ module RDF; module Util
|
|
14
14
|
# [UUIDTools]: http://rubygems.org/gems/uuidtools
|
15
15
|
#
|
16
16
|
# @param [:default, :compact, :urn] format (:default)
|
17
|
-
# @param [Hash{Symbol => Object}] options
|
18
|
-
# any options to pass through to the underlying UUID library
|
19
17
|
# @return [String] a UUID string
|
20
18
|
# @raise [LoadError] if no UUID library is available
|
21
19
|
# @see http://rubygems.org/gems/uuid
|
22
20
|
# @see http://rubygems.org/gems/uuidtools
|
23
|
-
def self.generate(format: :default
|
21
|
+
def self.generate(format: :default)
|
24
22
|
begin
|
25
23
|
require 'uuid'
|
26
24
|
::UUID.generate(format)
|
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: 2.2.
|
4
|
+
version: 2.2.7
|
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: 2017-
|
13
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: link_header
|
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
298
|
version: '0'
|
299
299
|
requirements: []
|
300
300
|
rubyforge_project: rdf
|
301
|
-
rubygems_version: 2.6.
|
301
|
+
rubygems_version: 2.6.12
|
302
302
|
signing_key:
|
303
303
|
specification_version: 4
|
304
304
|
summary: A Ruby library for working with Resource Description Framework (RDF) data.
|