rack-rdf 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/README.md +30 -27
- data/UNLICENSE +1 -1
- data/VERSION +1 -1
- data/lib/rack/rdf.rb +1 -1
- data/lib/rack/rdf/conneg.rb +10 -10
- metadata +15 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8435f745758f0c38296fe836cb17c68afa90a1f80b453c094e52587f24d9eb56
|
|
4
|
+
data.tar.gz: 29a95aa9fe7e2d132598a619843ce8f33e4d0dcdd72b9d0b62f4717bb89dc362
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d51b1f8646ce0abcd1cad8c66ce8710f3afa5faf2ed303442e2acaac0885ab62bac3b6f8a12f661dd8e573543de217087f54a1ae56b27b7abcb6503d79e7274
|
|
7
|
+
data.tar.gz: 2e0e73b75169eb3929d04a4d983fb0ff831e8be4a2149c85ed447407f189d4b7fb2fa1924dc873cbf1d0e1c32fc34a35c09f536cec0a368d3352bf157d9cccf3
|
data/README.md
CHANGED
|
@@ -7,15 +7,16 @@ Sinatra.
|
|
|
7
7
|
|
|
8
8
|
This version is based on [rack-linkeddata][] without the hard dependency on the [linkeddata][] gem, to allow applications to better manage their dependencies
|
|
9
9
|
|
|
10
|
-
* <
|
|
10
|
+
* <https://github.com/ruby-rdf/rack-rdf>
|
|
11
11
|
|
|
12
|
-
[](
|
|
13
|
-
[](https://badge.fury.io/rb/rack-rdf)
|
|
13
|
+
[](https://github.com/ruby-rdf/rack-rdf/actions?query=workflow%3ACI)
|
|
14
|
+
[](https://gitter.im/ruby-rdf/rdf)
|
|
14
15
|
|
|
15
16
|
## Features
|
|
16
17
|
|
|
17
18
|
* Implements [HTTP content negotiation][conneg] for RDF content types.
|
|
18
|
-
* Supports all [RDF.rb][]
|
|
19
|
+
* Supports all [RDF.rb][] compatible serialization formats.
|
|
19
20
|
* Compatible with any Rack application and any Rack-based framework.
|
|
20
21
|
|
|
21
22
|
## Examples
|
|
@@ -90,19 +91,19 @@ for N-Triples, N-Quads, Turtle, RDF/XML, RDF/JSON, JSON-LD, RDFa, TriG and TriX.
|
|
|
90
91
|
|
|
91
92
|
##Documentation
|
|
92
93
|
|
|
93
|
-
<
|
|
94
|
+
<https://rubydoc.info/github/ruby-rdf/rack-rdf/>
|
|
94
95
|
|
|
95
96
|
* {Rack::RDF}
|
|
96
97
|
* {Rack::RDF::ContentNegotiation}
|
|
97
98
|
|
|
98
99
|
## Dependencies
|
|
99
100
|
|
|
100
|
-
* [Rack](
|
|
101
|
-
* [RDF](
|
|
101
|
+
* [Rack](https://rubygems.org/gems/rack) (~> 2.0)
|
|
102
|
+
* [RDF](https://rubygems.org/gems/rdf) (~> 3.1)
|
|
102
103
|
|
|
103
104
|
## Installation
|
|
104
105
|
|
|
105
|
-
The recommended installation method is via [RubyGems](
|
|
106
|
+
The recommended installation method is via [RubyGems](https://rubygems.org/).
|
|
106
107
|
To install the latest official release of the gem, do:
|
|
107
108
|
|
|
108
109
|
% [sudo] gem install rack-rdf
|
|
@@ -116,7 +117,7 @@ To get a local working copy of the development repository, do:
|
|
|
116
117
|
Alternatively, download the latest development version as a tarball as
|
|
117
118
|
follows:
|
|
118
119
|
|
|
119
|
-
% wget
|
|
120
|
+
% wget https://github.com/ruby-rdf/rack-rdf/tarball/master
|
|
120
121
|
|
|
121
122
|
## Contributing
|
|
122
123
|
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.
|
|
@@ -131,31 +132,33 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo
|
|
|
131
132
|
list in the the `README`. Alphabetical order applies.
|
|
132
133
|
* Do note that in order for us to merge any non-trivial changes (as a rule
|
|
133
134
|
of thumb, additions larger than about 15 lines of code), we need an
|
|
134
|
-
explicit [public domain dedication][PDD] on record from you
|
|
135
|
+
explicit [public domain dedication][PDD] on record from you,
|
|
136
|
+
which you will be asked to agree to on the first commit to a repo within the organization.
|
|
137
|
+
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
|
|
135
138
|
|
|
136
139
|
## References
|
|
137
140
|
|
|
138
|
-
* <
|
|
139
|
-
* <
|
|
140
|
-
* <
|
|
141
|
-
* <
|
|
142
|
-
* <
|
|
143
|
-
* <
|
|
141
|
+
* <https://www.w3.org/DesignIssues/LinkedData.html>
|
|
142
|
+
* <https://linkeddata.org/docs/how-to-publish>
|
|
143
|
+
* <https://linkeddata.org/conneg-303-redirect-code-samples>
|
|
144
|
+
* <https://www.w3.org/TR/cooluris/>
|
|
145
|
+
* <https://www.w3.org/TR/swbp-vocab-pub/>
|
|
146
|
+
* <https://patterns.dataincubator.org/book/publishing-patterns.html>
|
|
144
147
|
|
|
145
148
|
## Authors
|
|
146
149
|
|
|
147
|
-
* [Arto Bendiken](
|
|
148
|
-
* [Gregg Kellogg](
|
|
150
|
+
* [Arto Bendiken](https://github.com/artob) - <https://ar.to/>
|
|
151
|
+
* [Gregg Kellogg](https://github.com/gkellogg) - <https://greggkellogg.net/>
|
|
149
152
|
|
|
150
153
|
## License
|
|
151
154
|
|
|
152
155
|
This is free and unencumbered public domain software. For more information,
|
|
153
|
-
see <
|
|
154
|
-
|
|
155
|
-
[Rack]:
|
|
156
|
-
[RDF.rb]:
|
|
157
|
-
[Linked Data]:
|
|
158
|
-
[conneg]:
|
|
159
|
-
[YARD]:
|
|
160
|
-
[YARD-GS]:
|
|
161
|
-
[PDD]:
|
|
156
|
+
see <https://unlicense.org/> or the accompanying {file:UNLICENSE} file.
|
|
157
|
+
|
|
158
|
+
[Rack]: https://rack.github.com/
|
|
159
|
+
[RDF.rb]: https://ruby-rdf.github.com/rdf/
|
|
160
|
+
[Linked Data]: https://linkeddata.org/
|
|
161
|
+
[conneg]: https://en.wikipedia.org/wiki/Content_negotiation
|
|
162
|
+
[YARD]: https://yardoc.org/
|
|
163
|
+
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
|
|
164
|
+
[PDD]: https://unlicense.org/#unlicensing-contributions
|
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/rack/rdf.rb
CHANGED
|
@@ -11,7 +11,7 @@ module Rack
|
|
|
11
11
|
##
|
|
12
12
|
# Registers all known RDF formats with Rack's MIME types registry.
|
|
13
13
|
#
|
|
14
|
-
# @param [Boolean]
|
|
14
|
+
# @param [Boolean] overwrite (false)
|
|
15
15
|
# @param [Hash{Symbol => Object}] options
|
|
16
16
|
# @return [void]
|
|
17
17
|
def self.register_mime_types!(overwrite: false, **options)
|
data/lib/rack/rdf/conneg.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Rack; module RDF
|
|
|
16
16
|
# use Rack::RDF::ContentNegotiation, :format => RDF::NTriples::Format
|
|
17
17
|
# use Rack::RDF::ContentNegotiation, :default => 'application/rdf+xml'
|
|
18
18
|
#
|
|
19
|
-
# @see
|
|
19
|
+
# @see https://www4.wiwiss.fu-berlin.de/bizer/pub/LinkedDataTutorial/
|
|
20
20
|
# @see https://www.rubydoc.info/github/rack/rack/master/file/SPEC
|
|
21
21
|
class ContentNegotiation
|
|
22
22
|
DEFAULT_CONTENT_TYPE = "application/n-triples" # N-Triples
|
|
@@ -32,7 +32,7 @@ module Rack; module RDF
|
|
|
32
32
|
# @param [#call] app
|
|
33
33
|
# @param [Hash{Symbol => Object}] options
|
|
34
34
|
# Other options passed to writer.
|
|
35
|
-
# @
|
|
35
|
+
# @option options [String] :default (DEFAULT_CONTENT_TYPE) Specific content type
|
|
36
36
|
# @option options [RDF::Format, #to_sym] :format Specific RDF writer format to use
|
|
37
37
|
def initialize(app, options)
|
|
38
38
|
@app, @options = app, options
|
|
@@ -47,7 +47,7 @@ module Rack; module RDF
|
|
|
47
47
|
#
|
|
48
48
|
# @param [Hash{String => String}] env
|
|
49
49
|
# @return [Array(Integer, Hash, #each)] Status, Headers and Body
|
|
50
|
-
# @see
|
|
50
|
+
# @see https://rubydoc.info/github/rack/rack/file/SPEC
|
|
51
51
|
def call(env)
|
|
52
52
|
env['ORDERED_CONTENT_TYPES'] = parse_accept_header(env['HTTP_ACCEPT']) if env.has_key?('HTTP_ACCEPT')
|
|
53
53
|
response = app.call(env)
|
|
@@ -109,10 +109,10 @@ module Rack; module RDF
|
|
|
109
109
|
# @param [Hash{String => String}] env
|
|
110
110
|
# @param [Hash{String => Object}] headers
|
|
111
111
|
# @yield |writer, content_type|
|
|
112
|
-
# @
|
|
113
|
-
# @
|
|
114
|
-
# @
|
|
115
|
-
# @see
|
|
112
|
+
# @yieldparam [RDF::Writer] writer
|
|
113
|
+
# @yieldparam [String] content_type from accept media-range without parameters
|
|
114
|
+
# @yieldparam [Hash{Symbol => String}] accept_params from accept media-range
|
|
115
|
+
# @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
|
|
116
116
|
def find_writer(env, headers)
|
|
117
117
|
if @options[:format]
|
|
118
118
|
format = @options[:format]
|
|
@@ -143,8 +143,8 @@ module Rack; module RDF
|
|
|
143
143
|
#
|
|
144
144
|
# @param [String, #to_s] content_type
|
|
145
145
|
# @yield |writer, content_type|
|
|
146
|
-
# @
|
|
147
|
-
# @
|
|
146
|
+
# @yieldparam [RDF::Writer] writer
|
|
147
|
+
# @yieldparam [String] content_type (including media-type parameters)
|
|
148
148
|
def find_writer_for_content_type(content_type)
|
|
149
149
|
ct, *params = content_type.split(';').map(&:strip)
|
|
150
150
|
accept_params = params.inject({}) do |memo, pv|
|
|
@@ -164,7 +164,7 @@ module Rack; module RDF
|
|
|
164
164
|
#
|
|
165
165
|
# @param [String, #to_s] header
|
|
166
166
|
# @return [Array<String>]
|
|
167
|
-
# @see
|
|
167
|
+
# @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
|
|
168
168
|
def parse_accept_header(header)
|
|
169
169
|
entries = header.to_s.split(',')
|
|
170
170
|
entries = entries.map { |e| accept_entry(e) }.sort_by(&:last).map(&:first)
|
metadata
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rack-rdf
|
|
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
|
- Arto Bendiken
|
|
8
8
|
- Gregg Kellogg
|
|
9
|
-
autorequire:
|
|
9
|
+
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2020-
|
|
12
|
+
date: 2020-12-26 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rdf
|
|
@@ -18,6 +18,9 @@ dependencies:
|
|
|
18
18
|
- - "~>"
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
20
|
version: '3.1'
|
|
21
|
+
- - ">="
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: 3.1.8
|
|
21
24
|
type: :runtime
|
|
22
25
|
prerelease: false
|
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -25,6 +28,9 @@ dependencies:
|
|
|
25
28
|
- - "~>"
|
|
26
29
|
- !ruby/object:Gem::Version
|
|
27
30
|
version: '3.1'
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 3.1.8
|
|
28
34
|
- !ruby/object:Gem::Dependency
|
|
29
35
|
name: rack
|
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -59,14 +65,14 @@ dependencies:
|
|
|
59
65
|
requirements:
|
|
60
66
|
- - "~>"
|
|
61
67
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: '3.
|
|
68
|
+
version: '3.10'
|
|
63
69
|
type: :development
|
|
64
70
|
prerelease: false
|
|
65
71
|
version_requirements: !ruby/object:Gem::Requirement
|
|
66
72
|
requirements:
|
|
67
73
|
- - "~>"
|
|
68
74
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: '3.
|
|
75
|
+
version: '3.10'
|
|
70
76
|
- !ruby/object:Gem::Dependency
|
|
71
77
|
name: rack-test
|
|
72
78
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -95,11 +101,11 @@ files:
|
|
|
95
101
|
- lib/rack/rdf.rb
|
|
96
102
|
- lib/rack/rdf/conneg.rb
|
|
97
103
|
- lib/rack/rdf/version.rb
|
|
98
|
-
homepage:
|
|
104
|
+
homepage: https://github.com/ruby-rdf/rack-rdf
|
|
99
105
|
licenses:
|
|
100
106
|
- Unlicense
|
|
101
107
|
metadata: {}
|
|
102
|
-
post_install_message:
|
|
108
|
+
post_install_message:
|
|
103
109
|
rdoc_options: []
|
|
104
110
|
require_paths:
|
|
105
111
|
- lib
|
|
@@ -114,8 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
114
120
|
- !ruby/object:Gem::Version
|
|
115
121
|
version: '0'
|
|
116
122
|
requirements: []
|
|
117
|
-
rubygems_version: 3.1.
|
|
118
|
-
signing_key:
|
|
123
|
+
rubygems_version: 3.1.4
|
|
124
|
+
signing_key:
|
|
119
125
|
specification_version: 4
|
|
120
126
|
summary: Linked Data content negotiation for Rack applications.
|
|
121
127
|
test_files: []
|