rdf 1.0.10.1 → 1.0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +14 -6
- data/VERSION +1 -1
- data/lib/rdf.rb +23 -5
- data/lib/rdf/format.rb +2 -2
- data/lib/rdf/model/literal.rb +2 -1
- data/lib/rdf/model/statement.rb +2 -0
- data/lib/rdf/reader.rb +1 -1
- data/lib/rdf/writer.rb +2 -2
- metadata +56 -55
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NmZiMmNmOWM1YWE4NDI0MmNjNGUzOTIxOTU3MWRmZjkzNmUxOGE1Mg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MGE1YTQ2NGY5ZGRlNzhmODY4NGQ5Y2VhZjY2Y2ZhODg0MjVjNjA0Mg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NWI0Y2FlYzJhYzA1NjAzN2RiYmVmM2Y2MjQ2YzJhYjRiZmE0OTRiNDYxOTdk
|
10
|
+
NTA2MzQwZWM1NGZjZTU2YmU0MzI1ZDJhZjlmMTMzNTZlZWQ4N2Q1ZTY0NWU5
|
11
|
+
MGU4ODQ3YzE3OTZlMDk2N2QzZjJjNDY4ODRiNmE2YTUzZWNmNDg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MzdkYmI5NGU4ODY0MGJlYTMxYTNhYWM2MTE2NmZlMGQzMzc4ZDI4MWRjMmEy
|
14
|
+
NTIxYWMwMmQ0MmUzZmE2ODY1MGY5NjU3MWFkMDlkYTQ1ODBmZGNmZDM4MDBm
|
15
|
+
OTk0MmY5ZjhiYjRjMjg1NzgwZmZhMGE3OTAxYjkzM2Y5MmQ0MWU=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.10.
|
1
|
+
1.0.10.2
|
data/lib/rdf.rb
CHANGED
@@ -133,11 +133,30 @@ module RDF
|
|
133
133
|
end
|
134
134
|
|
135
135
|
##
|
136
|
-
#
|
136
|
+
# @overload Statement()
|
137
137
|
#
|
138
|
-
# @
|
139
|
-
|
140
|
-
|
138
|
+
# @overload Statement(options = {})
|
139
|
+
# @param [Hash{Symbol => Object}] options
|
140
|
+
# @option options [RDF::Resource] :subject (nil)
|
141
|
+
# @option options [RDF::URI] :predicate (nil)
|
142
|
+
# @option options [RDF::Term] :object (nil)
|
143
|
+
# @option options [RDF::Resource] :context (nil)
|
144
|
+
# Note, in RDF 1.1, a context MUST be an IRI.
|
145
|
+
#
|
146
|
+
# @overload Statement(subject, predicate, object, options = {})
|
147
|
+
# @param [RDF::Resource] subject
|
148
|
+
# @param [RDF::URI] predicate
|
149
|
+
# @param [RDF::Term] object
|
150
|
+
# @param [Hash{Symbol => Object}] options
|
151
|
+
# @option options [RDF::Resource] :context (nil)
|
152
|
+
# @return [RDF::Statement]
|
153
|
+
#
|
154
|
+
def self.Statement(*args)
|
155
|
+
if args.empty?
|
156
|
+
RDF[:Statement]
|
157
|
+
else
|
158
|
+
Statement.new(*args)
|
159
|
+
end
|
141
160
|
end
|
142
161
|
|
143
162
|
##
|
@@ -194,7 +213,6 @@ module RDF
|
|
194
213
|
Property
|
195
214
|
rest
|
196
215
|
Seq
|
197
|
-
Statement
|
198
216
|
subject
|
199
217
|
type
|
200
218
|
value
|
data/lib/rdf/format.rb
CHANGED
@@ -142,8 +142,8 @@ module RDF
|
|
142
142
|
|
143
143
|
# If we have a sample, use that for format detection
|
144
144
|
if sample = (options[:sample] if options.is_a?(Hash)) || (yield if block_given?)
|
145
|
-
sample = sample.to_s
|
146
|
-
sample.force_encoding(Encoding::
|
145
|
+
sample = sample.dup.to_s
|
146
|
+
sample.force_encoding(Encoding::US_ASCII) if sample.respond_to?(:force_encoding)
|
147
147
|
# Given a sample, perform format detection across the appropriate formats, choosing
|
148
148
|
# the first that matches
|
149
149
|
format ||= @@subclasses
|
data/lib/rdf/model/literal.rb
CHANGED
@@ -167,7 +167,8 @@ module RDF
|
|
167
167
|
@object = value
|
168
168
|
@string = options[:lexical] if options[:lexical]
|
169
169
|
@string = value if !defined?(@string) && value.is_a?(String)
|
170
|
-
@string.encode
|
170
|
+
@string = @string.encode(Encoding::UTF_8) if @string && @string.respond_to?(:encode)
|
171
|
+
@object = @string if @string && @object.is_a?(String)
|
171
172
|
@language = options[:language].to_s.to_sym if options[:language]
|
172
173
|
@datatype = RDF::URI(options[:datatype]) if options[:datatype]
|
173
174
|
@datatype ||= self.class.const_get(:DATATYPE) if self.class.const_defined?(:DATATYPE)
|
data/lib/rdf/model/statement.rb
CHANGED
@@ -59,6 +59,7 @@ module RDF
|
|
59
59
|
# @option options [RDF::Term] :object (nil)
|
60
60
|
# @option options [RDF::Resource] :context (nil)
|
61
61
|
# Note, in RDF 1.1, a context MUST be an IRI.
|
62
|
+
# @return [RDF::Statement]
|
62
63
|
#
|
63
64
|
# @overload initialize(subject, predicate, object, options = {})
|
64
65
|
# @param [RDF::Resource] subject
|
@@ -66,6 +67,7 @@ module RDF
|
|
66
67
|
# @param [RDF::Term] object
|
67
68
|
# @param [Hash{Symbol => Object}] options
|
68
69
|
# @option options [RDF::Resource] :context (nil)
|
70
|
+
# @return [RDF::Statement]
|
69
71
|
def initialize(subject = nil, predicate = nil, object = nil, options = {})
|
70
72
|
case subject
|
71
73
|
when Hash
|
data/lib/rdf/reader.rb
CHANGED
@@ -497,7 +497,7 @@ module RDF
|
|
497
497
|
# Encoding::UndefinedConversionError is raised by MRI.
|
498
498
|
# Encoding::InvalidByteSequenceError is raised by jruby >= 1.7.5
|
499
499
|
# Encoding::ConverterNotFoundError is raised by jruby < 1.7.5
|
500
|
-
@line = RDF::NTriples::Reader.unescape(@line).encode
|
500
|
+
@line = RDF::NTriples::Reader.unescape(@line).encode(encoding)
|
501
501
|
end
|
502
502
|
@line
|
503
503
|
end
|
data/lib/rdf/writer.rb
CHANGED
@@ -300,7 +300,7 @@ module RDF
|
|
300
300
|
#
|
301
301
|
# @return [Encoding]
|
302
302
|
def encoding
|
303
|
-
return nil unless "".respond_to?(:encode
|
303
|
+
return nil unless "".respond_to?(:encode)
|
304
304
|
case @options[:encoding]
|
305
305
|
when String, Symbol
|
306
306
|
Encoding.find(@options[:encoding].to_s)
|
@@ -475,7 +475,7 @@ module RDF
|
|
475
475
|
##
|
476
476
|
# @return [void]
|
477
477
|
def puts(*args)
|
478
|
-
@output.puts(*args.map {|s| s.respond_to?(:encode
|
478
|
+
@output.puts(*args.map {|s| s.respond_to?(:encode) ? s.encode(encoding) : s})
|
479
479
|
end
|
480
480
|
|
481
481
|
##
|
metadata
CHANGED
@@ -1,88 +1,89 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.10.
|
4
|
+
version: 1.0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arto Bendiken
|
8
8
|
- Ben Lavender
|
9
9
|
- Gregg Kellogg
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-11-
|
13
|
+
date: 2013-11-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|
17
|
-
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- - '>='
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '2.3'
|
22
|
-
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
25
|
requirements:
|
24
|
-
- - '>='
|
26
|
+
- - ! '>='
|
25
27
|
- !ruby/object:Gem::Version
|
26
28
|
version: '2.3'
|
27
|
-
prerelease: false
|
28
|
-
type: :runtime
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rdf-spec
|
31
|
-
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - ~>
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: 1.0.9
|
36
|
-
|
36
|
+
type: :development
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
39
|
requirements:
|
38
40
|
- - ~>
|
39
41
|
- !ruby/object:Gem::Version
|
40
42
|
version: 1.0.9
|
41
|
-
prerelease: false
|
42
|
-
type: :development
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rdf-rdfxml
|
45
|
-
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - '>='
|
47
|
+
- - ! '>='
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
|
-
|
50
|
+
type: :development
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
53
|
requirements:
|
52
|
-
- - '>='
|
54
|
+
- - ! '>='
|
53
55
|
- !ruby/object:Gem::Version
|
54
56
|
version: '0'
|
55
|
-
prerelease: false
|
56
|
-
type: :development
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: rspec
|
59
|
-
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- - '>='
|
61
|
+
- - ! '>='
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '2.14'
|
64
|
-
|
64
|
+
type: :development
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
67
|
requirements:
|
66
|
-
- - '>='
|
68
|
+
- - ! '>='
|
67
69
|
- !ruby/object:Gem::Version
|
68
70
|
version: '2.14'
|
69
|
-
prerelease: false
|
70
|
-
type: :development
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: yard
|
73
|
-
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- - '>='
|
75
|
+
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0.8'
|
78
|
-
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
81
|
requirements:
|
80
|
-
- - '>='
|
82
|
+
- - ! '>='
|
81
83
|
- !ruby/object:Gem::Version
|
82
84
|
version: '0.8'
|
83
|
-
|
84
|
-
|
85
|
-
description: RDF.rb is a pure-Ruby library for working with Resource Description Framework (RDF) data.
|
85
|
+
description: RDF.rb is a pure-Ruby library for working with Resource Description Framework
|
86
|
+
(RDF) data.
|
86
87
|
email: public-rdf-ruby@w3.org
|
87
88
|
executables:
|
88
89
|
- rdf
|
@@ -97,19 +98,8 @@ files:
|
|
97
98
|
- bin/rdf
|
98
99
|
- etc/doap.nt
|
99
100
|
- lib/df.rb
|
100
|
-
- lib/rdf.rb
|
101
101
|
- lib/rdf/cli.rb
|
102
102
|
- lib/rdf/format.rb
|
103
|
-
- lib/rdf/nquads.rb
|
104
|
-
- lib/rdf/ntriples.rb
|
105
|
-
- lib/rdf/query.rb
|
106
|
-
- lib/rdf/reader.rb
|
107
|
-
- lib/rdf/repository.rb
|
108
|
-
- lib/rdf/transaction.rb
|
109
|
-
- lib/rdf/util.rb
|
110
|
-
- lib/rdf/version.rb
|
111
|
-
- lib/rdf/vocab.rb
|
112
|
-
- lib/rdf/writer.rb
|
113
103
|
- lib/rdf/mixin/countable.rb
|
114
104
|
- lib/rdf/mixin/durable.rb
|
115
105
|
- lib/rdf/mixin/enumerable.rb
|
@@ -122,13 +112,6 @@ files:
|
|
122
112
|
- lib/rdf/mixin/writable.rb
|
123
113
|
- lib/rdf/model/graph.rb
|
124
114
|
- lib/rdf/model/list.rb
|
125
|
-
- lib/rdf/model/literal.rb
|
126
|
-
- lib/rdf/model/node.rb
|
127
|
-
- lib/rdf/model/resource.rb
|
128
|
-
- lib/rdf/model/statement.rb
|
129
|
-
- lib/rdf/model/term.rb
|
130
|
-
- lib/rdf/model/uri.rb
|
131
|
-
- lib/rdf/model/value.rb
|
132
115
|
- lib/rdf/model/literal/boolean.rb
|
133
116
|
- lib/rdf/model/literal/date.rb
|
134
117
|
- lib/rdf/model/literal/datetime.rb
|
@@ -140,18 +123,33 @@ files:
|
|
140
123
|
- lib/rdf/model/literal/time.rb
|
141
124
|
- lib/rdf/model/literal/token.rb
|
142
125
|
- lib/rdf/model/literal/xml.rb
|
126
|
+
- lib/rdf/model/literal.rb
|
127
|
+
- lib/rdf/model/node.rb
|
128
|
+
- lib/rdf/model/resource.rb
|
129
|
+
- lib/rdf/model/statement.rb
|
130
|
+
- lib/rdf/model/term.rb
|
131
|
+
- lib/rdf/model/uri.rb
|
132
|
+
- lib/rdf/model/value.rb
|
133
|
+
- lib/rdf/nquads.rb
|
143
134
|
- lib/rdf/ntriples/format.rb
|
144
135
|
- lib/rdf/ntriples/reader.rb
|
145
136
|
- lib/rdf/ntriples/writer.rb
|
137
|
+
- lib/rdf/ntriples.rb
|
146
138
|
- lib/rdf/query/hash_pattern_normalizer.rb
|
147
139
|
- lib/rdf/query/pattern.rb
|
148
140
|
- lib/rdf/query/solution.rb
|
149
141
|
- lib/rdf/query/solutions.rb
|
150
142
|
- lib/rdf/query/variable.rb
|
143
|
+
- lib/rdf/query.rb
|
144
|
+
- lib/rdf/reader.rb
|
145
|
+
- lib/rdf/repository.rb
|
146
|
+
- lib/rdf/transaction.rb
|
151
147
|
- lib/rdf/util/aliasing.rb
|
152
148
|
- lib/rdf/util/cache.rb
|
153
149
|
- lib/rdf/util/file.rb
|
154
150
|
- lib/rdf/util/uuid.rb
|
151
|
+
- lib/rdf/util.rb
|
152
|
+
- lib/rdf/version.rb
|
155
153
|
- lib/rdf/vocab/cc.rb
|
156
154
|
- lib/rdf/vocab/cert.rb
|
157
155
|
- lib/rdf/vocab/dc.rb
|
@@ -172,28 +170,31 @@ files:
|
|
172
170
|
- lib/rdf/vocab/wot.rb
|
173
171
|
- lib/rdf/vocab/xhtml.rb
|
174
172
|
- lib/rdf/vocab/xsd.rb
|
173
|
+
- lib/rdf/vocab.rb
|
174
|
+
- lib/rdf/writer.rb
|
175
|
+
- lib/rdf.rb
|
175
176
|
homepage: http://ruby-rdf.github.com/
|
176
177
|
licenses:
|
177
178
|
- Public Domain
|
178
179
|
metadata: {}
|
179
|
-
post_install_message:
|
180
|
+
post_install_message:
|
180
181
|
rdoc_options: []
|
181
182
|
require_paths:
|
182
183
|
- lib
|
183
184
|
required_ruby_version: !ruby/object:Gem::Requirement
|
184
185
|
requirements:
|
185
|
-
- - '>='
|
186
|
+
- - ! '>='
|
186
187
|
- !ruby/object:Gem::Version
|
187
188
|
version: 1.8.7
|
188
189
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
190
|
requirements:
|
190
|
-
- - '>='
|
191
|
+
- - ! '>='
|
191
192
|
- !ruby/object:Gem::Version
|
192
193
|
version: '0'
|
193
194
|
requirements: []
|
194
195
|
rubyforge_project: rdf
|
195
|
-
rubygems_version: 2.
|
196
|
-
signing_key:
|
196
|
+
rubygems_version: 2.0.5
|
197
|
+
signing_key:
|
197
198
|
specification_version: 4
|
198
199
|
summary: A Ruby library for working with Resource Description Framework (RDF) data.
|
199
200
|
test_files: []
|