rdf-rdfa 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7c35772b1f7eef50854625886073f4f9be64a5c2
4
+ data.tar.gz: d7a977d1d2d7bd9a9214da5086e793d207ec0993
5
+ SHA512:
6
+ metadata.gz: 225fa0befb726050bb84c824932d1b84ba833900d87b7b35ca8575ed6e4d58cc2f35e15b1211bcb0e4343729aefc455398edc4943b10a9f01202f4ee9dd4bd69
7
+ data.tar.gz: ba139cbe2580ce9aed68be9cf851ec1e1956fe4568cb09aa1b2784e2f864cb77483259534d7890ea2fe1626f382b8cbf1029fd960f8fd42df8bd52352bb5a254
data/README CHANGED
@@ -15,12 +15,12 @@ RDF::RDFa parses [RDFa][RDFa 1.1 Core] into statements or triples.
15
15
  * Fully compliant RDFa 1.1 parser.
16
16
  * Template-based Writer to generate XHTML+RDFa.
17
17
  * Writer uses user-replacable [Haml][Haml]-based templates to generate RDFa.
18
- * If available, Uses Nokogiri for parsing HTML/SVG, falls back to REXML otherwise
18
+ * If available, uses Nokogiri for parsing HTML/SVG, falls back to REXML otherwise
19
19
 
20
- Install with 'gem install rdf-rdfa'
20
+ Install with `gem install rdf-rdfa`
21
21
 
22
22
  ### Pure Ruby
