rdf-rdfxml 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -1
- data/CONTRIBUTORS +1 -1
- data/History.markdown +4 -1
- data/README.markdown +5 -3
- data/VERSION +1 -1
- data/lib/rdf/rdfxml/format.rb +15 -0
- data/lib/rdf/rdfxml/patches/graph_properties.rb +6 -6
- data/lib/rdf/rdfxml/reader/nokogiri.rb +4 -10
- data/lib/rdf/rdfxml/reader/rexml.rb +2 -8
- data/lib/rdf/rdfxml/reader.rb +2 -1
- data/lib/rdf/rdfxml/writer.rb +1 -1
- metadata +87 -32
data/AUTHORS
CHANGED
@@ -1 +1 @@
|
|
1
|
-
* Gregg Kellogg <
|
1
|
+
* Gregg Kellogg <http://greggkellogg.net>
|
data/CONTRIBUTORS
CHANGED
@@ -1 +1 @@
|
|
1
|
-
* Nicholas Humfrey <
|
1
|
+
* Nicholas Humfrey <http://njh.me/>
|
data/History.markdown
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
### 0.3.9
|
2
|
+
* Allow discovery with format :rdf in addition to :rdfxml
|
3
|
+
|
1
4
|
### 0.3.8
|
2
|
-
* If rdf:RDF is found in a
|
5
|
+
* If rdf:RDF is found in a deeper element, look to ancestors for xml:base and xml:lang.
|
3
6
|
### 0.3.7
|
4
7
|
* Added :stylesheet option to RDF::RDFXML::Writer to allow writing of an XSL stylesheet processing instruction.
|
5
8
|
### 0.3.6
|
data/README.markdown
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# RDF::RDFXML reader/writer
|
1
|
+
# RDF::RDFXML reader/writer [![Build Status](https://secure.travis-ci.org/ruby-rdf/rdf-rdfxml.png?branch=master)](http://travis-ci.org/ruby-rdf/rdf-rdfxml)
|
2
2
|
|
3
3
|
[RDF/XML][RDF/XML] parser for [RDF.rb][RDF.rb].
|
4
4
|
|
@@ -25,6 +25,7 @@ Instantiate a parser and parse source, specifying type and base-URL
|
|
25
25
|
## Dependencies
|
26
26
|
* [RDF.rb](http://rubygems.org/gems/rdf) (>= 0.3.4)
|
27
27
|
* Soft dependency on [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.5.0)
|
28
|
+
* Does not run properly on jRuby due to [Nokogiri][] issues.
|
28
29
|
|
29
30
|
## Documentation
|
30
31
|
Full documentation available on [RubyForge](http://rubydoc.info/github/ruby-rdf/rdf-rdfxml/master/frames)
|
@@ -46,6 +47,7 @@ Full documentation available on [RubyForge](http://rubydoc.info/github/ruby-rdf/
|
|
46
47
|
## TODO
|
47
48
|
* Add support for LibXML and REXML bindings, and use the best available
|
48
49
|
* Consider a SAX-based parser for improved performance
|
50
|
+
* jRuby integration awaiting improvements in Nokogiri
|
49
51
|
|
50
52
|
## Resources
|
51
53
|
* [RDF.rb][RDF.rb]
|
@@ -56,10 +58,10 @@ Full documentation available on [RubyForge](http://rubydoc.info/github/ruby-rdf/
|
|
56
58
|
* [RDF Tests](http://www.w3.org/2000/10/rdf-tests/rdfcore/allTestCases.html)
|
57
59
|
|
58
60
|
## Author
|
59
|
-
* [Gregg Kellogg](http://github.com/gkellogg) - <http://
|
61
|
+
* [Gregg Kellogg](http://github.com/gkellogg) - <http://greggkellogg.net/>
|
60
62
|
|
61
63
|
## Contributors
|
62
|
-
* [Nicholas Humfrey](http://github.com/njh)
|
64
|
+
* [Nicholas Humfrey](http://github.com/njh) - <http://njh.me/>
|
63
65
|
|
64
66
|
## Contributing
|
65
67
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.9
|
data/lib/rdf/rdfxml/format.rb
CHANGED
@@ -39,4 +39,19 @@ module RDF::RDFXML
|
|
39
39
|
sample.match(/<(\w+:)?(RDF)/)
|
40
40
|
end
|
41
41
|
end
|
42
|
+
|
43
|
+
# Aliases for RDF::Format
|
44
|
+
#
|
45
|
+
# This allows the following:
|
46
|
+
#
|
47
|
+
# @example Obtaining an HTML format class
|
48
|
+
# RDF::Format.for(:rdf) # RDF::RDFXML::Lite
|
49
|
+
# RDF::Format.for(:rdf).reader # RDF::RDFXML::Reader
|
50
|
+
# RDF::Format.for(:rdf).writer # RDF::RDFXML::Writer
|
51
|
+
class RDFFormat < RDF::Format
|
52
|
+
reader { RDF::RDFXML::Reader }
|
53
|
+
writer { RDF::RDFXML::Writer }
|
54
|
+
|
55
|
+
def self.to_sym; :rdf; end
|
56
|
+
end
|
42
57
|
end
|
@@ -5,12 +5,12 @@ module RDF
|
|
5
5
|
# Properties arranged as a hash with the predicate Term as index to an array of resources or literals
|
6
6
|
#
|
7
7
|
# Example:
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
# graph.load(':foo a :bar; rdfs:label "An example" .', "http://example.com/")
|
9
|
+
# graph.resources(URI.new("http://example.com/subject")) =>
|
10
|
+
# {
|
11
|
+
# "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" => \[<http://example.com/#bar>\],
|
12
|
+
# "http://example.com/#label" => \["An example"\]
|
13
|
+
# }
|
14
14
|
def properties(subject, recalc = false)
|
15
15
|
@properties ||= {}
|
16
16
|
@properties.delete(subject.to_s) if recalc
|
@@ -26,12 +26,6 @@ module RDF::RDFXML
|
|
26
26
|
##
|
27
27
|
# Element language
|
28
28
|
#
|
29
|
-
# From HTML5 [3.2.3.3]
|
30
|
-
# If both the lang attribute in no namespace and the lang attribute in the XML namespace are set
|
31
|
-
# on an element, user agents must use the lang attribute in the XML namespace, and the lang
|
32
|
-
# attribute in no namespace must be ignored for the purposes of determining the element's
|
33
|
-
# language.
|
34
|
-
#
|
35
29
|
# @return [String]
|
36
30
|
def language
|
37
31
|
attribute_with_ns("lang", RDF::XML.to_s)
|
@@ -178,8 +172,8 @@ module RDF::RDFXML
|
|
178
172
|
##
|
179
173
|
# Return a proxy for each child
|
180
174
|
#
|
181
|
-
# @yield
|
182
|
-
# @yieldparam
|
175
|
+
# @yield child
|
176
|
+
# @yieldparam [NodeProxy]
|
183
177
|
def each
|
184
178
|
@node_set.each do |c|
|
185
179
|
yield NodeProxy.new(c, parent)
|
@@ -189,8 +183,8 @@ module RDF::RDFXML
|
|
189
183
|
##
|
190
184
|
# Return selected NodeProxies based on selection
|
191
185
|
#
|
192
|
-
# @yield
|
193
|
-
# @yieldparam
|
186
|
+
# @yield child
|
187
|
+
# @yieldparam [NodeProxy]
|
194
188
|
# @return [Array[NodeProxy]]
|
195
189
|
def select
|
196
190
|
@node_set.to_a.map {|n| NodeProxy.new(n, parent)}.select do |c|
|
@@ -26,12 +26,6 @@ module RDF::RDFXML
|
|
26
26
|
##
|
27
27
|
# Element language
|
28
28
|
#
|
29
|
-
# From HTML5 [3.2.3.3]
|
30
|
-
# If both the lang attribute in no namespace and the lang attribute in the XML namespace are set
|
31
|
-
# on an element, user agents must use the lang attribute in the XML namespace, and the lang
|
32
|
-
# attribute in no namespace must be ignored for the purposes of determining the element's
|
33
|
-
# language.
|
34
|
-
#
|
35
29
|
# @return [String]
|
36
30
|
def language
|
37
31
|
@node.attribute("lang", RDF::XML.to_s)
|
@@ -169,8 +163,8 @@ module RDF::RDFXML
|
|
169
163
|
##
|
170
164
|
# Return a proxy for each child
|
171
165
|
#
|
172
|
-
# @yield
|
173
|
-
# @yieldparam
|
166
|
+
# @yield child
|
167
|
+
# @yieldparam [NodeProxy]
|
174
168
|
def each
|
175
169
|
@node_set.each do |c|
|
176
170
|
yield NodeProxy.new(c, parent)
|
data/lib/rdf/rdfxml/reader.rb
CHANGED
@@ -19,7 +19,8 @@ module RDF::RDFXML
|
|
19
19
|
OLD_TERMS = %w(aboutEach aboutEachPrefix bagID).map {|n| "http://www.w3.org/1999/02/22-rdf-syntax-ns##{n}"}
|
20
20
|
|
21
21
|
# The Recursive Baggage
|
22
|
-
|
22
|
+
# @private
|
23
|
+
class EvaluationContext
|
23
24
|
attr_reader :base
|
24
25
|
attr :subject, true
|
25
26
|
attr :uri_mappings, true
|
data/lib/rdf/rdfxml/writer.rb
CHANGED
@@ -255,7 +255,7 @@ module RDF::RDFXML
|
|
255
255
|
def top_classes; []; end
|
256
256
|
|
257
257
|
# Defines order of predicates to to emit at begninning of a resource description. Defaults to
|
258
|
-
# [rdf:type, rdfs:label, dc:title]
|
258
|
+
# `\[rdf:type, rdfs:label, dc:title\]`
|
259
259
|
# @return [Array<URI>]
|
260
260
|
def predicate_order; [RDF.type, RDF::RDFS.label, RDF::DC.title]; end
|
261
261
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-rdfxml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,44 +10,59 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-11-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rdf
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.3.
|
22
|
+
version: 0.3.11
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 0.3.11
|
26
31
|
- !ruby/object:Gem::Dependency
|
27
32
|
name: rdf-xsd
|
28
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
29
34
|
none: false
|
30
35
|
requirements:
|
31
36
|
- - ! '>='
|
32
37
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.3.
|
38
|
+
version: 0.3.8
|
34
39
|
type: :runtime
|
35
40
|
prerelease: false
|
36
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.3.8
|
37
47
|
- !ruby/object:Gem::Dependency
|
38
48
|
name: nokogiri
|
39
|
-
requirement:
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
40
50
|
none: false
|
41
51
|
requirements:
|
42
52
|
- - ! '>='
|
43
53
|
- !ruby/object:Gem::Version
|
44
|
-
version: 1.5.
|
54
|
+
version: 1.5.5
|
45
55
|
type: :development
|
46
56
|
prerelease: false
|
47
|
-
version_requirements:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 1.5.5
|
48
63
|
- !ruby/object:Gem::Dependency
|
49
64
|
name: equivalent-xml
|
50
|
-
requirement:
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
51
66
|
none: false
|
52
67
|
requirements:
|
53
68
|
- - ! '>='
|
@@ -55,10 +70,15 @@ dependencies:
|
|
55
70
|
version: 0.2.8
|
56
71
|
type: :development
|
57
72
|
prerelease: false
|
58
|
-
version_requirements:
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 0.2.8
|
59
79
|
- !ruby/object:Gem::Dependency
|
60
80
|
name: open-uri-cached
|
61
|
-
requirement:
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
62
82
|
none: false
|
63
83
|
requirements:
|
64
84
|
- - ! '>='
|
@@ -66,10 +86,15 @@ dependencies:
|
|
66
86
|
version: 0.0.4
|
67
87
|
type: :development
|
68
88
|
prerelease: false
|
69
|
-
version_requirements:
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 0.0.4
|
70
95
|
- !ruby/object:Gem::Dependency
|
71
96
|
name: spira
|
72
|
-
requirement:
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
73
98
|
none: false
|
74
99
|
requirements:
|
75
100
|
- - ! '>='
|
@@ -77,21 +102,31 @@ dependencies:
|
|
77
102
|
version: 0.0.12
|
78
103
|
type: :development
|
79
104
|
prerelease: false
|
80
|
-
version_requirements:
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.0.12
|
81
111
|
- !ruby/object:Gem::Dependency
|
82
112
|
name: rspec
|
83
|
-
requirement:
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
84
114
|
none: false
|
85
115
|
requirements:
|
86
116
|
- - ! '>='
|
87
117
|
- !ruby/object:Gem::Version
|
88
|
-
version: 2.
|
118
|
+
version: 2.12.0
|
89
119
|
type: :development
|
90
120
|
prerelease: false
|
91
|
-
version_requirements:
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ! '>='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: 2.12.0
|
92
127
|
- !ruby/object:Gem::Dependency
|
93
128
|
name: rdf-isomorphic
|
94
|
-
requirement:
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
95
130
|
none: false
|
96
131
|
requirements:
|
97
132
|
- - ! '>='
|
@@ -99,40 +134,60 @@ dependencies:
|
|
99
134
|
version: 0.3.4
|
100
135
|
type: :development
|
101
136
|
prerelease: false
|
102
|
-
version_requirements:
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 0.3.4
|
103
143
|
- !ruby/object:Gem::Dependency
|
104
144
|
name: rdf-n3
|
105
|
-
requirement:
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
106
146
|
none: false
|
107
147
|
requirements:
|
108
148
|
- - ! '>='
|
109
149
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.3.
|
150
|
+
version: 0.3.7
|
111
151
|
type: :development
|
112
152
|
prerelease: false
|
113
|
-
version_requirements:
|
153
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: 0.3.7
|
114
159
|
- !ruby/object:Gem::Dependency
|
115
160
|
name: rdf-spec
|
116
|
-
requirement:
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
117
162
|
none: false
|
118
163
|
requirements:
|
119
164
|
- - ! '>='
|
120
165
|
- !ruby/object:Gem::Version
|
121
|
-
version: 0.3.
|
166
|
+
version: 0.3.11
|
122
167
|
type: :development
|
123
168
|
prerelease: false
|
124
|
-
version_requirements:
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
none: false
|
171
|
+
requirements:
|
172
|
+
- - ! '>='
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: 0.3.11
|
125
175
|
- !ruby/object:Gem::Dependency
|
126
176
|
name: yard
|
127
|
-
requirement:
|
177
|
+
requirement: !ruby/object:Gem::Requirement
|
128
178
|
none: false
|
129
179
|
requirements:
|
130
180
|
- - ! '>='
|
131
181
|
- !ruby/object:Gem::Version
|
132
|
-
version: 0.
|
182
|
+
version: 0.8.3
|
133
183
|
type: :development
|
134
184
|
prerelease: false
|
135
|
-
version_requirements:
|
185
|
+
version_requirements: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
187
|
+
requirements:
|
188
|
+
- - ! '>='
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: 0.8.3
|
136
191
|
description: RDF::RDFXML is an RDF/XML reader and writer for the RDF.rb library suite.
|
137
192
|
email: public-rdf-ruby@w3.org
|
138
193
|
executables: []
|
@@ -177,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
232
|
version: '0'
|
178
233
|
requirements: []
|
179
234
|
rubyforge_project: rdf-rdfxml
|
180
|
-
rubygems_version: 1.8.
|
235
|
+
rubygems_version: 1.8.24
|
181
236
|
signing_key:
|
182
237
|
specification_version: 3
|
183
238
|
summary: RDF/XML reader/writer for RDF.rb.
|