sinatra-linkeddata 2.2.1 → 3.1.3
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 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d61219a50379c79d951404e39f36e52e576f2abc7b1ecfbcb1623df1bae3ac7d
|
4
|
+
data.tar.gz: 6fc95b15e8e4421a0c8ad933cdfc178902612ab1d676585652c0dc22342db2ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a226af759b209326d3c504608f777f5fa12f2258eb24944362ca5fcb9799675b96b9df2ff234af4300c2148be415f3a9bce376de7e28239ba7dd4e0a917e3b8
|
7
|
+
data.tar.gz: 7ae46442e00c7e053dad9ae53c2dcc77b0f26b91ddfd46c9dc9717c0068c4bd55b26ae1edea9315d7c22cc63a2fba9137148e0ed9806570b1080f39db409e131
|
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.3
|
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,55 +1,50 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-linkeddata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.3
|
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: 2021-10-26 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rack-linkeddata
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
|
-
- - "
|
18
|
+
- - "~>"
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
- - "
|
20
|
+
version: '3.1'
|
21
|
+
- - ">="
|
21
22
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
23
|
+
version: 3.1.3
|
23
24
|
type: :runtime
|
24
25
|
prerelease: false
|
25
26
|
version_requirements: !ruby/object:Gem::Requirement
|
26
27
|
requirements:
|
27
|
-
- - "
|
28
|
+
- - "~>"
|
28
29
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
30
|
-
- - "
|
30
|
+
version: '3.1'
|
31
|
+
- - ">="
|
31
32
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
33
|
+
version: 3.1.3
|
33
34
|
- !ruby/object:Gem::Dependency
|
34
35
|
name: sinatra
|
35
36
|
requirement: !ruby/object:Gem::Requirement
|
36
37
|
requirements:
|
37
|
-
- - "
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '1.4'
|
40
|
-
- - "<"
|
38
|
+
- - "~>"
|
41
39
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
40
|
+
version: '2.1'
|
43
41
|
type: :runtime
|
44
42
|
prerelease: false
|
45
43
|
version_requirements: !ruby/object:Gem::Requirement
|
46
44
|
requirements:
|
47
|
-
- - "
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '1.4'
|
50
|
-
- - "<"
|
45
|
+
- - "~>"
|
51
46
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
47
|
+
version: '2.1'
|
53
48
|
- !ruby/object:Gem::Dependency
|
54
49
|
name: yard
|
55
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,28 +65,28 @@ dependencies:
|
|
70
65
|
requirements:
|
71
66
|
- - "~>"
|
72
67
|
- !ruby/object:Gem::Version
|
73
|
-
version: '3.
|
68
|
+
version: '3.10'
|
74
69
|
type: :development
|
75
70
|
prerelease: false
|
76
71
|
version_requirements: !ruby/object:Gem::Requirement
|
77
72
|
requirements:
|
78
73
|
- - "~>"
|
79
74
|
- !ruby/object:Gem::Version
|
80
|
-
version: '3.
|
75
|
+
version: '3.10'
|
81
76
|
- !ruby/object:Gem::Dependency
|
82
77
|
name: rack-test
|
83
78
|
requirement: !ruby/object:Gem::Requirement
|
84
79
|
requirements:
|
85
80
|
- - "~>"
|
86
81
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
82
|
+
version: '1.1'
|
88
83
|
type: :development
|
89
84
|
prerelease: false
|
90
85
|
version_requirements: !ruby/object:Gem::Requirement
|
91
86
|
requirements:
|
92
87
|
- - "~>"
|
93
88
|
- !ruby/object:Gem::Version
|
94
|
-
version: '
|
89
|
+
version: '1.1'
|
95
90
|
description: Sinatra extension for Linked Data content negotiation.
|
96
91
|
email: public-rdf-ruby@w3.org
|
97
92
|
executables: []
|
@@ -105,11 +100,11 @@ files:
|
|
105
100
|
- VERSION
|
106
101
|
- lib/sinatra/linkeddata.rb
|
107
102
|
- lib/sinatra/linkeddata/version.rb
|
108
|
-
homepage:
|
103
|
+
homepage: https://github.com/ruby-rdf/sinatra-linkeddata
|
109
104
|
licenses:
|
110
105
|
- Unlicense
|
111
106
|
metadata: {}
|
112
|
-
post_install_message:
|
107
|
+
post_install_message:
|
113
108
|
rdoc_options: []
|
114
109
|
require_paths:
|
115
110
|
- lib
|
@@ -117,16 +112,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
112
|
requirements:
|
118
113
|
- - ">="
|
119
114
|
- !ruby/object:Gem::Version
|
120
|
-
version: '2.
|
115
|
+
version: '2.4'
|
121
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
117
|
requirements:
|
123
118
|
- - ">="
|
124
119
|
- !ruby/object:Gem::Version
|
125
120
|
version: '0'
|
126
121
|
requirements: []
|
127
|
-
|
128
|
-
|
129
|
-
signing_key:
|
122
|
+
rubygems_version: 3.2.22
|
123
|
+
signing_key:
|
130
124
|
specification_version: 4
|
131
125
|
summary: Linked Data content negotiation for Sinatra applications.
|
132
126
|
test_files: []
|