23
- In order to run as pure ruby (not requiring any C modules), this gem does not directly depend on [Nokogiri][]
23
+ In order to run as pure ruby (not requiring any C modules), this gem does not directly depend on [Nokogiri](http://www.nokogiri.org)
24
24
  and falls back to using REXML. As REXML is not really an HTML parsing library, the results will only be useful if the HTML is well-formed.
25
25
  For best performance, install the Nokogiri gem as well.
26
26
 
@@ -210,6 +210,7 @@ If the document includes a `<script>` element having an `@type` attribute
210
210
 
211
211
  generates the following Turtle:
212
212
 
213
+ ```
213
214
  @prefix foo: <http://www.example.com/xyz#> .
214
215
  @prefix gr: <http://purl.org/goodrelations/v1#> .
215
216
  @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@@ -219,6 +220,7 @@ generates the following Turtle:
219
220
  a gr:BusinessEntity ;
220
221
  rdfs:seeAlso <http://www.example.com/xyz> ;
221
222
  gr:hasLegalName "Hepp Industries Ltd."^^xsd:string .
223
+ ```
222
224
 
223
225
  ### Support for Role Attribute
224
226
  The processor will generate RDF triples consistent with the [Role Attr][] specification.
@@ -235,6 +237,8 @@ generates the following Turtle:
235
237
  ### Support for microdata
236
238
  The RDFa reader will call out to `RDF::Microdata::Reader`, if an `@itemscope` attribute is detected, and the microdata reader is loaded. This avoids a common problem when pages contain both microdata and RDFa, and only one processor is run.
237
239
 
240
+ ### Support for value property
241
+ In an [RDFA+HTML Errata](https://www.w3.org/2001/sw/wiki/RDFa_1.1._Errata#Using_.3Cdata.3E.2C_.3Cinput.3E_and_.3Cli.3E_along_with_.40value), it was suggested that the `@value` attribute could be parsed to obtain a numeric literal; this is consistent with how it's treated in microdata+rdfa. This processor now parses the value of an `@value` property to determine if it is an `xsd:integer`, `xsd:float`, or `xsd:double`, and uses a plain literal otherwise. The datatype can be overriden using the `@datatype` attribute.
238
242
  ## Usage
239
243
 
240
244
  ### Reading RDF data in the RDFa format
@@ -395,7 +399,7 @@ The template hash defines four Haml templates:
395
399
  * [Ruby](http://ruby-lang.org/) (>= 1.9.3)
396
400
  * [RDF.rb](http://rubygems.org/gems/rdf) (>= 1.1)
397
401
  * [Haml](https://rubygems.org/gems/haml) (>= 4.0)
398
- * [HTMLEntities](https://rubygems.org/gems/htmlentities) ('>= 4.3.1')
402
+ * [HTMLEntities](https://rubygems.org/gems/htmlentities) (>= 4.3.1)
399
403
  * Soft dependency on [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.6.1)
400
404
 
401
405
  ## Documentation
@@ -459,7 +463,7 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo
459
463
  ## License
460
464
 
461
465
  This is free and unencumbered public domain software. For more information,
462
- see <http://unlicense.org/> or the accompanying {file:UNLICENSE} file.
466
+ see <http://unlicense.org/> or the accompanying [UNLICENSE](UNLICENSE) file.
463
467
 
464
468
  ## FEEDBACK
465
469
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.5
1
+ 1.1.6
@@ -374,7 +374,7 @@ module RDF::RDFa
374
374
  when 'text/turtle' then require 'rdf/turtle'
375
375
  when 'application/ld+json' then require 'json/ld'
376
376
  end
377
- rescue
377
+ rescue LoadError
378
378
  end
379
379
 
380
380
  if reader = RDF::Reader.for(:content_type => type)
@@ -723,6 +723,7 @@ module RDF::RDFa
723
723
  role
724
724
  src
725
725
  typeof
726
+ value
726
727
  vocab
727
728
  ).each do |a|
728
729
  attrs[a.to_sym] = element.attributes[a].to_s.strip if element.attributes[a]
@@ -1102,7 +1103,7 @@ module RDF::RDFa
1102
1103
  when datatype && ![RDF.XMLLiteral, RDF.HTML].include?(datatype)
1103
1104
  # typed literal
1104
1105
  add_debug(element, "[Step 11] typed literal (#{datatype})")
1105
- RDF::Literal.new(attrs[:content] || attrs[:datetime] || element.inner_text.to_s, :datatype => datatype, :validate => validate?, :canonicalize => canonicalize?)
1106
+ RDF::Literal.new(attrs[:content] || attrs[:datetime] || attrs[:value] || element.inner_text.to_s, :datatype => datatype, :validate => validate?, :canonicalize => canonicalize?)
1106
1107
  when @version == :"rdfa1.1"
1107
1108
  case
1108
1109
  when datatype == RDF.XMLLiteral
@@ -1142,12 +1143,22 @@ module RDF::RDFa
1142
1143
  rescue ArgumentError => e
1143
1144
  add_error(element, e.message)
1144
1145
  end
1146
+ when attrs[:value]
1147
+ # Lexically scan value and assign appropriate type, otherwise, leave untyped
1148
+ # See https://www.w3.org/2001/sw/wiki/RDFa_1.1._Errata#Using_.3Cdata.3E.2C_.3Cinput.3E_and_.3Cli.3E_along_with_.40value
1149
+ add_debug(element, "[Step 11] value literal (#{attrs[:value]})")
1150
+ v = attrs[:value].to_s
1151
+ # Figure it out by parsing
1152
+ dt_lit = %w(Integer Float Double).map {|t| RDF::Literal.const_get(t)}.detect do |dt|
1153
+ v.match(dt::GRAMMAR)
1154
+ end || RDF::Literal
1155
+ dt_lit.new(v)
1145
1156
  when attrs[:datatype]
1146
1157
  # otherwise, as a plain literal if @datatype is present but has an empty value.
1147
1158
  # The actual literal is either the value of @content (if present) or a string created by
1148
1159
  # concatenating the value of all descendant text nodes, of the current element in turn.
1149
1160
  # typed literal
1150
- add_debug(element, "[Step 11] plain plain (#{datatype})")
1161
+ add_debug(element, "[Step 11] datatyped literal (#{datatype})")
1151
1162
  RDF::Literal.new(attrs[:content] || element.inner_text.to_s, :language => language, :validate => validate?, :canonicalize => canonicalize?)
1152
1163
  when attrs[:content]
1153
1164
  # plain literal
@@ -233,7 +233,7 @@ module RDF::RDFa
233
233
  }.merge(options)
234
234
  hamlify(template, options) do |subject|
235
235
  yield(subject) if block_given?
236
- end
236
+ end.gsub(/^\s+$/m, '')
237
237
  end
238
238
 
239
239
  # Render a subject using `haml_template[:subject]`.
@@ -18,7 +18,7 @@ module RDF::RDFa
18
18
  - if title
19
19
  %title= title
20
20
  %body
21
- - subjects.each do |subject|
21
+ - subjects.map do |subject|
22
22
  != yield(subject)
23
23
  ),
24
24
 
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-rdfa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
5
- prerelease:
4
+ version: 1.1.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Gregg
@@ -10,258 +9,228 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-11-11 00:00:00.000000000 Z
12
+ date: 2015-04-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rdf
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ~>
18
+ - - "~>"
21
19
  - !ruby/object:Gem::Version
22
20
  version: '1.1'
23
- - - ! '>='
21
+ - - ">="
24
22
  - !ruby/object:Gem::Version
25
23
  version: 1.1.6
26
24
  type: :runtime
27
25
  prerelease: false
28
26
  version_requirements: !ruby/object:Gem::Requirement
29
- none: false
30
27
  requirements:
31
- - - ~>
28
+ - - "~>"
32
29
  - !ruby/object:Gem::Version
33
30
  version: '1.1'
34
- - - ! '>='
31
+ - - ">="
35
32
  - !ruby/object:Gem::Version
36
33
  version: 1.1.6
37
34
  - !ruby/object:Gem::Dependency
38
35
  name: haml
39
36
  requirement: !ruby/object:Gem::Requirement
40
- none: false
41
37
  requirements:
42
- - - ~>
38
+ - - "~>"
43
39
  - !ruby/object:Gem::Version
44
40
  version: '4.0'
45
41
  type: :runtime
46
42
  prerelease: false
47
43
  version_requirements: !ruby/object:Gem::Requirement
48
- none: false
49
44
  requirements:
50
- - - ~>
45
+ - - "~>"
51
46
  - !ruby/object:Gem::Version
52
47
  version: '4.0'
53
48
  - !ruby/object:Gem::Dependency
54
49
  name: rdf-xsd
55
50
  requirement: !ruby/object:Gem::Requirement
56
- none: false
57
51
  requirements:
58
- - - ~>
52
+ - - "~>"
59
53
  - !ruby/object:Gem::Version
60
54
  version: '1.1'
61
55
  type: :runtime
62
56
  prerelease: false
63
57
  version_requirements: !ruby/object:Gem::Requirement
64
- none: false
65
58
  requirements:
66
- - - ~>
59
+ - - "~>"
67
60
  - !ruby/object:Gem::Version
68
61
  version: '1.1'
69
62
  - !ruby/object:Gem::Dependency
70
63
  name: rdf-aggregate-repo
71
64
  requirement: !ruby/object:Gem::Requirement
72
- none: false
73
65
  requirements:
74
- - - ! '>='
66
+ - - "~>"
75
67
  - !ruby/object:Gem::Version
76
- version: '0'
68
+ version: '1.1'
77
69
  type: :runtime
78
70
  prerelease: false
79
71
  version_requirements: !ruby/object:Gem::Requirement
80
- none: false
81
72
  requirements:
82
- - - ! '>='
73
+ - - "~>"
83
74
  - !ruby/object:Gem::Version
84
- version: '0'
75
+ version: '1.1'
85
76
  - !ruby/object:Gem::Dependency
86
77
  name: htmlentities
87
78
  requirement: !ruby/object:Gem::Requirement
88
- none: false
89
79
  requirements:
90
- - - ~>
80
+ - - "~>"
91
81
  - !ruby/object:Gem::Version
92
82
  version: '4.3'
93
83
  type: :runtime
94
84
  prerelease: false
95
85
  version_requirements: !ruby/object:Gem::Requirement
96
- none: false
97
86
  requirements:
98
- - - ~>
87
+ - - "~>"
99
88
  - !ruby/object:Gem::Version
100
89
  version: '4.3'
101
90
  - !ruby/object:Gem::Dependency
102
91
  name: open-uri-cached
103
92
  requirement: !ruby/object:Gem::Requirement
104
- none: false
105
93
  requirements:
106
- - - ~>
94
+ - - "~>"
107
95
  - !ruby/object:Gem::Version
108
96
  version: '0.0'
109
- - - ! '>='
97
+ - - ">="
110
98
  - !ruby/object:Gem::Version
111
99
  version: 0.0.5
112
100
  type: :development
113
101
  prerelease: false
114
102
  version_requirements: !ruby/object:Gem::Requirement
115
- none: false
116
103
  requirements:
117
- - - ~>
104
+ - - "~>"
118
105
  - !ruby/object:Gem::Version
119
106
  version: '0.0'
120
- - - ! '>='
107
+ - - ">="
121
108
  - !ruby/object:Gem::Version
122
109
  version: 0.0.5
123
110
  - !ruby/object:Gem::Dependency
124
111
  name: json-ld
125
112
  requirement: !ruby/object:Gem::Requirement
126
- none: false
127
113
  requirements:
128
- - - ~>
114
+ - - "~>"
129
115
  - !ruby/object:Gem::Version
130
116
  version: '1.1'
131
117
  type: :development
132
118
  prerelease: false
133
119
  version_requirements: !ruby/object:Gem::Requirement
134
- none: false
135
120
  requirements:
136
- - - ~>
121
+ - - "~>"
137
122
  - !ruby/object:Gem::Version
138
123
  version: '1.1'
139
124
  - !ruby/object:Gem::Dependency
140
125
  name: rspec
141
126
  requirement: !ruby/object:Gem::Requirement
142
- none: false
143
127
  requirements:
144
- - - ~>
128
+ - - "~>"
145
129
  - !ruby/object:Gem::Version
146
130
  version: '3.0'
147
131
  type: :development
148
132
  prerelease: false
149
133
  version_requirements: !ruby/object:Gem::Requirement
150
- none: false
151
134
  requirements:
152
- - - ~>
135
+ - - "~>"
153
136
  - !ruby/object:Gem::Version
154
137
  version: '3.0'
155
138
  - !ruby/object:Gem::Dependency
156
139
  name: rspec-its
157
140
  requirement: !ruby/object:Gem::Requirement
158
- none: false
159
141
  requirements:
160
- - - ~>
142
+ - - "~>"
161
143
  - !ruby/object:Gem::Version
162
144
  version: '1.0'
163
145
  type: :development
164
146
  prerelease: false
165
147
  version_requirements: !ruby/object:Gem::Requirement
166
- none: false
167
148
  requirements:
168
- - - ~>
149
+ - - "~>"
169
150
  - !ruby/object:Gem::Version
170
151
  version: '1.0'
171
152
  - !ruby/object:Gem::Dependency
172
153
  name: rdf-spec
173
154
  requirement: !ruby/object:Gem::Requirement
174
- none: false
175
155
  requirements:
176
- - - ~>
156
+ - - "~>"
177
157
  - !ruby/object:Gem::Version
178
158
  version: '1.1'
179
159
  type: :development
180
160
  prerelease: false
181
161
  version_requirements: !ruby/object:Gem::Requirement
182
- none: false
183
162
  requirements:
184
- - - ~>
163
+ - - "~>"
185
164
  - !ruby/object:Gem::Version
186
165
  version: '1.1'
187
166
  - !ruby/object:Gem::Dependency
188
167
  name: rdf-turtle
189
168
  requirement: !ruby/object:Gem::Requirement
190
- none: false
191
169
  requirements:
192
- - - ~>
170
+ - - "~>"
193
171
  - !ruby/object:Gem::Version
194
172
  version: '1.1'
195
173
  type: :development
196
174
  prerelease: false
197
175
  version_requirements: !ruby/object:Gem::Requirement
198
- none: false
199
176
  requirements:
200
- - - ~>
177
+ - - "~>"
201
178
  - !ruby/object:Gem::Version
202
179
  version: '1.1'
203
180
  - !ruby/object:Gem::Dependency
204
181
  name: rdf-rdfxml
205
182
  requirement: !ruby/object:Gem::Requirement
206
- none: false
207
183
  requirements:
208
- - - ~>
184
+ - - "~>"
209
185
  - !ruby/object:Gem::Version
210
186
  version: '1.1'
211
187
  type: :development
212
188
  prerelease: false
213
189
  version_requirements: !ruby/object:Gem::Requirement
214
- none: false
215
190
  requirements:
216
- - - ~>
191
+ - - "~>"
217
192
  - !ruby/object:Gem::Version
218
193
  version: '1.1'
219
194
  - !ruby/object:Gem::Dependency
220
195
  name: rdf-isomorphic
221
196
  requirement: !ruby/object:Gem::Requirement
222
- none: false
223
197
  requirements:
224
- - - ~>
198
+ - - "~>"
225
199
  - !ruby/object:Gem::Version
226
200
  version: '1.1'
227
201
  type: :development
228
202
  prerelease: false
229
203
  version_requirements: !ruby/object:Gem::Requirement
230
- none: false
231
204
  requirements:
232
- - - ~>
205
+ - - "~>"
233
206
  - !ruby/object:Gem::Version
234
207
  version: '1.1'
235
208
  - !ruby/object:Gem::Dependency
236
209
  name: sparql
237
210
  requirement: !ruby/object:Gem::Requirement
238
- none: false
239
211
  requirements:
240
- - - ~>
212
+ - - "~>"
241
213
  - !ruby/object:Gem::Version
242
214
  version: '1.1'
243
215
  type: :development
244
216
  prerelease: false
245
217
  version_requirements: !ruby/object:Gem::Requirement
246
- none: false
247
218
  requirements:
248
- - - ~>
219
+ - - "~>"
249
220
  - !ruby/object:Gem::Version
250
221
  version: '1.1'
251
222
  - !ruby/object:Gem::Dependency
252
223
  name: yard
253
224
  requirement: !ruby/object:Gem::Requirement
254
- none: false
255
225
  requirements:
256
- - - ~>
226
+ - - "~>"
257
227
  - !ruby/object:Gem::Version
258
228
  version: '0.8'
259
229
  type: :development
260
230
  prerelease: false
261
231
  version_requirements: !ruby/object:Gem::Requirement
262
- none: false
263
232
  requirements:
264
- - - ~>
233
+ - - "~>"
265
234
  - !ruby/object:Gem::Version
266
235
  version: '0.8'
267
236
  description: RDF::RDFa is an RDFa reader/writer for Ruby using the RDF.rb library
@@ -275,45 +244,44 @@ files:
275
244
  - README
276
245
  - UNLICENSE
277
246
  - VERSION
247
+ - lib/rdf/rdfa.rb
248
+ - lib/rdf/rdfa/context.rb
278
249
  - lib/rdf/rdfa/context/html.rb
279
250
  - lib/rdf/rdfa/context/xhtml.rb
280
251
  - lib/rdf/rdfa/context/xml.rb
281
- - lib/rdf/rdfa/context.rb
282
252
  - lib/rdf/rdfa/expansion.rb
283
253
  - lib/rdf/rdfa/format.rb
284
254
  - lib/rdf/rdfa/patches/string_hacks.rb
255
+ - lib/rdf/rdfa/reader.rb
285
256
  - lib/rdf/rdfa/reader/nokogiri.rb
286
257
  - lib/rdf/rdfa/reader/rexml.rb
287
- - lib/rdf/rdfa/reader.rb
288
258
  - lib/rdf/rdfa/version.rb
289
259
  - lib/rdf/rdfa/vocab.rb
290
- - lib/rdf/rdfa/writer/haml_templates.rb
291
260
  - lib/rdf/rdfa/writer.rb
292
- - lib/rdf/rdfa.rb
261
+ - lib/rdf/rdfa/writer/haml_templates.rb
293
262
  homepage: http://ruby-rdf.github.com/rdf-rdfa
294
263
  licenses:
295
264
  - Public Domain
265
+ metadata: {}
296
266
  post_install_message:
297
267
  rdoc_options: []
298
268
  require_paths:
299
269
  - lib
300
270
  required_ruby_version: !ruby/object:Gem::Requirement
301
- none: false
302
271
  requirements:
303
- - - ! '>='
272
+ - - ">="
304
273
  - !ruby/object:Gem::Version
305
274
  version: 1.9.3
306
275
  required_rubygems_version: !ruby/object:Gem::Requirement
307
- none: false
308
276
  requirements:
309
- - - ! '>='
277
+ - - ">="
310
278
  - !ruby/object:Gem::Version
311
279
  version: '0'
312
280
  requirements: []
313
281
  rubyforge_project: rdf-rdfa
314
- rubygems_version: 1.8.23.2
282
+ rubygems_version: 2.4.3
315
283
  signing_key:
316
- specification_version: 3
284
+ specification_version: 4
317
285
  summary: RDFa reader/writer for RDF.rb.
318
286
  test_files: []
319
287
  has_rdoc: false