sinatra-linkeddata 2.0.0 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/AUTHORS +1 -0
- data/README.md +80 -74
- data/UNLICENSE +1 -1
- data/VERSION +1 -1
- data/lib/sinatra/linkeddata.rb +1 -1
- metadata +25 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 496cc57d9e663ff07fda8802625a7e91446f48fe86bf7ba3320a2ca264b3b5db
|
4
|
+
data.tar.gz: d177f3b81e7d5a247012b7db043fa9b3ee47efc0d6c6d21d6e686e2f1b11e9b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3979b41f035202db1d0886f463898d8ab5655f530db8921b85312a168f4616736851390cc367363c0b21c88cd90c31f276de2d75a78a160f7817813c4a15930
|
7
|
+
data.tar.gz: ea05fa5b911fe87326d092f1498a1e5236576cb56b30307b404531652cbd1e659e5d5305673762cebdb00d1e85f5c1e23fc694bcc0952b6321dadeb85b56f5fe
|
data/AUTHORS
CHANGED
data/README.md
CHANGED
@@ -3,71 +3,77 @@
|
|
3
3
|
This is a [Sinatra][] extension that provides [Linked Data][] content
|
4
4
|
negotiation for Sinatra applications.
|
5
5
|
|
6
|
-
* <http://github.com/datagraph/sinatra-linkeddata>
|
7
6
|
|
8
|
-
[![Gem Version](https://badge.fury.io/rb/sinatra-linkeddata.
|
9
|
-
[![Build Status](https://
|
7
|
+
[![Gem Version](https://badge.fury.io/rb/sinatra-linkeddata.svg)](https://badge.fury.io/rb/sinatra-linkeddata)
|
8
|
+
[![Build Status](https://github.com/ruby-rdf/sinatra-linkeddata/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/sinatra-linkeddata/actions?query=workflow%3ACI)
|
9
|
+
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
|
10
10
|
|
11
11
|
## Features
|
12
12
|
|
13
13
|
* Implements [HTTP content negotiation][conneg] for RDF content types using
|
14
14
|
the [`Rack::LinkedData`][Rack::LinkedData] middleware.
|
15
|
-
* Supports all [RDF.rb][]-compatible serialization formats.
|
15
|
+
* Supports all [RDF.rb][] -compatible serialization formats.
|
16
16
|
* Supports both classic and modular Sinatra applications.
|
17
17
|
|
18
18
|
## Examples
|
19
19
|
|
20
20
|
### Adding Linked Data content negotiation to a classic Sinatra application
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
```ruby
|
23
|
+
#!/usr/bin/env ruby -rubygems
|
24
|
+
require 'sinatra'
|
25
|
+
require 'sinatra/linkeddata'
|
26
|
+
|
27
|
+
get '/hello' do
|
28
|
+
RDF::Graph.new do |graph|
|
29
|
+
graph << [RDF::Node.new, RDF::DC.title, "Hello, world!"]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
```
|
33
|
+
|
34
|
+
### Adding Linked Data content negotiation to a modular Sinatra application
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
#!/usr/bin/env ruby -rubygems
|
38
|
+
require 'sinatra/base'
|
39
|
+
require 'sinatra/linkeddata'
|
40
|
+
|
41
|
+
module My
|
42
|
+
class Application < Sinatra::Base
|
43
|
+
register Sinatra::LinkedData
|
44
|
+
|
26
45
|
get '/hello' do
|
27
46
|
RDF::Graph.new do |graph|
|
28
47
|
graph << [RDF::Node.new, RDF::DC.title, "Hello, world!"]
|
29
48
|
end
|
30
49
|
end
|
50
|
+
end
|
51
|
+
end
|
31
52
|
|
32
|
-
|
33
|
-
|
34
|
-
#!/usr/bin/env ruby -rubygems
|
35
|
-
require 'sinatra/base'
|
36
|
-
require 'sinatra/linkeddata'
|
37
|
-
|
38
|
-
module My
|
39
|
-
class Application < Sinatra::Base
|
40
|
-
register Sinatra::LinkedData
|
41
|
-
|
42
|
-
get '/hello' do
|
43
|
-
RDF::Graph.new do |graph|
|
44
|
-
graph << [RDF::Node.new, RDF::DC.title, "Hello, world!"]
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
My::Application.run! :host => '127.0.0.1', :port => 4567
|
53
|
+
My::Application.run! :host => '127.0.0.1', :port => 4567
|
54
|
+
```
|
51
55
|
|
52
56
|
### Adding Linked Data content negotiation to a Rackup application
|
53
57
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
58
|
+
```ruby
|
59
|
+
#!/usr/bin/env rackup
|
60
|
+
require 'sinatra/base'
|
61
|
+
require 'sinatra/linkeddata'
|
62
|
+
|
63
|
+
module My
|
64
|
+
class Application < Sinatra::Base
|
65
|
+
register Sinatra::LinkedData
|
66
|
+
|
67
|
+
get '/hello' do
|
68
|
+
RDF::Graph.new do |graph|
|
69
|
+
graph << [RDF::Node.new, RDF::DC.title, "Hello, world!"]
|
67
70
|
end
|
68
71
|
end
|
69
|
-
|
70
|
-
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
run My::Application
|
76
|
+
```
|
71
77
|
|
72
78
|
### Testing Linked Data content negotiation using `rackup` and `curl`
|
73
79
|
|
@@ -89,34 +95,34 @@ Data content negotiation for Rack applications.
|
|
89
95
|
At the moment the Sinatra extension simply corresponds
|
90
96
|
to doing the following manually in a Sinatra application:
|
91
97
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
98
|
+
```ruby
|
99
|
+
require 'rack/linkeddata'
|
100
|
+
|
101
|
+
module My
|
102
|
+
class Application < Sinatra::Base
|
103
|
+
use Rack::LinkedData::ContentNegotiation
|
104
|
+
helpers Sinatra::LinkedData::Helpers
|
105
|
+
include RDF
|
106
|
+
include LinkedData
|
107
|
+
end
|
108
|
+
end
|
109
|
+
```
|
102
110
|
|
103
111
|
See the `Rack::LinkedData` documentation for more information on the
|
104
112
|
operation and details of the content negotiation.
|
105
113
|
|
106
114
|
## Documentation
|
107
115
|
|
108
|
-
|
109
|
-
|
110
|
-
* {Sinatra::LinkedData}
|
116
|
+
* [Sinatra::LinkedData](https://www.rubydoc.info/github/ruby-rdf/sinatra-linkeddata/master)
|
111
117
|
|
112
118
|
## Dependencies
|
113
119
|
|
114
|
-
* [Sinatra](
|
115
|
-
* [Rack::LinkedData](
|
120
|
+
* [Sinatra](https://rubygems.org/gems/sinatra) (~> 2.0)
|
121
|
+
* [Rack::LinkedData](https://rubygems.org/gems/rack-linkeddata) (~> 3.1)
|
116
122
|
|
117
123
|
## Installation
|
118
124
|
|
119
|
-
The recommended installation method is via [RubyGems](
|
125
|
+
The recommended installation method is via [RubyGems](https://rubygems.org/).
|
120
126
|
To install the latest official release of the gem, do:
|
121
127
|
|
122
128
|
% [sudo] gem install sinatra-linkeddata
|
@@ -130,29 +136,29 @@ To get a local working copy of the development repository, do:
|
|
130
136
|
Alternatively, you can download the latest development version as a tarball
|
131
137
|
as follows:
|
132
138
|
|
133
|
-
% wget
|
139
|
+
% wget https://github.com/ruby-rdf/sinatra-linkeddata/tarball/master
|
134
140
|
|
135
141
|
## References
|
136
142
|
|
137
|
-
* <
|
138
|
-
* <
|
139
|
-
* <
|
140
|
-
* <
|
141
|
-
* <
|
142
|
-
* <
|
143
|
+
* <https://www.w3.org/DesignIssues/LinkedData.html>
|
144
|
+
* <https://linkeddata.org/docs/how-to-publish>
|
145
|
+
* <https://linkeddata.org/conneg-303-redirect-code-samples>
|
146
|
+
* <https://www.w3.org/TR/cooluris/>
|
147
|
+
* <https://www.w3.org/TR/swbp-vocab-pub/>
|
148
|
+
* <https://patterns.dataincubator.org/book/publishing-patterns.html>
|
143
149
|
|
144
150
|
## Authors
|
145
151
|
|
146
|
-
* [Arto Bendiken](
|
152
|
+
* [Arto Bendiken](https://github.com/artob) - <https://ar.to/>
|
147
153
|
|
148
154
|
## License
|
149
155
|
|
150
156
|
`Sinatra::LinkedData` is free and unencumbered public domain software. For more
|
151
|
-
information, see <
|
152
|
-
|
153
|
-
[Sinatra]:
|
154
|
-
[Rack]:
|
155
|
-
[RDF.rb]:
|
156
|
-
[Rack::LinkedData]:
|
157
|
-
[Linked Data]:
|
158
|
-
[conneg]:
|
157
|
+
information, see <https://unlicense.org/> or the accompanying UNLICENSE file.
|
158
|
+
|
159
|
+
[Sinatra]: https://www.sinatrarb.com/
|
160
|
+
[Rack]: https://rack.github.com/
|
161
|
+
[RDF.rb]: https://ruby-rdf.github.com/rdf/
|
162
|
+
[Rack::LinkedData]: https://rubygems.org/gems/rack-linkeddata/
|
163
|
+
[Linked Data]: https://linkeddata.org/
|
164
|
+
[conneg]: https://en.wikipedia.org/wiki/Content_negotiation
|
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
|
-
|
1
|
+
3.1.2
|
data/lib/sinatra/linkeddata.rb
CHANGED
@@ -5,7 +5,7 @@ module Sinatra
|
|
5
5
|
##
|
6
6
|
# To override negotiation on Content-Type, set :format in `linkeddata_options` to a RDF Format class, or symbol identifying a format.
|
7
7
|
#
|
8
|
-
# @see
|
8
|
+
# @see https://www.sinatrarb.com/extensions.html
|
9
9
|
module LinkedData
|
10
10
|
autoload :VERSION, 'sinatra/linkeddata/version'
|
11
11
|
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-linkeddata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arto Bendiken
|
8
|
-
|
8
|
+
- Gregg Kellogg
|
9
|
+
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2020-12-26 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rack-linkeddata
|
@@ -16,70 +17,76 @@ dependencies:
|
|
16
17
|
requirements:
|
17
18
|
- - "~>"
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
+
version: '3.1'
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 3.1.2
|
20
24
|
type: :runtime
|
21
25
|
prerelease: false
|
22
26
|
version_requirements: !ruby/object:Gem::Requirement
|
23
27
|
requirements:
|
24
28
|
- - "~>"
|
25
29
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
30
|
+
version: '3.1'
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.1.2
|
27
34
|
- !ruby/object:Gem::Dependency
|
28
35
|
name: sinatra
|
29
36
|
requirement: !ruby/object:Gem::Requirement
|
30
37
|
requirements:
|
31
38
|
- - "~>"
|
32
39
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1
|
40
|
+
version: '2.1'
|
34
41
|
type: :runtime
|
35
42
|
prerelease: false
|
36
43
|
version_requirements: !ruby/object:Gem::Requirement
|
37
44
|
requirements:
|
38
45
|
- - "~>"
|
39
46
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1
|
47
|
+
version: '2.1'
|
41
48
|
- !ruby/object:Gem::Dependency
|
42
49
|
name: yard
|
43
50
|
requirement: !ruby/object:Gem::Requirement
|
44
51
|
requirements:
|
45
52
|
- - "~>"
|
46
53
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
54
|
+
version: '0.9'
|
48
55
|
type: :development
|
49
56
|
prerelease: false
|
50
57
|
version_requirements: !ruby/object:Gem::Requirement
|
51
58
|
requirements:
|
52
59
|
- - "~>"
|
53
60
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
61
|
+
version: '0.9'
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: rspec
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
58
65
|
requirements:
|
59
66
|
- - "~>"
|
60
67
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
68
|
+
version: '3.10'
|
62
69
|
type: :development
|
63
70
|
prerelease: false
|
64
71
|
version_requirements: !ruby/object:Gem::Requirement
|
65
72
|
requirements:
|
66
73
|
- - "~>"
|
67
74
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
75
|
+
version: '3.10'
|
69
76
|
- !ruby/object:Gem::Dependency
|
70
77
|
name: rack-test
|
71
78
|
requirement: !ruby/object:Gem::Requirement
|
72
79
|
requirements:
|
73
80
|
- - "~>"
|
74
81
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
82
|
+
version: '1.1'
|
76
83
|
type: :development
|
77
84
|
prerelease: false
|
78
85
|
version_requirements: !ruby/object:Gem::Requirement
|
79
86
|
requirements:
|
80
87
|
- - "~>"
|
81
88
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
89
|
+
version: '1.1'
|
83
90
|
description: Sinatra extension for Linked Data content negotiation.
|
84
91
|
email: public-rdf-ruby@w3.org
|
85
92
|
executables: []
|
@@ -93,11 +100,11 @@ files:
|
|
93
100
|
- VERSION
|
94
101
|
- lib/sinatra/linkeddata.rb
|
95
102
|
- lib/sinatra/linkeddata/version.rb
|
96
|
-
homepage:
|
103
|
+
homepage: https://github.com/ruby-rdf/sinatra-linkeddata
|
97
104
|
licenses:
|
98
105
|
- Unlicense
|
99
106
|
metadata: {}
|
100
|
-
post_install_message:
|
107
|
+
post_install_message:
|
101
108
|
rdoc_options: []
|
102
109
|
require_paths:
|
103
110
|
- lib
|
@@ -105,17 +112,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
112
|
requirements:
|
106
113
|
- - ">="
|
107
114
|
- !ruby/object:Gem::Version
|
108
|
-
version: '2.
|
115
|
+
version: '2.4'
|
109
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
117
|
requirements:
|
111
118
|
- - ">="
|
112
119
|
- !ruby/object:Gem::Version
|
113
120
|
version: '0'
|
114
121
|
requirements: []
|
115
|
-
|
116
|
-
|
117
|
-
signing_key:
|
122
|
+
rubygems_version: 3.1.4
|
123
|
+
signing_key:
|
118
124
|
specification_version: 4
|
119
125
|
summary: Linked Data content negotiation for Sinatra applications.
|
120
126
|
test_files: []
|
121
|
-
has_rdoc: false
|