rdf-rdfa 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHORS +1 -1
- data/README.md +36 -47
- data/UNLICENSE +1 -1
- data/VERSION +1 -1
- data/lib/rdf/rdfa.rb +6 -6
- data/lib/rdf/rdfa/context/xml.rb +1 -0
- data/lib/rdf/rdfa/expansion.rb +2 -2
- data/lib/rdf/rdfa/format.rb +1 -1
- data/lib/rdf/rdfa/reader.rb +11 -11
- data/lib/rdf/rdfa/reader/nokogiri.rb +1 -1
- data/lib/rdf/rdfa/reader/rexml.rb +3 -3
- data/lib/rdf/rdfa/vocab.rb +147 -123
- data/lib/rdf/rdfa/writer.rb +2 -2
- data/lib/rdf/rdfa/writer/haml_templates.rb +3 -3
- metadata +30 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acc8cc471fcfff41c88fef920eac24dadad4f5350dbba25665e620e3fd654c15
|
4
|
+
data.tar.gz: 9a3810a7064b3258c482371211642b9d5c68cc93285b5dad424418824c06a332
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5276d622c61455b89f92b3359b514dafb005819e987ea8743ee570d0c458514e3a20983c894b05a87af733c136a5b0e97485d84a15fa609f0c347e7fc4af3726
|
7
|
+
data.tar.gz: 8cbebb3e5bb8c5f28661863ae5f4afca98dceb46594f37fa247e1c9f2f659c23ba7db06defba2c7bd9c98b26e50ad2c7205c6cb217df21b97baf66ed1fdda9b6
|
data/AUTHORS
CHANGED
@@ -1 +1 @@
|
|
1
|
-
* Gregg Kellogg <gregg@
|
1
|
+
* Gregg Kellogg <gregg@greggkellogg.net>
|
data/README.md
CHANGED
@@ -3,8 +3,8 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo
|
|
3
3
|
|
4
4
|
[RDFa][RDFa 1.1 Core] parser for RDF.rb.
|
5
5
|
|
6
|
-
[](
|
7
|
-
[](
|
6
|
+
[](https://badge.fury.io/rb/rdf-rdfa)
|
7
|
+
[](https://travis-ci.org/ruby-rdf/rdf-rdfa)
|
8
8
|
[](https://coveralls.io/r/ruby-rdf/rdf-rdfa)
|
9
9
|
|
10
10
|
## DESCRIPTION
|
@@ -15,7 +15,7 @@ RDF::RDFa parses [RDFa][RDFa 1.1 Core] into statements or triples.
|
|
15
15
|
|
16
16
|
* Fully compliant RDFa 1.1 parser.
|
17
17
|
* Template-based Writer to generate XHTML+RDFa.
|
18
|
-
* Writer uses user-
|
18
|
+
* Writer uses user-replaceable [Haml][Haml] -based templates to generate RDFa.
|
19
19
|
* If available, uses [Nokogiri][] for parsing HTML/SVG, falls back to REXML otherwise. For HTML5, include the [Nokogumbo][] gem for a pure-HTML5 parser with better error detection.
|
20
20
|
|
21
21
|
Install with `gem install rdf-rdfa`
|
@@ -37,7 +37,7 @@ This version fully supports the limited syntax of [RDFa Lite 1.1][]. This includ
|
|
37
37
|
One of the issues with vocabularies was that they discourage re-use of existing vocabularies when terms from several vocabularies are used at the same time. As it is common (encouraged) for RDF vocabularies to form sub-class and/or sub-property relationships with well defined vocabularies, the RDFa vocabulary expansion mechanism takes advantage of this.
|
38
38
|
|
39
39
|
As an optional part of RDFa processing, an RDFa processor will perform limited
|
40
|
-
[OWL 2 RL Profile entailment](
|
40
|
+
[OWL 2 RL Profile entailment](https://www.w3.org/TR/2009/REC-owl2-profiles-20091027/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules),
|
41
41
|
specifically rules prp-eqp1, prp-eqp2, cax-sco, cax-eqc1, and
|
42
42
|
cax-eqc2. This causes sub-classes and sub-properties of type and property IRIs to be added
|
43
43
|
to the output graph.
|
@@ -123,24 +123,24 @@ The @typeof attribute has changed; previously, it always created a new subject,
|
|
123
123
|
|
124
124
|
For example:
|
125
125
|
|
126
|
-
<div typeof="foaf:Person" about="
|
126
|
+
<div typeof="foaf:Person" about="https://greggkellogg.net/foaf#me">
|
127
127
|
<p property="name">Gregg Kellogg</span>
|
128
|
-
<a rel="knows" typeof="foaf:Person" href="
|
128
|
+
<a rel="knows" typeof="foaf:Person" href="https://manu.sporny.org/#this">
|
129
129
|
<span property="name">Manu Sporny</span>
|
130
130
|
</a>
|
131
131
|
</div>
|
132
132
|
|
133
133
|
results in
|
134
134
|
|
135
|
-
<
|
135
|
+
<https://greggkellogg.net/foaf#me> a foaf:Person;
|
136
136
|
foaf:name "Gregg Kellogg";
|
137
|
-
foaf:knows <
|
138
|
-
<
|
137
|
+
foaf:knows <https://manu.sporny.org/#this> .
|
138
|
+
<https://manu.sporny.org/#this> a foaf:Person;
|
139
139
|
foaf:name "Manu Sporny" .
|
140
140
|
|
141
141
|
Note that if the explicit @href is not present, i.e.,
|
142
142
|
|
143
|
-
<div typeof="foaf:Person" about="
|
143
|
+
<div typeof="foaf:Person" about="https://greggkellogg.net/foaf#me">
|
144
144
|
<p property="name">Gregg Kellogg</span>
|
145
145
|
<a href="knows" typeof="foaf:Person">
|
146
146
|
<span property="name">Manu Sporny</span>
|
@@ -149,7 +149,7 @@ Note that if the explicit @href is not present, i.e.,
|
|
149
149
|
|
150
150
|
this results in
|
151
151
|
|
152
|
-
<
|
152
|
+
<https://greggkellogg.net/foaf#me> a foaf:Person;
|
153
153
|
foaf:name "Gregg Kellogg";
|
154
154
|
foaf:knows [
|
155
155
|
a foaf:Person;
|
@@ -397,11 +397,11 @@ The template hash defines four Haml templates:
|
|
397
397
|
}
|
398
398
|
|
399
399
|
## Dependencies
|
400
|
-
* [Ruby](
|
401
|
-
* [RDF.rb](
|
400
|
+
* [Ruby](https://ruby-lang.org/) (>= 2.4)
|
401
|
+
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.1)
|
402
402
|
* [Haml](https://rubygems.org/gems/haml) (~> 5.1)
|
403
403
|
* [HTMLEntities](https://rubygems.org/gems/htmlentities) (>= 4.3)
|
404
|
-
* Soft dependency on [Nokogiri](
|
404
|
+
* Soft dependency on [Nokogiri](https://rubygems.org/gems/nokogiri) (>= 1.10)
|
405
405
|
* Soft dependency on [Nokogumbo](https://github.com/rubys/nokogumbo) (>= 2.0)
|
406
406
|
|
407
407
|
## Documentation
|
@@ -409,12 +409,6 @@ Full documentation available on [Rubydoc.info][RDFa doc]
|
|
409
409
|
|
410
410
|
### Principle Classes
|
411
411
|
* {RDF::RDFa::Format}
|
412
|
-
* {RDF::RDFa::HTML}
|
413
|
-
Asserts :html format, text/html mime-type and .html file extension.
|
414
|
-
* {RDF::RDFa::XHTML}
|
415
|
-
Asserts :html format, application/xhtml+xml mime-type and .xhtml file extension.
|
416
|
-
* {RDF::RDFa::SVG}
|
417
|
-
Asserts :svg format, image/svg+xml mime-type and .svg file extension.
|
418
412
|
* {RDF::RDFa::Reader}
|
419
413
|
* {RDF::RDFa::Reader::Nokogiri}
|
420
414
|
* {RDF::RDFa::Reader::REXML}
|
@@ -422,11 +416,6 @@ Full documentation available on [Rubydoc.info][RDFa doc]
|
|
422
416
|
* {RDF::RDFa::Expansion}
|
423
417
|
* {RDF::RDFa::Writer}
|
424
418
|
|
425
|
-
### Additional vocabularies
|
426
|
-
* {RDF::RDFA}
|
427
|
-
* {RDF::XML}
|
428
|
-
* {RDF::XSI}
|
429
|
-
|
430
419
|
## TODO
|
431
420
|
* Add support for LibXML and REXML bindings, and use the best available
|
432
421
|
* Consider a SAX-based parser for improved performance
|
@@ -438,13 +427,13 @@ Full documentation available on [Rubydoc.info][RDFa doc]
|
|
438
427
|
* [History](file:History.md)
|
439
428
|
* [RDFa 1.1 Core][RDFa 1.1 Core]
|
440
429
|
* [XHTML+RDFa 1.1][XHTML+RDFa 1.1]
|
441
|
-
* [RDFa-test-suite](
|
430
|
+
* [RDFa-test-suite](https://rdfa.info/test-suite/ "RDFa test suite")
|
442
431
|
|
443
432
|
## Author
|
444
|
-
* [Gregg Kellogg](
|
433
|
+
* [Gregg Kellogg](https://github.com/gkellogg) - <https://greggkellogg.net/>
|
445
434
|
|
446
435
|
## Contributors
|
447
|
-
* [Nicholas Humfrey](
|
436
|
+
* [Nicholas Humfrey](https://github.com/njh) - <https://njh.me/>
|
448
437
|
|
449
438
|
## Contributing
|
450
439
|
This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange development and release activity. All submissions _must_ be on a feature branch based on the _develop_ branch to ease staging and integration.
|
@@ -464,27 +453,27 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo
|
|
464
453
|
## License
|
465
454
|
|
466
455
|
This is free and unencumbered public domain software. For more information,
|
467
|
-
see <
|
456
|
+
see <https://unlicense.org/> or the accompanying [UNLICENSE](UNLICENSE) file.
|
468
457
|
|
469
458
|
## FEEDBACK
|
470
459
|
|
471
460
|
* gregg@greggkellogg.net
|
472
|
-
* <
|
473
|
-
* <
|
474
|
-
* <
|
475
|
-
|
476
|
-
[RDF.rb]:
|
477
|
-
[YARD]:
|
478
|
-
[YARD-GS]:
|
479
|
-
[PDD]:
|
480
|
-
[RDFa 1.1 Core]:
|
481
|
-
[RDFa Lite 1.1]:
|
482
|
-
[XHTML+RDFa 1.1]:
|
483
|
-
[HTML+RDFa 1.1]:
|
484
|
-
[RDFa-test-suite]:
|
485
|
-
[Role Attr]:
|
486
|
-
[RDFa doc]:
|
487
|
-
[Haml]:
|
488
|
-
[Turtle]:
|
489
|
-
[Nokogiri]:
|
461
|
+
* <https://rubygems.org/rdf-rdfa>
|
462
|
+
* <https://github.com/ruby-rdf/rdf-rdfa>
|
463
|
+
* <https://lists.w3.org/Archives/Public/public-rdf-ruby/>
|
464
|
+
|
465
|
+
[RDF.rb]: https://rubygems.org/gems/rdf
|
466
|
+
[YARD]: https://yardoc.org/
|
467
|
+
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
|
468
|
+
[PDD]: https://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
|
469
|
+
[RDFa 1.1 Core]: https://www.w3.org/TR/2012/REC-rdfa-core-20120607/ "RDFa 1.1 Core"
|
470
|
+
[RDFa Lite 1.1]: https://www.w3.org/TR/2012/REC-rdfa-lite-20120607/ "RDFa Lite 1.1"
|
471
|
+
[XHTML+RDFa 1.1]: https://www.w3.org/TR/2012/REC-xhtml-rdfa-20120607/ "XHTML+RDFa 1.1"
|
472
|
+
[HTML+RDFa 1.1]: https://www.w3.org/TR/rdfa-in-html/ "HTML+RDFa 1.1"
|
473
|
+
[RDFa-test-suite]: https://rdfa.info/test-suite/ "RDFa test suite"
|
474
|
+
[Role Attr]: https://www.w3.org/TR/role-attribute/ "Role Attribute"
|
475
|
+
[RDFa doc]: https://rubydoc.info/github/ruby-rdf/rdf-rdfa/frames
|
476
|
+
[Haml]: https://haml-lang.com/
|
477
|
+
[Turtle]: https://www.w3.org/TR/2011/WD-turtle-20110809/
|
478
|
+
[Nokogiri]: https://www.nokogiri.org
|
490
479
|
[Nokogumbo]: https://github.com/rubys/nokogumbo/#readme
|
data/UNLICENSE
CHANGED
@@ -21,4 +21,4 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
21
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
22
|
OTHER DEALINGS IN THE SOFTWARE.
|
23
23
|
|
24
|
-
For more information, please refer to <
|
24
|
+
For more information, please refer to <https://unlicense.org/>
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.1
|
data/lib/rdf/rdfa.rb
CHANGED
@@ -15,13 +15,13 @@ module RDF
|
|
15
15
|
# end
|
16
16
|
# end
|
17
17
|
#
|
18
|
-
# @see
|
19
|
-
# @see
|
20
|
-
# @see
|
21
|
-
# @see
|
22
|
-
# @see
|
18
|
+
# @see https://rubygems.org/gems/rdf
|
19
|
+
# @see https://www.w3.org/TR/rdfa-syntax/#s_model RDFa 1.0
|
20
|
+
# @see https://www.w3.org/TR/2012/REC-rdfa-core-20120607/
|
21
|
+
# @see https://www.w3.org/TR/2012/CR-xhtml-rdfa-20120313/
|
22
|
+
# @see https://dev.w3.org/html5/rdfa/
|
23
23
|
#
|
24
|
-
# @author [Gregg Kellogg](
|
24
|
+
# @author [Gregg Kellogg](https://greggkellogg.net/)
|
25
25
|
module RDFa
|
26
26
|
require 'rdf/rdfa/format'
|
27
27
|
require 'rdf/rdfa/vocab'
|
data/lib/rdf/rdfa/context/xml.rb
CHANGED
@@ -20,6 +20,7 @@ class RDF::RDFa::Context
|
|
20
20
|
gr: "http://purl.org/goodrelations/v1#",
|
21
21
|
grddl: "http://www.w3.org/2003/g/data-view#",
|
22
22
|
ical: "http://www.w3.org/2002/12/cal/icaltzd#",
|
23
|
+
jsonld: "http://www.w3.org/ns/json-ld#",
|
23
24
|
ldp: "http://www.w3.org/ns/ldp#",
|
24
25
|
ma: "http://www.w3.org/ns/ma-ont#",
|
25
26
|
oa: "http://www.w3.org/ns/oa#",
|
data/lib/rdf/rdfa/expansion.rb
CHANGED
@@ -12,7 +12,7 @@ module RDF::RDFa
|
|
12
12
|
# Vocabulary expansion uses the built-in reasoner using included vocabularies from RDF.rb.
|
13
13
|
#
|
14
14
|
# @param [RDF::Repository] repository
|
15
|
-
# @see [OWL2 PROFILES](
|
15
|
+
# @see [OWL2 PROFILES](https://www.w3.org/TR/2009/REC-owl2-profiles-20091027/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules)
|
16
16
|
def expand(repository)
|
17
17
|
add_debug("expand") {"Repository has #{repository.count} statements"}
|
18
18
|
|
@@ -45,7 +45,7 @@ module RDF::RDFa
|
|
45
45
|
# Subsequently, remove reference rdfa:Pattern objects.
|
46
46
|
#
|
47
47
|
# @param [RDF::Repository] repository
|
48
|
-
# @see [HTML+RDFa](
|
48
|
+
# @see [HTML+RDFa](https://www.w3.org/TR/rdfa-in-html/#rdfa-reference-folding)
|
49
49
|
def copy_properties(repository)
|
50
50
|
add_debug("expand") {"Repository has #{repository.size} statements"}
|
51
51
|
fold(repository)
|
data/lib/rdf/rdfa/format.rb
CHANGED
@@ -16,7 +16,7 @@ module RDF::RDFa
|
|
16
16
|
# @example Obtaining serialization format file extension mappings
|
17
17
|
# RDF::Format.file_extensions #=> {xhtml: "application/xhtml+xml"}
|
18
18
|
#
|
19
|
-
# @see
|
19
|
+
# @see https://www.w3.org/TR/rdf-testcases/#ntriples
|
20
20
|
class Format < RDF::Format
|
21
21
|
content_encoding 'utf-8'
|
22
22
|
content_type 'text/html;q=0.5',
|
data/lib/rdf/rdfa/reader.rb
CHANGED
@@ -16,15 +16,15 @@ module RDF::RDFa
|
|
16
16
|
# can explicitly override the used implementation by passing in a
|
17
17
|
# `:library` option to `Reader.new` or `Reader.open`.
|
18
18
|
#
|
19
|
-
# [Nokogiri]:
|
19
|
+
# [Nokogiri]: https://nokogiri.org/
|
20
20
|
#
|
21
21
|
# Based on processing rules described here:
|
22
|
-
# @see
|
23
|
-
# @see
|
24
|
-
# @see
|
25
|
-
# @see
|
22
|
+
# @see https://www.w3.org/TR/rdfa-syntax/#s_model RDFa 1.0
|
23
|
+
# @see https://www.w3.org/TR/2012/REC-rdfa-core-20120607/
|
24
|
+
# @see https://www.w3.org/TR/2012/CR-xhtml-rdfa-20120313/
|
25
|
+
# @see https://dev.w3.org/html5/rdfa/
|
26
26
|
#
|
27
|
-
# @author [Gregg Kellogg](
|
27
|
+
# @author [Gregg Kellogg](https://greggkellogg.net/)
|
28
28
|
class Reader < RDF::Reader
|
29
29
|
format Format
|
30
30
|
include Expansion
|
@@ -46,9 +46,9 @@ module RDF::RDFa
|
|
46
46
|
}
|
47
47
|
|
48
48
|
# This expression matches an NCName as defined in
|
49
|
-
# [XML-NAMES](
|
49
|
+
# [XML-NAMES](https://www.w3.org/TR/2009/REC-xml-names-20091208/#NT-NCName)
|
50
50
|
#
|
51
|
-
# @see
|
51
|
+
# @see https://www.w3.org/TR/2009/REC-xml-names-20091208/#NT-NCName
|
52
52
|
NC_REGEXP = Regexp.new(
|
53
53
|
%{^
|
54
54
|
( [a-zA-Z_]
|
@@ -61,11 +61,11 @@ module RDF::RDFa
|
|
61
61
|
Regexp::EXTENDED)
|
62
62
|
|
63
63
|
# This expression matches an term as defined in
|
64
|
-
# [RDFA-CORE](
|
64
|
+
# [RDFA-CORE](https://www.w3.org/TR/2012/REC-rdfa-core-20120607/#s_terms)
|
65
65
|
#
|
66
66
|
# For the avoidance of doubt, this definition means a 'term'
|
67
67
|
# in RDFa is an XML NCName that also permits slash as a non-leading character.
|
68
|
-
# @see
|
68
|
+
# @see https://www.w3.org/TR/2012/REC-rdfa-core-20120607/#s_terms
|
69
69
|
TERM_REGEXP = Regexp.new(
|
70
70
|
%{^
|
71
71
|
(?!\\\\u0301) # ́ is a non-spacing acute accent.
|
@@ -245,7 +245,7 @@ module RDF::RDFa
|
|
245
245
|
|
246
246
|
##
|
247
247
|
# RDFa Reader options
|
248
|
-
# @see
|
248
|
+
# @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Reader#options-class_method
|
249
249
|
def self.options
|
250
250
|
super + [
|
251
251
|
RDF::CLI::Option.new(
|
@@ -5,7 +5,7 @@ module RDF::RDFa
|
|
5
5
|
##
|
6
6
|
# REXML implementation of an XML parser.
|
7
7
|
#
|
8
|
-
# @see
|
8
|
+
# @see https://www.germane-software.com/software/rexml/
|
9
9
|
module REXML
|
10
10
|
##
|
11
11
|
# Returns the name of the underlying XML library.
|
@@ -104,7 +104,7 @@ module RDF::RDFa
|
|
104
104
|
##
|
105
105
|
# Inner text of an element
|
106
106
|
#
|
107
|
-
# @see
|
107
|
+
# @see https://apidock.com/ruby/REXML/Element/get_text#743-Get-all-inner-texts
|
108
108
|
# @return [String]
|
109
109
|
def inner_text
|
110
110
|
coder = HTMLEntities.new
|
@@ -116,7 +116,7 @@ module RDF::RDFa
|
|
116
116
|
##
|
117
117
|
# Inner text of an element
|
118
118
|
#
|
119
|
-
# @see
|
119
|
+
# @see https://apidock.com/ruby/REXML/Element/get_text#743-Get-all-inner-texts
|
120
120
|
# @return [String]
|
121
121
|
def inner_html
|
122
122
|
@node.children.map(&:to_s).join
|
data/lib/rdf/rdfa/vocab.rb
CHANGED
@@ -1,137 +1,161 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
3
|
+
# This file generated automatically using rdf vocabulary format from http://www.w3.org/ns/rdfa#
|
4
|
+
require 'rdf'
|
2
5
|
module RDF
|
3
|
-
|
6
|
+
# @!parse
|
7
|
+
# # Vocabulary for <http://www.w3.org/ns/rdfa#>
|
8
|
+
# #
|
9
|
+
# # RDFa Vocabulary for Term and Prefix Assignment, and for Processor Graph Reporting
|
10
|
+
# #
|
11
|
+
# # This document describes the RDFa Vocabulary for Term and Prefix Assignment. The Vocabulary is used to modify RDFa 1.1 processing behavior.
|
12
|
+
# # @version $Date: 2013-03-11 07:54:23 $
|
13
|
+
# class RDFA < RDF::Vocabulary
|
14
|
+
# # @return [RDF::Vocabulary::Term]
|
15
|
+
# attr_reader :PGClass
|
16
|
+
#
|
17
|
+
# # @return [RDF::Vocabulary::Term]
|
18
|
+
# attr_reader :Pattern
|
19
|
+
#
|
20
|
+
# # @return [RDF::Vocabulary::Term]
|
21
|
+
# attr_reader :PrefixOrTermMapping
|
22
|
+
#
|
23
|
+
# # @return [RDF::Vocabulary::Term]
|
24
|
+
# attr_reader :context
|
25
|
+
#
|
26
|
+
# # @return [RDF::Vocabulary::Term]
|
27
|
+
# attr_reader :copy
|
28
|
+
#
|
29
|
+
# # @return [RDF::Vocabulary::Term]
|
30
|
+
# attr_reader :prefix
|
31
|
+
#
|
32
|
+
# # @return [RDF::Vocabulary::Term]
|
33
|
+
# attr_reader :term
|
34
|
+
#
|
35
|
+
# # @return [RDF::Vocabulary::Term]
|
36
|
+
# attr_reader :uri
|
37
|
+
#
|
38
|
+
# # @return [RDF::Vocabulary::Term]
|
39
|
+
# attr_reader :usesVocabulary
|
40
|
+
#
|
41
|
+
# # @return [RDF::Vocabulary::Term]
|
42
|
+
# attr_reader :vocabulary
|
43
|
+
#
|
44
|
+
# # @return [RDF::Vocabulary::Term]
|
45
|
+
# attr_reader :DocumentError
|
46
|
+
#
|
47
|
+
# # @return [RDF::Vocabulary::Term]
|
48
|
+
# attr_reader :Error
|
49
|
+
#
|
50
|
+
# # @return [RDF::Vocabulary::Term]
|
51
|
+
# attr_reader :Info
|
52
|
+
#
|
53
|
+
# # @return [RDF::Vocabulary::Term]
|
54
|
+
# attr_reader :PrefixMapping
|
55
|
+
#
|
56
|
+
# # @return [RDF::Vocabulary::Term]
|
57
|
+
# attr_reader :PrefixRedefinition
|
58
|
+
#
|
59
|
+
# # @return [RDF::Vocabulary::Term]
|
60
|
+
# attr_reader :TermMapping
|
61
|
+
#
|
62
|
+
# # @return [RDF::Vocabulary::Term]
|
63
|
+
# attr_reader :UnresolvedCURIE
|
64
|
+
#
|
65
|
+
# # @return [RDF::Vocabulary::Term]
|
66
|
+
# attr_reader :UnresolvedTerm
|
67
|
+
#
|
68
|
+
# # @return [RDF::Vocabulary::Term]
|
69
|
+
# attr_reader :VocabReferenceError
|
70
|
+
#
|
71
|
+
# # @return [RDF::Vocabulary::Term]
|
72
|
+
# attr_reader :Warning
|
73
|
+
#
|
74
|
+
# end
|
75
|
+
RDFA = Class.new(RDF::Vocabulary("http://www.w3.org/ns/rdfa#")) do
|
76
|
+
|
77
|
+
# Ontology definition
|
78
|
+
ontology :"http://www.w3.org/ns/rdfa#",
|
79
|
+
"dc:creator": "http://www.ivan-herman.net/foaf#me".freeze,
|
80
|
+
"dc:date": "2013-01-18".freeze,
|
81
|
+
"dc:description": "This document describes the RDFa Vocabulary for Term and Prefix Assignment. The Vocabulary is used to modify RDFa 1.1 processing behavior.".freeze,
|
82
|
+
"dc:publisher": "http://www.w3.org/data#W3C".freeze,
|
83
|
+
"dc:title": "RDFa Vocabulary for Term and Prefix Assignment, and for Processor Graph Reporting".freeze,
|
84
|
+
isDefinedBy: "http://www.w3.org/TR/rdfa-core/#s_initialcontexts".freeze,
|
85
|
+
"owl:versionInfo": "$Date: 2013-03-11 07:54:23 $".freeze,
|
86
|
+
type: "owl:Ontology".freeze
|
87
|
+
|
4
88
|
# Class definitions
|
5
|
-
|
6
|
-
|
7
|
-
"
|
8
|
-
|
9
|
-
|
10
|
-
type: "rdfs:Class".freeze
|
11
|
-
|
12
|
-
|
13
|
-
"
|
14
|
-
label: "Error".freeze,
|
15
|
-
subClassOf: "rdfa:PGClass".freeze.freeze,
|
16
|
-
type: "rdfs:Class".freeze
|
17
|
-
__property__ :Info,
|
18
|
-
comment: %(is the class for all informations).freeze,
|
19
|
-
"dc:description" => %(is the class for all informations).freeze,
|
20
|
-
label: "Info".freeze,
|
21
|
-
subClassOf: "rdfa:PGClass".freeze.freeze,
|
22
|
-
type: "rdfs:Class".freeze
|
23
|
-
__property__ :PGClass,
|
24
|
-
comment: %(is the top level class of the hierarchy).freeze,
|
25
|
-
"dc:description" => %(is the top level class of the hierarchy).freeze,
|
26
|
-
label: "PGClass".freeze,
|
27
|
-
type: ["rdfs:Class".freeze, "owl:Class".freeze]
|
28
|
-
__property__ :Pattern,
|
29
|
-
comment: %(Class to identify an \(RDF\) resource whose properties are to be copied to another resource).freeze,
|
30
|
-
"dc:description" => %(Class to identify an \(RDF\) resource whose properties are to be copied to another resource).freeze,
|
31
|
-
label: "Pattern".freeze,
|
32
|
-
type: ["rdfs:Class".freeze, "owl:Class".freeze]
|
33
|
-
__property__ :PrefixMapping,
|
34
|
-
comment: %(is the class for prefix mappings).freeze,
|
35
|
-
"dc:description" => %(is the class for prefix mappings).freeze,
|
36
|
-
label: "PrefixMapping".freeze,
|
37
|
-
subClassOf: "rdfa:PrefixOrTermMapping".freeze.freeze,
|
38
|
-
type: "rdfs:Class".freeze
|
39
|
-
__property__ :PrefixOrTermMapping,
|
40
|
-
comment: %(is the top level class for prefix or term mappings).freeze,
|
41
|
-
"dc:description" => %(is the top level class for prefix or term mappings).freeze,
|
42
|
-
label: "PrefixOrTermMapping".freeze,
|
43
|
-
type: ["rdfs:Class".freeze, "owl:Class".freeze]
|
44
|
-
__property__ :PrefixRedefinition,
|
45
|
-
comment: %(warning; to be used when a prefix, either from the initial context or inherited from an ancestor node, is redefined in an element).freeze,
|
46
|
-
"dc:description" => %(warning; to be used when a prefix, either from the initial context or inherited from an ancestor node, is redefined in an element).freeze,
|
47
|
-
label: "PrefixRedefinition".freeze,
|
48
|
-
subClassOf: "rdfa:Warning".freeze.freeze,
|
49
|
-
type: "rdfs:Class".freeze
|
50
|
-
__property__ :TermMapping,
|
51
|
-
comment: %(is the class for term mappings).freeze,
|
52
|
-
"dc:description" => %(is the class for term mappings).freeze,
|
53
|
-
label: "TermMapping".freeze,
|
54
|
-
subClassOf: "rdfa:PrefixOrTermMapping".freeze.freeze,
|
55
|
-
type: "rdfs:Class".freeze
|
56
|
-
__property__ :UnresolvedCURIE,
|
57
|
-
comment: %(warning; to be used when a CURIE prefix fails to be resolved).freeze,
|
58
|
-
"dc:description" => %(warning; to be used when a CURIE prefix fails to be resolved).freeze,
|
59
|
-
label: "UnresolvedCURIE".freeze,
|
60
|
-
subClassOf: "rdfa:Warning".freeze.freeze,
|
61
|
-
type: "rdfs:Class".freeze
|
62
|
-
__property__ :UnresolvedTerm,
|
63
|
-
comment: %(warning; to be used when a Term fails to be resolved).freeze,
|
64
|
-
"dc:description" => %(warning; to be used when a Term fails to be resolved).freeze,
|
65
|
-
label: "UnresolvedTerm".freeze,
|
66
|
-
subClassOf: "rdfa:Warning".freeze.freeze,
|
67
|
-
type: "rdfs:Class".freeze
|
68
|
-
__property__ :VocabReferenceError,
|
69
|
-
comment: %(warning; to be used when the value of a @vocab attribute cannot be dereferenced, hence the vocabulary expansion cannot be completed).freeze,
|
70
|
-
"dc:description" => %(warning; to be used when the value of a @vocab attribute cannot be dereferenced, hence the vocabulary expansion cannot be completed).freeze,
|
71
|
-
label: "VocabReferenceError".freeze,
|
72
|
-
subClassOf: "rdfa:Warning".freeze.freeze,
|
73
|
-
type: "rdfs:Class".freeze
|
74
|
-
__property__ :Warning,
|
75
|
-
comment: %(is the class for all warnings).freeze,
|
76
|
-
"dc:description" => %(is the class for all warnings).freeze,
|
77
|
-
label: "Warning".freeze,
|
78
|
-
subClassOf: "rdfa:PGClass".freeze.freeze,
|
79
|
-
type: "rdfs:Class".freeze
|
89
|
+
term :PGClass,
|
90
|
+
"dc:description": "is the top level class of the hierarchy".freeze,
|
91
|
+
type: ["owl:Class".freeze, "rdfs:Class".freeze]
|
92
|
+
term :Pattern,
|
93
|
+
"dc:description": "Class to identify an (RDF) resource whose properties are to be copied to another resource".freeze,
|
94
|
+
type: ["owl:Class".freeze, "rdfs:Class".freeze]
|
95
|
+
term :PrefixOrTermMapping,
|
96
|
+
"dc:description": "is the top level class for prefix or term mappings".freeze,
|
97
|
+
type: ["owl:Class".freeze, "rdfs:Class".freeze]
|
80
98
|
|
81
99
|
# Property definitions
|
82
|
-
|
83
|
-
|
84
|
-
"dc:description" => %(provides extra context for the error, eg, http response, an XPointer/XPath information, or simply the URI that created the error).freeze,
|
100
|
+
property :context,
|
101
|
+
"dc:description": "provides extra context for the error, eg, http response, an XPointer/XPath information, or simply the URI that created the error".freeze,
|
85
102
|
domain: "rdfa:PGClass".freeze,
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
type: ["rdf:Property".freeze, "owl:ObjectProperty".freeze]
|
93
|
-
__property__ :prefix,
|
94
|
-
comment: %(defines a prefix mapping for a URI; the value is supposed to be a NMTOKEN).freeze,
|
95
|
-
"dc:description" => %(defines a prefix mapping for a URI; the value is supposed to be a NMTOKEN).freeze,
|
103
|
+
type: ["owl:ObjectProperty".freeze, "rdf:Property".freeze]
|
104
|
+
property :copy,
|
105
|
+
"dc:description": "identifies the resource (i.e., pattern) whose properties and values should be copied to replace the current triple (retaining the subject of the triple).".freeze,
|
106
|
+
type: ["owl:ObjectProperty".freeze, "rdf:Property".freeze]
|
107
|
+
property :prefix,
|
108
|
+
"dc:description": "defines a prefix mapping for a URI; the value is supposed to be a NMTOKEN".freeze,
|
96
109
|
domain: "rdfa:PrefixMapping".freeze,
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
comment: %(defines a term mapping for a URI; the value is supposed to be a NMTOKEN).freeze,
|
101
|
-
"dc:description" => %(defines a term mapping for a URI; the value is supposed to be a NMTOKEN).freeze,
|
110
|
+
type: ["owl:DatatypeProperty".freeze, "rdf:Property".freeze]
|
111
|
+
property :term,
|
112
|
+
"dc:description": "defines a term mapping for a URI; the value is supposed to be a NMTOKEN".freeze,
|
102
113
|
domain: "rdfa:TermMapping".freeze,
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
comment: %(defines the URI for either a prefix or a term mapping; the value is supposed to be an absolute URI).freeze,
|
107
|
-
"dc:description" => %(defines the URI for either a prefix or a term mapping; the value is supposed to be an absolute URI).freeze,
|
114
|
+
type: ["owl:DatatypeProperty".freeze, "rdf:Property".freeze]
|
115
|
+
property :uri,
|
116
|
+
"dc:description": "defines the URI for either a prefix or a term mapping; the value is supposed to be an absolute URI".freeze,
|
108
117
|
domain: "rdfa:PrefixOrTermMapping".freeze,
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
type: ["
|
116
|
-
__property__ :vocabulary,
|
117
|
-
comment: %(defines an absolute URI to be used as a default vocabulary; the value is can be any string; for documentation purposes it is advised to use the string 'true' or 'True'.).freeze,
|
118
|
-
"dc:description" => %(defines an absolute URI to be used as a default vocabulary; the value is can be any string; for documentation purposes it is advised to use the string 'true' or 'True'.).freeze,
|
119
|
-
label: "vocabulary".freeze,
|
120
|
-
type: ["rdf:Property".freeze, "owl:DatatypeProperty".freeze]
|
118
|
+
type: ["owl:DatatypeProperty".freeze, "rdf:Property".freeze]
|
119
|
+
property :usesVocabulary,
|
120
|
+
"dc:description": "provides a relationship between the host document and a vocabulary\n\tdefined using the @vocab facility of RDFa1.1".freeze,
|
121
|
+
type: ["owl:ObjectProperty".freeze, "rdf:Property".freeze]
|
122
|
+
property :vocabulary,
|
123
|
+
"dc:description": "defines an absolute URI to be used as a default vocabulary; the value is can be any string; for documentation purposes it is advised to use the string 'true' or 'True'.".freeze,
|
124
|
+
type: ["owl:DatatypeProperty".freeze, "rdf:Property".freeze]
|
121
125
|
|
122
126
|
# Extra definitions
|
123
|
-
|
124
|
-
"dc:
|
125
|
-
"
|
126
|
-
|
127
|
-
"dc:
|
128
|
-
"
|
129
|
-
|
130
|
-
"
|
131
|
-
"
|
132
|
-
|
127
|
+
term :DocumentError,
|
128
|
+
"dc:description": "error condition; to be used when the document fails to be fully processed as a result of non-conformant host language markup".freeze,
|
129
|
+
subClassOf: "rdfa:Error".freeze
|
130
|
+
term :Error,
|
131
|
+
"dc:description": "is the class for all error conditions".freeze,
|
132
|
+
subClassOf: "rdfa:PGClass".freeze
|
133
|
+
term :Info,
|
134
|
+
"dc:description": "is the class for all informations".freeze,
|
135
|
+
subClassOf: "rdfa:PGClass".freeze
|
136
|
+
term :PrefixMapping,
|
137
|
+
"dc:description": "is the class for prefix mappings".freeze,
|
138
|
+
subClassOf: "rdfa:PrefixOrTermMapping".freeze
|
139
|
+
term :PrefixRedefinition,
|
140
|
+
"dc:description": "warning; to be used when a prefix, either from the initial context or inherited from an ancestor node, is redefined in an element".freeze,
|
141
|
+
subClassOf: "rdfa:Warning".freeze
|
142
|
+
term :TermMapping,
|
143
|
+
"dc:description": "is the class for term mappings".freeze,
|
144
|
+
subClassOf: "rdfa:PrefixOrTermMapping".freeze
|
145
|
+
term :UnresolvedCURIE,
|
146
|
+
"dc:description": "warning; to be used when a CURIE prefix fails to be resolved".freeze,
|
147
|
+
subClassOf: "rdfa:Warning".freeze
|
148
|
+
term :UnresolvedTerm,
|
149
|
+
"dc:description": "warning; to be used when a Term fails to be resolved".freeze,
|
150
|
+
subClassOf: "rdfa:Warning".freeze
|
151
|
+
term :VocabReferenceError,
|
152
|
+
"dc:description": "warning; to be used when the value of a @vocab attribute cannot be dereferenced, hence the vocabulary expansion cannot be completed".freeze,
|
153
|
+
subClassOf: "rdfa:Warning".freeze
|
154
|
+
term :Warning,
|
155
|
+
"dc:description": "is the class for all warnings".freeze,
|
156
|
+
subClassOf: "rdfa:PGClass".freeze
|
133
157
|
end
|
134
158
|
|
135
|
-
|
136
|
-
|
159
|
+
XML = Class.new(Vocabulary("http://www.w3.org/XML/1998/namespace"))
|
160
|
+
XSI = Class.new(Vocabulary("http://www.w3.org/2001/XMLSchema-instance"))
|
137
161
|
end
|
data/lib/rdf/rdfa/writer.rb
CHANGED
@@ -46,7 +46,7 @@ module RDF::RDFa
|
|
46
46
|
# end
|
47
47
|
# end
|
48
48
|
#
|
49
|
-
# @author [Gregg Kellogg](
|
49
|
+
# @author [Gregg Kellogg](https://greggkellogg.net/)
|
50
50
|
class Writer < RDF::Writer
|
51
51
|
format RDF::RDFa::Format
|
52
52
|
include RDF::Util::Logger
|
@@ -75,7 +75,7 @@ module RDF::RDFa
|
|
75
75
|
|
76
76
|
##
|
77
77
|
# RDFa Writer options
|
78
|
-
# @see
|
78
|
+
# @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Writer#options-class_method
|
79
79
|
def self.options
|
80
80
|
super + [
|
81
81
|
RDF::CLI::Option.new(
|
@@ -163,16 +163,16 @@ module RDF::RDFa
|
|
163
163
|
%base{href: base}
|
164
164
|
- if title
|
165
165
|
%title= title
|
166
|
-
%link{rel: "stylesheet", href: "http://rdf.
|
166
|
+
%link{rel: "stylesheet", href: "http://rdf.greggkellogg.net/css/distiller.css", type: "text/css"}
|
167
167
|
%script{src: "https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js", type: "text/javascript"}
|
168
|
-
%script{src: "http://rdf.
|
168
|
+
%script{src: "http://rdf.greggkellogg.net/js/distiller.js", type: "text/javascript"}
|
169
169
|
%body
|
170
170
|
- if base
|
171
171
|
%p= "RDFa serialization URI base: <#{base}>"
|
172
172
|
- subjects.each do |subject|
|
173
173
|
!= yield(subject)
|
174
174
|
%footer
|
175
|
-
%p= "Written by <a href='
|
175
|
+
%p= "Written by <a href='https://rubygems.org/gems/rdf-rdfa'>RDF::RDFa</a> version #{RDF::RDFa::VERSION}"
|
176
176
|
),
|
177
177
|
|
178
178
|
# Output for non-leaf resources
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-rdfa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdf
|
@@ -18,6 +18,29 @@ dependencies:
|
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '3.1'
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 3.1.2
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - "~>"
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '3.1'
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.1.2
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: rdf-vocab
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.1'
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 3.1.5
|
21
44
|
type: :runtime
|
22
45
|
prerelease: false
|
23
46
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -25,6 +48,9 @@ dependencies:
|
|
25
48
|
- - "~>"
|
26
49
|
- !ruby/object:Gem::Version
|
27
50
|
version: '3.1'
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 3.1.5
|
28
54
|
- !ruby/object:Gem::Dependency
|
29
55
|
name: haml
|
30
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -261,7 +287,7 @@ files:
|
|
261
287
|
- lib/rdf/rdfa/vocab.rb
|
262
288
|
- lib/rdf/rdfa/writer.rb
|
263
289
|
- lib/rdf/rdfa/writer/haml_templates.rb
|
264
|
-
homepage:
|
290
|
+
homepage: https://github.com/ruby-rdf/rdf-rdfa
|
265
291
|
licenses:
|
266
292
|
- Unlicense
|
267
293
|
metadata: {}
|
@@ -280,7 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
280
306
|
- !ruby/object:Gem::Version
|
281
307
|
version: '0'
|
282
308
|
requirements: []
|
283
|
-
rubygems_version: 3.
|
309
|
+
rubygems_version: 3.1.3
|
284
310
|
signing_key:
|
285
311
|
specification_version: 4
|
286
312
|
summary: RDFa reader/writer for RDF.rb.
|