rdf-rdfa 1.1.3 → 1.1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rdf/rdfa/reader.rb +69 -63
- metadata +60 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa94aaaa648d4da2e0dafb9f82d441e9b6e00066
|
4
|
+
data.tar.gz: 300cbc452eb89060eefa5d7b4f6d9dc853ecb166
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f07f7a03c8d54b0cee86fb63b2e03bcf6fd324067dc7b6dc8e124ce749cae998016acb9436ff8622cb38fcb98cbed748a4e786e8df25556a71fa4e1973b75dac
|
7
|
+
data.tar.gz: 990b662351c27483a21106c757b2638246e234986b14a8f63693f2479e8720d55c6a7e6b7e1536b66afa3bf753d6b31205f091ca739464638594d83e49afff64
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.3
|
1
|
+
1.1.3.1
|
data/lib/rdf/rdfa/reader.rb
CHANGED
@@ -354,85 +354,88 @@ module RDF::RDFa
|
|
354
354
|
# @yieldparam [RDF::Statement] statement
|
355
355
|
# @return [void]
|
356
356
|
def each_statement(&block)
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
prefix
|
361
|
-
|
362
|
-
|
363
|
-
# parse
|
364
|
-
parse_whole_document(@doc, RDF::URI(base_uri))
|
357
|
+
if block_given?
|
358
|
+
unless @processed || @root.nil?
|
359
|
+
# Add prefix definitions from host defaults
|
360
|
+
@host_defaults[:uri_mappings].each_pair do |prefix, value|
|
361
|
+
prefix(prefix, value)
|
362
|
+
end
|
365
363
|
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
364
|
+
# parse
|
365
|
+
parse_whole_document(@doc, RDF::URI(base_uri))
|
366
|
+
|
367
|
+
def extract_script(el, input, type, options, &block)
|
368
|
+
add_debug(el, "script element of type #{type}")
|
369
|
+
begin
|
370
|
+
# Formats don't exist unless they've been required
|
371
|
+
case type.to_s
|
372
|
+
when 'application/rdf+xml' then require 'rdf/rdfxml'
|
373
|
+
when 'text/ntriples' then require 'rdf/ntriples'
|
374
|
+
when 'text/turtle' then require 'rdf/turtle'
|
375
|
+
when 'application/ld+json' then require 'json/ld'
|
376
|
+
end
|
377
|
+
rescue
|
375
378
|
end
|
376
|
-
rescue
|
377
|
-
end
|
378
379
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
380
|
+
if reader = RDF::Reader.for(:content_type => type)
|
381
|
+
add_debug(el, "=> reader #{reader.to_sym}")
|
382
|
+
reader.new(input, options).each(&block)
|
383
|
+
else
|
384
|
+
add_debug(el, "=> no reader found")
|
385
|
+
end
|
384
386
|
end
|
385
|
-
end
|
386
387
|
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
388
|
+
# Look for Embedded Turtle and RDF/XML
|
389
|
+
unless @root.xpath("//rdf:RDF", "xmlns:rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#").empty?
|
390
|
+
extract_script(@root, @doc, "application/rdf+xml", @options) do |statement|
|
391
|
+
@repository << statement
|
392
|
+
end
|
391
393
|
end
|
392
|
-
end
|
393
394
|
|
394
|
-
|
395
|
-
|
396
|
-
|
395
|
+
# Look for Embedded scripts
|
396
|
+
@root.css("script[type]").each do |el|
|
397
|
+
type = el.attribute("type")
|
397
398
|
|
398
|
-
|
399
|
+
text = el.inner_html.sub(%r(\A\s*\<!\[CDATA\[)m, '').sub(%r(\]\]>\s*\Z)m, '')
|
399
400
|
|
400
|
-
|
401
|
-
|
401
|
+
extract_script(el, text, type, @options) do |statement|
|
402
|
+
@repository << statement
|
403
|
+
end
|
402
404
|
end
|
403
|
-
end
|
404
405
|
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
406
|
+
# Look for Embedded microdata
|
407
|
+
unless @root.xpath("//@itemscope").empty?
|
408
|
+
begin
|
409
|
+
require 'rdf/microdata'
|
410
|
+
add_debug(@doc, "process microdata")
|
411
|
+
@repository << RDF::Microdata::Reader.new(@doc, options)
|
412
|
+
rescue LoadError
|
413
|
+
add_debug(@doc, "microdata detected, not processed")
|
414
|
+
end
|
413
415
|
end
|
414
|
-
end
|
415
416
|
|
416
|
-
|
417
|
-
|
417
|
+
# Perform property copying
|
418
|
+
copy_properties(@repository) if @options[:reference_folding]
|
418
419
|
|
419
|
-
|
420
|
-
|
420
|
+
# Perform vocabulary expansion
|
421
|
+
expand(@repository) if @options[:vocab_expansion]
|
421
422
|
|
422
|
-
|
423
|
-
|
423
|
+
@processed = true
|
424
|
+
end
|
424
425
|
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
426
|
+
# Return statements in the default graph for
|
427
|
+
# statements in the associated named or default graph from the
|
428
|
+
# processed repository
|
429
|
+
@repository.each do |statement|
|
430
|
+
case statement.context
|
431
|
+
when nil
|
432
|
+
yield statement if @options[:rdfagraph].include?(:output)
|
433
|
+
when RDF::RDFA.ProcessorGraph
|
434
|
+
yield RDF::Statement.new(*statement.to_triple) if @options[:rdfagraph].include?(:processor)
|
435
|
+
end
|
434
436
|
end
|
435
437
|
end
|
438
|
+
enum_for(:each_statement)
|
436
439
|
end
|
437
440
|
|
438
441
|
##
|
@@ -444,9 +447,12 @@ module RDF::RDFa
|
|
444
447
|
# @yieldparam [RDF::Value] object
|
445
448
|
# @return [void]
|
446
449
|
def each_triple(&block)
|
447
|
-
|
448
|
-
|
450
|
+
if block_given?
|
451
|
+
each_statement do |statement|
|
452
|
+
block.call(*statement.to_triple)
|
453
|
+
end
|
449
454
|
end
|
455
|
+
enum_for(:each_triple)
|
450
456
|
end
|
451
457
|
|
452
458
|
private
|
metadata
CHANGED
@@ -1,89 +1,89 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-rdfa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.3
|
4
|
+
version: 1.1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg
|
8
8
|
- Kellogg
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdf
|
16
|
-
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '1.1'
|
21
|
-
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
21
|
+
requirement: !ruby/object:Gem::Requirement
|
24
22
|
requirements:
|
25
23
|
- - ~>
|
26
24
|
- !ruby/object:Gem::Version
|
27
25
|
version: '1.1'
|
26
|
+
prerelease: false
|
27
|
+
type: :runtime
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: haml
|
30
|
-
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - ~>
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '4.0'
|
35
|
-
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
38
36
|
requirements:
|
39
37
|
- - ~>
|
40
38
|
- !ruby/object:Gem::Version
|
41
39
|
version: '4.0'
|
40
|
+
prerelease: false
|
41
|
+
type: :runtime
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rdf-xsd
|
44
|
-
|
44
|
+
version_requirements: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - ~>
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '1.1'
|
49
|
-
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
52
50
|
requirements:
|
53
51
|
- - ~>
|
54
52
|
- !ruby/object:Gem::Version
|
55
53
|
version: '1.1'
|
54
|
+
prerelease: false
|
55
|
+
type: :runtime
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: htmlentities
|
58
|
-
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '4.3'
|
63
|
-
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
66
64
|
requirements:
|
67
65
|
- - ~>
|
68
66
|
- !ruby/object:Gem::Version
|
69
67
|
version: '4.3'
|
68
|
+
prerelease: false
|
69
|
+
type: :runtime
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: equivalent-xml
|
72
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0.4'
|
77
|
-
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
80
78
|
requirements:
|
81
79
|
- - ~>
|
82
80
|
- !ruby/object:Gem::Version
|
83
81
|
version: '0.4'
|
82
|
+
prerelease: false
|
83
|
+
type: :development
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: open-uri-cached
|
86
|
-
|
86
|
+
version_requirements: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - ~>
|
89
89
|
- !ruby/object:Gem::Version
|
@@ -91,9 +91,7 @@ dependencies:
|
|
91
91
|
- - '>='
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: 0.0.5
|
94
|
-
|
95
|
-
prerelease: false
|
96
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirement: !ruby/object:Gem::Requirement
|
97
95
|
requirements:
|
98
96
|
- - ~>
|
99
97
|
- !ruby/object:Gem::Version
|
@@ -101,120 +99,121 @@ dependencies:
|
|
101
99
|
- - '>='
|
102
100
|
- !ruby/object:Gem::Version
|
103
101
|
version: 0.0.5
|
102
|
+
prerelease: false
|
103
|
+
type: :development
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: json-ld
|
106
|
-
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '1.1'
|
111
|
-
|
112
|
-
prerelease: false
|
113
|
-
version_requirements: !ruby/object:Gem::Requirement
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
114
112
|
requirements:
|
115
113
|
- - ~>
|
116
114
|
- !ruby/object:Gem::Version
|
117
115
|
version: '1.1'
|
116
|
+
prerelease: false
|
117
|
+
type: :development
|
118
118
|
- !ruby/object:Gem::Dependency
|
119
119
|
name: rspec
|
120
|
-
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ~>
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '2.14'
|
125
|
-
|
126
|
-
prerelease: false
|
127
|
-
version_requirements: !ruby/object:Gem::Requirement
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
128
126
|
requirements:
|
129
127
|
- - ~>
|
130
128
|
- !ruby/object:Gem::Version
|
131
129
|
version: '2.14'
|
130
|
+
prerelease: false
|
131
|
+
type: :development
|
132
132
|
- !ruby/object:Gem::Dependency
|
133
133
|
name: rdf-spec
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ~>
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '1.1'
|
134
139
|
requirement: !ruby/object:Gem::Requirement
|
135
140
|
requirements:
|
136
141
|
- - ~>
|
137
142
|
- !ruby/object:Gem::Version
|
138
143
|
version: '1.1'
|
139
|
-
type: :development
|
140
144
|
prerelease: false
|
145
|
+
type: :development
|
146
|
+
- !ruby/object:Gem::Dependency
|
147
|
+
name: rdf-turtle
|
141
148
|
version_requirements: !ruby/object:Gem::Requirement
|
142
149
|
requirements:
|
143
150
|
- - ~>
|
144
151
|
- !ruby/object:Gem::Version
|
145
152
|
version: '1.1'
|
146
|
-
- !ruby/object:Gem::Dependency
|
147
|
-
name: rdf-turtle
|
148
153
|
requirement: !ruby/object:Gem::Requirement
|
149
154
|
requirements:
|
150
155
|
- - ~>
|
151
156
|
- !ruby/object:Gem::Version
|
152
157
|
version: '1.1'
|
153
|
-
type: :development
|
154
158
|
prerelease: false
|
159
|
+
type: :development
|
160
|
+
- !ruby/object:Gem::Dependency
|
161
|
+
name: rdf-rdfxml
|
155
162
|
version_requirements: !ruby/object:Gem::Requirement
|
156
163
|
requirements:
|
157
164
|
- - ~>
|
158
165
|
- !ruby/object:Gem::Version
|
159
166
|
version: '1.1'
|
160
|
-
- !ruby/object:Gem::Dependency
|
161
|
-
name: rdf-rdfxml
|
162
167
|
requirement: !ruby/object:Gem::Requirement
|
163
168
|
requirements:
|
164
169
|
- - ~>
|
165
170
|
- !ruby/object:Gem::Version
|
166
171
|
version: '1.1'
|
167
|
-
type: :development
|
168
172
|
prerelease: false
|
173
|
+
type: :development
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
name: rdf-isomorphic
|
169
176
|
version_requirements: !ruby/object:Gem::Requirement
|
170
177
|
requirements:
|
171
178
|
- - ~>
|
172
179
|
- !ruby/object:Gem::Version
|
173
180
|
version: '1.1'
|
174
|
-
- !ruby/object:Gem::Dependency
|
175
|
-
name: rdf-isomorphic
|
176
181
|
requirement: !ruby/object:Gem::Requirement
|
177
182
|
requirements:
|
178
183
|
- - ~>
|
179
184
|
- !ruby/object:Gem::Version
|
180
185
|
version: '1.1'
|
181
|
-
type: :development
|
182
186
|
prerelease: false
|
187
|
+
type: :development
|
188
|
+
- !ruby/object:Gem::Dependency
|
189
|
+
name: sparql
|
183
190
|
version_requirements: !ruby/object:Gem::Requirement
|
184
191
|
requirements:
|
185
192
|
- - ~>
|
186
193
|
- !ruby/object:Gem::Version
|
187
194
|
version: '1.1'
|
188
|
-
- !ruby/object:Gem::Dependency
|
189
|
-
name: sparql
|
190
195
|
requirement: !ruby/object:Gem::Requirement
|
191
196
|
requirements:
|
192
197
|
- - ~>
|
193
198
|
- !ruby/object:Gem::Version
|
194
199
|
version: '1.1'
|
195
|
-
type: :development
|
196
200
|
prerelease: false
|
197
|
-
|
198
|
-
requirements:
|
199
|
-
- - ~>
|
200
|
-
- !ruby/object:Gem::Version
|
201
|
-
version: '1.1'
|
201
|
+
type: :development
|
202
202
|
- !ruby/object:Gem::Dependency
|
203
203
|
name: yard
|
204
|
-
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - ~>
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0.8'
|
209
|
-
|
210
|
-
prerelease: false
|
211
|
-
version_requirements: !ruby/object:Gem::Requirement
|
209
|
+
requirement: !ruby/object:Gem::Requirement
|
212
210
|
requirements:
|
213
211
|
- - ~>
|
214
212
|
- !ruby/object:Gem::Version
|
215
213
|
version: '0.8'
|
216
|
-
|
217
|
-
|
214
|
+
prerelease: false
|
215
|
+
type: :development
|
216
|
+
description: RDF::RDFa is an RDFa reader/writer for Ruby using the RDF.rb library suite.
|
218
217
|
email: public-rdf-ruby@w3.org
|
219
218
|
executables: []
|
220
219
|
extensions: []
|
@@ -253,7 +252,7 @@ homepage: http://ruby-rdf.github.com/rdf-rdfa
|
|
253
252
|
licenses:
|
254
253
|
- Public Domain
|
255
254
|
metadata: {}
|
256
|
-
post_install_message:
|
255
|
+
post_install_message:
|
257
256
|
rdoc_options: []
|
258
257
|
require_paths:
|
259
258
|
- lib
|
@@ -270,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
270
269
|
requirements: []
|
271
270
|
rubyforge_project: rdf-rdfa
|
272
271
|
rubygems_version: 2.2.2
|
273
|
-
signing_key:
|
272
|
+
signing_key:
|
274
273
|
specification_version: 4
|
275
274
|
summary: RDFa reader/writer for RDF.rb.
|
276
275
|
test_files: []
|