rdf-rdfxml 0.3.3.1 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +3 -0
- data/VERSION +1 -1
- data/lib/rdf/rdfxml/reader.rb +5 -1
- data/rdf-rdfxml.gemspec +5 -15
- data/spec/reader_spec.rb +33 -0
- metadata +78 -94
data/History.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
data/lib/rdf/rdfxml/reader.rb
CHANGED
@@ -134,7 +134,11 @@ module RDF::RDFXML
|
|
134
134
|
|
135
135
|
@doc = case input
|
136
136
|
when Nokogiri::XML::Document then input
|
137
|
-
else
|
137
|
+
else
|
138
|
+
Nokogiri::XML.parse(input, @base_uri.to_s) do |config|
|
139
|
+
config.noent
|
140
|
+
config.strict if options[:validate]
|
141
|
+
end
|
138
142
|
end
|
139
143
|
|
140
144
|
raise RDF::ReaderError, "Synax errors:\n#{@doc.errors}" if !@doc.errors.empty? && validate?
|
data/rdf-rdfxml.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rdf-rdfxml}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date = %q{2011-
|
11
|
+
s.authors = [%q{Gregg Kellogg}]
|
12
|
+
s.date = %q{2011-08-08}
|
13
13
|
s.description = %q{RDF::RDFXML is an RDF/XML reader and writer for the RDF.rb library suite.}
|
14
14
|
s.email = %q{gregg@kellogg-assoc.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -59,19 +59,9 @@ Gem::Specification.new do |s|
|
|
59
59
|
"spec/writer_spec.rb"
|
60
60
|
]
|
61
61
|
s.homepage = %q{http://github.com/gkellogg/rdf-rdfxml}
|
62
|
-
s.require_paths = [
|
63
|
-
s.rubygems_version = %q{1.6
|
62
|
+
s.require_paths = [%q{lib}]
|
63
|
+
s.rubygems_version = %q{1.8.6}
|
64
64
|
s.summary = %q{RDF/XML reader/writer for RDF.rb.}
|
65
|
-
s.test_files = [
|
66
|
-
"spec/format_spec.rb",
|
67
|
-
"spec/graph_spec.rb",
|
68
|
-
"spec/literal_spec.rb",
|
69
|
-
"spec/matchers.rb",
|
70
|
-
"spec/rdf_test.rb",
|
71
|
-
"spec/reader_spec.rb",
|
72
|
-
"spec/spec_helper.rb",
|
73
|
-
"spec/writer_spec.rb"
|
74
|
-
]
|
75
65
|
|
76
66
|
if s.respond_to? :specification_version then
|
77
67
|
s.specification_version = 3
|
data/spec/reader_spec.rb
CHANGED
@@ -295,6 +295,39 @@ EOF
|
|
295
295
|
graph.should be_equivalent_graph(triples, :about => "http://example.com/", :trace => @debug)
|
296
296
|
end
|
297
297
|
end
|
298
|
+
|
299
|
+
context :entities do
|
300
|
+
it "decodes" do
|
301
|
+
sampledoc = <<-EOF;
|
302
|
+
<?xml version="1.0"?>
|
303
|
+
<!DOCTYPE rdf:RDF [<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >]>
|
304
|
+
<rdf:RDF xmlns:rdf="&rdf;"
|
305
|
+
xmlns:ex="http://example.org/stuff/1.0/"
|
306
|
+
xml:base="http://example.org/triples/">
|
307
|
+
<rdf:Description rdf:about="http://example.org/">
|
308
|
+
<ex:prop rdf:ID="triple1">blah</ex:prop>
|
309
|
+
</rdf:Description>
|
310
|
+
</rdf:RDF>
|
311
|
+
EOF
|
312
|
+
|
313
|
+
triples = <<-EOF
|
314
|
+
<http://example.org/> <http://example.org/stuff/1.0/prop> \"blah\" .
|
315
|
+
<http://example.org/triples/#triple1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement> .
|
316
|
+
<http://example.org/triples/#triple1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://example.org/> .
|
317
|
+
<http://example.org/triples/#triple1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://example.org/stuff/1.0/prop> .
|
318
|
+
<http://example.org/triples/#triple1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> \"blah\" .
|
319
|
+
EOF
|
320
|
+
|
321
|
+
graph = parse(sampledoc, :base_uri => "http://example.com", :validate => true)
|
322
|
+
graph.should be_equivalent_graph(triples, :about => "http://example.com/", :trace => @debug)
|
323
|
+
end
|
324
|
+
|
325
|
+
it "processes OWL definition" do
|
326
|
+
@debug = []
|
327
|
+
graph = RDF::Graph.load("http://www.w3.org/2002/07/owl", :format => :rdfxml, :debug => @debug)
|
328
|
+
graph.count.should > 10
|
329
|
+
end
|
330
|
+
end
|
298
331
|
|
299
332
|
# W3C Test suite from http://www.w3.org/2000/10/rdf-tests/rdfcore/
|
300
333
|
describe "w3c rdfcore tests" do
|
metadata
CHANGED
@@ -1,119 +1,115 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-rdfxml
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.4
|
4
5
|
prerelease:
|
5
|
-
version: 0.3.3.1
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Gregg Kellogg
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-08-08 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: rdf
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &2157295280 !ruby/object:Gem::Requirement
|
20
17
|
none: false
|
21
|
-
requirements:
|
22
|
-
- -
|
23
|
-
- !ruby/object:Gem::Version
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
24
21
|
version: 0.3.3
|
25
22
|
type: :runtime
|
26
|
-
version_requirements: *id001
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: nokogiri
|
29
23
|
prerelease: false
|
30
|
-
|
24
|
+
version_requirements: *2157295280
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: nokogiri
|
27
|
+
requirement: &2157293720 !ruby/object:Gem::Requirement
|
31
28
|
none: false
|
32
|
-
requirements:
|
33
|
-
- -
|
34
|
-
- !ruby/object:Gem::Version
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
35
32
|
version: 1.4.4
|
36
33
|
type: :runtime
|
37
|
-
version_requirements: *id002
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: open-uri-cached
|
40
34
|
prerelease: false
|
41
|
-
|
35
|
+
version_requirements: *2157293720
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: open-uri-cached
|
38
|
+
requirement: &2157291780 !ruby/object:Gem::Requirement
|
42
39
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version:
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
47
44
|
type: :development
|
48
|
-
version_requirements: *id003
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: spira
|
51
45
|
prerelease: false
|
52
|
-
|
46
|
+
version_requirements: *2157291780
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: spira
|
49
|
+
requirement: &2157289840 !ruby/object:Gem::Requirement
|
53
50
|
none: false
|
54
|
-
requirements:
|
55
|
-
- -
|
56
|
-
- !ruby/object:Gem::Version
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
57
54
|
version: 0.0.12
|
58
55
|
type: :development
|
59
|
-
version_requirements: *id004
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: rspec
|
62
56
|
prerelease: false
|
63
|
-
|
57
|
+
version_requirements: *2157289840
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rspec
|
60
|
+
requirement: &2157275140 !ruby/object:Gem::Requirement
|
64
61
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
68
65
|
version: 2.5.0
|
69
66
|
type: :development
|
70
|
-
version_requirements: *id005
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: rdf-spec
|
73
67
|
prerelease: false
|
74
|
-
|
68
|
+
version_requirements: *2157275140
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rdf-spec
|
71
|
+
requirement: &2157273900 !ruby/object:Gem::Requirement
|
75
72
|
none: false
|
76
|
-
requirements:
|
77
|
-
- -
|
78
|
-
- !ruby/object:Gem::Version
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
79
76
|
version: 0.3.3
|
80
77
|
type: :development
|
81
|
-
version_requirements: *id006
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
name: rdf-isomorphic
|
84
78
|
prerelease: false
|
85
|
-
|
79
|
+
version_requirements: *2157273900
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rdf-isomorphic
|
82
|
+
requirement: &2157269860 !ruby/object:Gem::Requirement
|
86
83
|
none: false
|
87
|
-
requirements:
|
88
|
-
- -
|
89
|
-
- !ruby/object:Gem::Version
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
90
87
|
version: 0.3.4
|
91
88
|
type: :development
|
92
|
-
version_requirements: *id007
|
93
|
-
- !ruby/object:Gem::Dependency
|
94
|
-
name: yard
|
95
89
|
prerelease: false
|
96
|
-
|
90
|
+
version_requirements: *2157269860
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: yard
|
93
|
+
requirement: &2157268780 !ruby/object:Gem::Requirement
|
97
94
|
none: false
|
98
|
-
requirements:
|
99
|
-
- -
|
100
|
-
- !ruby/object:Gem::Version
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
101
98
|
version: 0.6.4
|
102
99
|
type: :development
|
103
|
-
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *2157268780
|
104
102
|
description: RDF::RDFXML is an RDF/XML reader and writer for the RDF.rb library suite.
|
105
103
|
email: gregg@kellogg-assoc.com
|
106
104
|
executables: []
|
107
|
-
|
108
105
|
extensions: []
|
109
|
-
|
110
|
-
extra_rdoc_files:
|
106
|
+
extra_rdoc_files:
|
111
107
|
- AUTHORS
|
112
108
|
- CONTRIBUTORS
|
113
109
|
- History.rdoc
|
114
110
|
- README.md
|
115
111
|
- UNLICENSE
|
116
|
-
files:
|
112
|
+
files:
|
117
113
|
- .yardopts
|
118
114
|
- AUTHORS
|
119
115
|
- CONTRIBUTORS
|
@@ -151,40 +147,28 @@ files:
|
|
151
147
|
- spec/spec.opts
|
152
148
|
- spec/spec_helper.rb
|
153
149
|
- spec/writer_spec.rb
|
154
|
-
has_rdoc: true
|
155
150
|
homepage: http://github.com/gkellogg/rdf-rdfxml
|
156
151
|
licenses: []
|
157
|
-
|
158
152
|
post_install_message:
|
159
153
|
rdoc_options: []
|
160
|
-
|
161
|
-
require_paths:
|
154
|
+
require_paths:
|
162
155
|
- lib
|
163
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
164
157
|
none: false
|
165
|
-
requirements:
|
166
|
-
- -
|
167
|
-
- !ruby/object:Gem::Version
|
168
|
-
version:
|
169
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ! '>='
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
163
|
none: false
|
171
|
-
requirements:
|
172
|
-
- -
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
version:
|
164
|
+
requirements:
|
165
|
+
- - ! '>='
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
175
168
|
requirements: []
|
176
|
-
|
177
169
|
rubyforge_project:
|
178
|
-
rubygems_version: 1.6
|
170
|
+
rubygems_version: 1.8.6
|
179
171
|
signing_key:
|
180
172
|
specification_version: 3
|
181
173
|
summary: RDF/XML reader/writer for RDF.rb.
|
182
|
-
test_files:
|
183
|
-
- spec/format_spec.rb
|
184
|
-
- spec/graph_spec.rb
|
185
|
-
- spec/literal_spec.rb
|
186
|
-
- spec/matchers.rb
|
187
|
-
- spec/rdf_test.rb
|
188
|
-
- spec/reader_spec.rb
|
189
|
-
- spec/spec_helper.rb
|
190
|
-
- spec/writer_spec.rb
|
174
|
+
test_files: []
|