rdf-ldp 1.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +5 -0
- data/CREDITS +1 -0
- data/README.md +32 -10
- data/UNLICENSE +1 -1
- data/VERSION +1 -1
- data/lib/rack/ldp.rb +8 -8
- data/lib/rdf/ldp/container.rb +17 -13
- data/lib/rdf/ldp/direct_container.rb +4 -4
- data/lib/rdf/ldp/indirect_container.rb +3 -3
- data/lib/rdf/ldp/non_rdf_source.rb +6 -4
- data/lib/rdf/ldp/rdf_source.rb +3 -3
- data/lib/rdf/ldp/resource.rb +13 -13
- data/lib/rdf/ldp.rb +1 -1
- metadata +62 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a6eaa64d18272bf2f35f4d5852a5f8a116df0234d6b2decea3584255a987d9ad
|
4
|
+
data.tar.gz: 518ca26f3e55f464371be75c9bceefd49bb727b141d71f09a014cb4b2e350bff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b9822d36e2714f7a31ce2e0b74e79f3f89e67ba33f40cd07d0d53c52cec043f9c7801caabad4ba7195b64f71527dda59047b14cdcf99fb98fd8d8670e740ae3
|
7
|
+
data.tar.gz: e1a9ad43326ba12973175108836abb33da8480a12a630582133a4afba7e6891bd782989f60a3902a1fe4f47dbc1e6730debcc18f59e45c2bee257e82eeb0252e
|
data/CHANGELOG.md
CHANGED
data/CREDITS
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
* Gregg Kellogg <gregg@greggkellogg.net>
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
RDF::LDP
|
2
2
|
========
|
3
|
-
|
4
|
-
[![Build Status](https://
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/rdf-ldp.png)](https://badge.fury.io/rb/rdf-ldp)
|
4
|
+
[![Build Status](https://github.com/ruby-rdf/rdf-ldp/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-ldp/actions?query=workflow%3ACI)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-ldp/badge.svg)](https://coveralls.io/github/ruby-rdf/rdf-ldp)
|
6
|
+
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
|
5
7
|
|
6
8
|
Server-side support for Linked Data Platform (LDP) with RDF.rb. To get started
|
7
9
|
with LDP, see the [LDP Primer](https://dvcs.w3.org/hg/ldpwg/raw-file/default/ldp-primer/ldp-primer.html).
|
@@ -89,7 +91,7 @@ app = proc do |env|
|
|
89
91
|
# The `Rack::LDP` middleware marhsalls the request to the resource, builds the response,
|
90
92
|
# and handles conneg for RDF serializations (when the body is an `RDF::LDP::RDFSource`).
|
91
93
|
#
|
92
|
-
# @see
|
94
|
+
# @see https://www.rubydoc.info/github/rack/rack/master/file/SPEC#The_Response
|
93
95
|
|
94
96
|
[200, {}, RDF::LDP::Resource.find(RDF::URI(env['REQUEST_URI']), repository)]
|
95
97
|
end
|
@@ -145,16 +147,36 @@ Reports are generated by the LDP test suite. We use the
|
|
145
147
|
[`ldp_testsuite_wrapper`](https://github.com/cbeer/ldp_testsuite_wrapper)
|
146
148
|
gem to run the suite and generate the tests.
|
147
149
|
|
148
|
-
RDF.rb
|
150
|
+
RDF.rb Compatibility
|
149
151
|
--------------------------
|
150
152
|
|
151
|
-
As of version
|
152
|
-
Ruby RDF version 1.99 will be maintained to the degree possible on the 0.5.x
|
153
|
-
release series. Users are encouraged to upgrade their projects to 2.0 to take
|
154
|
-
advantage of the latest development.
|
153
|
+
As of version 2.1, this software depends on RDF.rb 3.2 or greater.
|
155
154
|
|
155
|
+
## Contributing
|
156
156
|
|
157
|
-
|
158
|
-
|
157
|
+
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.
|
158
|
+
|
159
|
+
* Do your best to adhere to the existing coding conventions and idioms.
|
160
|
+
* Don't use hard tabs, and don't leave trailing whitespace on any line.
|
161
|
+
Before committing, run `git diff --check` to make sure of this.
|
162
|
+
* Do document every method you add using [YARD][] annotations. Read the
|
163
|
+
[tutorial][YARD-GS] or just look at the existing code for examples.
|
164
|
+
* Don't touch the `.gemspec` or `VERSION` files. If you need to change them,
|
165
|
+
do so on your private branch only.
|
166
|
+
* Do feel free to add yourself to the `CREDITS` file and the
|
167
|
+
corresponding list in the the `README`. Alphabetical order applies.
|
168
|
+
* Don't touch the `AUTHORS` file. If your contributions are significant
|
169
|
+
enough, be assured we will eventually add you in there.
|
170
|
+
* Do note that in order for us to merge any non-trivial changes (as a rule
|
171
|
+
of thumb, additions larger than about 15 lines of code), we need an
|
172
|
+
explicit [public domain dedication][PDD] on record from you,
|
173
|
+
which you will be asked to agree to on the first commit to a repo within the organization.
|
174
|
+
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
|
175
|
+
|
176
|
+
## License
|
159
177
|
|
160
178
|
This software is released under a public domain waiver (Unlicense).
|
179
|
+
|
180
|
+
[YARD]: https://yardoc.org/
|
181
|
+
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
|
182
|
+
[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
|
-
1.0
|
1
|
+
2.1.0
|
data/lib/rack/ldp.rb
CHANGED
@@ -34,7 +34,7 @@ module Rack
|
|
34
34
|
# # ...
|
35
35
|
# end
|
36
36
|
#
|
37
|
-
# @see
|
37
|
+
# @see https://www.w3.org/TR/ldp/ the LDP specification
|
38
38
|
module LDP
|
39
39
|
##
|
40
40
|
# Catches and handles RequestErrors thrown by RDF::LDP
|
@@ -53,7 +53,7 @@ module Rack
|
|
53
53
|
# @return [Array] a rack env array with added headers
|
54
54
|
def call(env)
|
55
55
|
@app.call(env)
|
56
|
-
rescue RDF::LDP::RequestError => err
|
56
|
+
rescue ::RDF::LDP::RequestError => err
|
57
57
|
return [err.status, err.headers, [err.message]]
|
58
58
|
end
|
59
59
|
end
|
@@ -72,7 +72,7 @@ module Rack
|
|
72
72
|
def call(env)
|
73
73
|
status, headers, response = @app.call(env)
|
74
74
|
|
75
|
-
if response.is_a? RDF::LDP::Resource
|
75
|
+
if response.is_a? ::RDF::LDP::Resource
|
76
76
|
new_response = response.to_response
|
77
77
|
response.close if response.respond_to? :close
|
78
78
|
response = new_response
|
@@ -100,7 +100,7 @@ module Rack
|
|
100
100
|
def call(env)
|
101
101
|
status, headers, response = @app.call(env)
|
102
102
|
return [status, headers, response] unless
|
103
|
-
response.is_a? RDF::LDP::Resource
|
103
|
+
response.is_a? ::RDF::LDP::Resource
|
104
104
|
|
105
105
|
response
|
106
106
|
.send(:request, env['REQUEST_METHOD'].to_sym, status, headers, env)
|
@@ -108,13 +108,13 @@ module Rack
|
|
108
108
|
end
|
109
109
|
|
110
110
|
##
|
111
|
-
# Specializes
|
111
|
+
# Specializes `Rack::LinkedData::ContentNegotiation`, making the default
|
112
112
|
# return type 'text/turtle'.
|
113
113
|
#
|
114
|
-
# @see Rack::LinkedData::ContentNegotiation
|
114
|
+
# @see Rack::LinkedData::ContentNegotiation, making
|
115
115
|
class ContentNegotiation < Rack::LinkedData::ContentNegotiation
|
116
116
|
DEFAULT_PREFIXES =
|
117
|
-
Hash[
|
117
|
+
Hash[*::RDF::Vocabulary.map { |v| [v.__prefix__, v.to_uri] }.flatten]
|
118
118
|
.freeze
|
119
119
|
|
120
120
|
def initialize(app, options = {})
|
@@ -130,7 +130,7 @@ module Rack
|
|
130
130
|
#
|
131
131
|
# @see Rack::LinkedData::ContentNegotiation#find_writer_for_content_type
|
132
132
|
def find_writer_for_content_type(content_type)
|
133
|
-
return [RDF::Writer.for(:ttl), 'text/turtle'] if
|
133
|
+
return [::RDF::Writer.for(:ttl), 'text/turtle'] if
|
134
134
|
content_type == 'text/*'
|
135
135
|
super
|
136
136
|
end
|
data/lib/rdf/ldp/container.rb
CHANGED
@@ -11,12 +11,12 @@ module RDF::LDP
|
|
11
11
|
# Containers will throw errors when attempting to edit them in conflict with
|
12
12
|
# LDP's restrictions on changing containment triples.
|
13
13
|
#
|
14
|
-
# @see
|
14
|
+
# @see https://www.w3.org/TR/ldp/#dfn-linked-data-platform-container definition
|
15
15
|
# of LDP Container
|
16
16
|
class Container < RDFSource
|
17
17
|
##
|
18
18
|
# @return [RDF::URI] uri with lexical representation
|
19
|
-
# '
|
19
|
+
# 'https://www.w3.org/ns/ldp#Container'
|
20
20
|
def self.to_uri
|
21
21
|
RDF::Vocab::LDP.Container
|
22
22
|
end
|
@@ -69,9 +69,10 @@ module RDF::LDP
|
|
69
69
|
# containment triple is completed when the transaction closes; otherwise it
|
70
70
|
# is handled atomically.
|
71
71
|
#
|
72
|
-
# @param [RDF::Term]
|
73
|
-
#
|
74
|
-
#
|
72
|
+
# @param [RDF::Term] resource
|
73
|
+
# a new member for this container
|
74
|
+
# @param transaction [RDF::Transaction] transaction
|
75
|
+
# an active transaction as context for the addition
|
75
76
|
# @return [Container] self
|
76
77
|
def add(resource, transaction = nil)
|
77
78
|
add_containment_triple(resource.to_uri, transaction)
|
@@ -85,9 +86,10 @@ module RDF::LDP
|
|
85
86
|
# containment triple is completed when the transaction closes; otherwise it
|
86
87
|
# is handled atomically.
|
87
88
|
#
|
88
|
-
# @param [RDF::Term]
|
89
|
-
#
|
90
|
-
#
|
89
|
+
# @param [RDF::Term] resource
|
90
|
+
# a new member for this container
|
91
|
+
# @param transaction [RDF::Transaction] transaction
|
92
|
+
# an active transaction as context for the removal
|
91
93
|
# @return [Container] self
|
92
94
|
def remove(resource, transaction = nil)
|
93
95
|
remove_containment_triple(resource.to_uri, transaction)
|
@@ -140,9 +142,11 @@ module RDF::LDP
|
|
140
142
|
end
|
141
143
|
|
142
144
|
##
|
143
|
-
# @param [RDF::Term]
|
145
|
+
# @param [RDF::Term] resource
|
146
|
+
# a member to be represented in the containment triple
|
144
147
|
#
|
145
|
-
# @return [RDF::URI]
|
148
|
+
# @return [RDF::URI]
|
149
|
+
# the containment triple, with a graph_name pointing
|
146
150
|
# to `#graph`
|
147
151
|
def make_containment_triple(resource)
|
148
152
|
RDF::Statement(subject_uri, CONTAINS_URI, resource,
|
@@ -200,8 +204,8 @@ module RDF::LDP
|
|
200
204
|
def validate_triples!(transaction)
|
201
205
|
existing_triples = containment_triples.to_a
|
202
206
|
|
203
|
-
tx_containment = transaction.query(subject: subject_uri,
|
204
|
-
predicate: CONTAINS_URI)
|
207
|
+
tx_containment = transaction.query({subject: subject_uri,
|
208
|
+
predicate: CONTAINS_URI})
|
205
209
|
|
206
210
|
tx_containment.each do |statement|
|
207
211
|
unless existing_triples.include?(statement)
|
@@ -222,7 +226,7 @@ module RDF::LDP
|
|
222
226
|
# supports Patch.
|
223
227
|
def validate_statements!(statements)
|
224
228
|
existing_triples = containment_triples.to_a
|
225
|
-
statements.query(subject: subject_uri, predicate: CONTAINS_URI) do |st|
|
229
|
+
statements.query({subject: subject_uri, predicate: CONTAINS_URI}) do |st|
|
226
230
|
existing_triples.delete(st) do
|
227
231
|
raise(Conflict, 'Attempted to write unacceptable LDP ' \
|
228
232
|
"containment-triple: #{st}")
|
@@ -15,7 +15,7 @@ module RDF::LDP
|
|
15
15
|
# If more than one of either is given, all `#add/#remove` (POST/DELETE)
|
16
16
|
# requests will fail.
|
17
17
|
#
|
18
|
-
# @see
|
18
|
+
# @see https://www.w3.org/TR/ldp/#dfn-linked-data-platform-direct-container
|
19
19
|
# definition of LDP Direct Container
|
20
20
|
class DirectContainer < Container
|
21
21
|
MEMBER_URI = RDF::Vocab::LDP.member.freeze
|
@@ -98,7 +98,7 @@ module RDF::LDP
|
|
98
98
|
# @raise [RDF::LDP::NotAcceptable] if multiple membership constant uris
|
99
99
|
# exist
|
100
100
|
#
|
101
|
-
# @see
|
101
|
+
# @see https://www.w3.org/TR/ldp/#dfn-membership-triples
|
102
102
|
def membership_constant_uri
|
103
103
|
statements = membership_resource_statements
|
104
104
|
return statements.first.object if statements.count == 1
|
@@ -115,7 +115,7 @@ module RDF::LDP
|
|
115
115
|
#
|
116
116
|
# @raise [RDF::LDP::NotAcceptable] if multiple membership predicates exist
|
117
117
|
#
|
118
|
-
# @see
|
118
|
+
# @see https://www.w3.org/TR/ldp/#dfn-membership-predicate
|
119
119
|
def membership_predicate
|
120
120
|
statements = member_relation_statements
|
121
121
|
return statements.first.object if statements.count == 1
|
@@ -130,7 +130,7 @@ module RDF::LDP
|
|
130
130
|
# @return [RDF::URI] the membership triple representing membership of the
|
131
131
|
# `resource` parameter in this container
|
132
132
|
#
|
133
|
-
# @see
|
133
|
+
# @see https://www.w3.org/TR/ldp/#dfn-membership-triples
|
134
134
|
def make_membership_triple(resource)
|
135
135
|
predicate = membership_predicate
|
136
136
|
return RDF::Statement(membership_constant_uri, predicate, resource) if
|
@@ -13,9 +13,9 @@ module RDF::LDP
|
|
13
13
|
# Acceptable`. LDP-NR's cannot be added since indirect membership is not well
|
14
14
|
# defined for them, per _LDP 5.5.1.2_.
|
15
15
|
#
|
16
|
-
# @see
|
16
|
+
# @see https://www.w3.org/TR/ldp/#h-ldpic-indirectmbr for an explanation if
|
17
17
|
# indirect membership and limitiations surrounding LDP-NRs.
|
18
|
-
# @see
|
18
|
+
# @see https://www.w3.org/TR/ldp/#dfn-linked-data-platform-indirect-container
|
19
19
|
# definition of LDP Indirect Container
|
20
20
|
class IndirectContainer < DirectContainer
|
21
21
|
INSERTED_CONTENT_REL_URI = RDF::Vocab::LDP.insertedContentRelation.freeze
|
@@ -61,7 +61,7 @@ module RDF::LDP
|
|
61
61
|
# @raise [RDF::LDP::NotAcceptable] if multiple inserted content relations
|
62
62
|
# exist.
|
63
63
|
#
|
64
|
-
# @see
|
64
|
+
# @see https://www.w3.org/TR/ldp/#dfn-membership-triples
|
65
65
|
def inserted_content_relation
|
66
66
|
statements = inserted_content_statements
|
67
67
|
return statements.first.object if statements.count == 1
|
@@ -15,7 +15,7 @@ module RDF::LDP
|
|
15
15
|
# the resource itself is returned by `#description`.
|
16
16
|
#
|
17
17
|
# @see RDF::LDP::Resource
|
18
|
-
# @see
|
18
|
+
# @see https://www.w3.org/TR/ldp/#dfn-linked-data-platform-non-rdf-source for
|
19
19
|
# a definition of NonRDFSource in LDP
|
20
20
|
class NonRDFSource < Resource
|
21
21
|
attr_reader :storage
|
@@ -27,7 +27,9 @@ module RDF::LDP
|
|
27
27
|
FORMAT_TERM = RDF::Vocab::DC11.format.freeze
|
28
28
|
|
29
29
|
##
|
30
|
-
# @param [
|
30
|
+
# @param [RDF::URI] subject_uri
|
31
|
+
# @param [RDF::Queryable] data
|
32
|
+
# @param [StorageAdapter] storage_adapter a class implementing the StorageAdapter interface
|
31
33
|
#
|
32
34
|
# @see RDF::LDP::Resource#initialize
|
33
35
|
def initialize(subject_uri,
|
@@ -42,7 +44,7 @@ module RDF::LDP
|
|
42
44
|
# @return [RDF::URI] uri with lexical representation
|
43
45
|
# 'http://www.w3.org/ns/ldp#NonRDFSource'
|
44
46
|
#
|
45
|
-
# @see
|
47
|
+
# @see https://www.w3.org/TR/ldp/#dfn-linked-data-platform-non-rdf-source
|
46
48
|
def self.to_uri
|
47
49
|
RDF::Vocab::LDP.NonRDFSource
|
48
50
|
end
|
@@ -111,7 +113,7 @@ module RDF::LDP
|
|
111
113
|
##
|
112
114
|
# Sets the MIME type for the resource in `metagraph`.
|
113
115
|
#
|
114
|
-
# @param [String] a string representing the content type for this LDP-NR.
|
116
|
+
# @param [String] content_type a string representing the content type for this LDP-NR.
|
115
117
|
# This SHOULD be a regisered MIME type.
|
116
118
|
#
|
117
119
|
# @return [StorageAdapter] the content type
|
data/lib/rdf/ldp/rdf_source.rb
CHANGED
@@ -25,7 +25,7 @@ module RDF::LDP
|
|
25
25
|
# but MAY be absent from (or in conflict with) the representation of its
|
26
26
|
# state in `#graph`.
|
27
27
|
#
|
28
|
-
# @see
|
28
|
+
# @see https://www.w3.org/TR/ldp/#dfn-linked-data-platform-rdf-source
|
29
29
|
# Definition of ldp:RDFSource in the LDP specification
|
30
30
|
class RDFSource < Resource
|
31
31
|
class << self
|
@@ -33,7 +33,7 @@ module RDF::LDP
|
|
33
33
|
# @return [RDF::URI] uri with lexical representation
|
34
34
|
# 'http://www.w3.org/ns/ldp#RDFSource'
|
35
35
|
#
|
36
|
-
# @see
|
36
|
+
# @see https://www.w3.org/TR/ldp/#dfn-linked-data-platform-rdf-source
|
37
37
|
def to_uri
|
38
38
|
RDF::Vocab::LDP.RDFSource
|
39
39
|
end
|
@@ -241,7 +241,7 @@ module RDF::LDP
|
|
241
241
|
#
|
242
242
|
# @raise [RDF::LDP::UnsupportedMediaType] if no appropriate reader is found
|
243
243
|
#
|
244
|
-
# @see
|
244
|
+
# @see https://www.rubydoc.info/github/rack/rack/file/SPEC#The_Input_Stream
|
245
245
|
# Documentation on input streams in the Rack SPEC
|
246
246
|
def parse_graph(input, content_type)
|
247
247
|
reader = RDF::Reader.for(content_type: content_type.to_s)
|
data/lib/rdf/ldp/resource.rb
CHANGED
@@ -81,8 +81,8 @@ module RDF::LDP
|
|
81
81
|
#
|
82
82
|
# resource.request(:put, 200, {}, {}) # RDF::LDP::MethodNotAllowed: put
|
83
83
|
#
|
84
|
-
# @see
|
85
|
-
# @see
|
84
|
+
# @see https://www.w3.org/TR/ldp/ Linked Data platform Specification
|
85
|
+
# @see https://www.w3.org/TR/ldp/#dfn-linked-data-platform-resource Definition
|
86
86
|
# of 'Resource' in LDP
|
87
87
|
class Resource
|
88
88
|
CONTAINS_URI = RDF::Vocab::LDP.contains.freeze
|
@@ -102,7 +102,7 @@ module RDF::LDP
|
|
102
102
|
# @return [RDF::URI] uri with lexical representation
|
103
103
|
# 'http://www.w3.org/ns/ldp#Resource'
|
104
104
|
#
|
105
|
-
# @see
|
105
|
+
# @see https://www.w3.org/TR/ldp/#dfn-linked-data-platform-resource
|
106
106
|
def to_uri
|
107
107
|
RDF::Vocab::LDP.Resource
|
108
108
|
end
|
@@ -110,7 +110,7 @@ module RDF::LDP
|
|
110
110
|
##
|
111
111
|
# Creates an unique id (URI Slug) for a resource.
|
112
112
|
#
|
113
|
-
# @note the current implementation uses
|
113
|
+
# @note the current implementation uses `SecureRandom#uuid`.
|
114
114
|
#
|
115
115
|
# @return [String] a unique ID
|
116
116
|
def gen_id
|
@@ -203,9 +203,9 @@ module RDF::LDP
|
|
203
203
|
##
|
204
204
|
# @abstract creates the resource
|
205
205
|
#
|
206
|
-
# @param [IO, File]
|
206
|
+
# @param [IO, File] _input input (usually from a Rack env's
|
207
207
|
# `rack.input` key) used to determine the Resource's initial state.
|
208
|
-
# @param [#to_s]
|
208
|
+
# @param [#to_s] _content_type a MIME content_type used to interpret the
|
209
209
|
# input. This MAY be used as a content type for the created Resource
|
210
210
|
# (especially for `LDP::NonRDFSource`s).
|
211
211
|
#
|
@@ -308,8 +308,8 @@ module RDF::LDP
|
|
308
308
|
# https://tools.ietf.org/html/rfc7232#section-3.1. See:
|
309
309
|
# https://github.com/ruby-rdf/rdf-ldp/issues/68
|
310
310
|
#
|
311
|
-
# @see
|
312
|
-
# @see
|
311
|
+
# @see https://www.w3.org/TR/ldp#h-ldpr-gen-etags LDP ETag clause for GET
|
312
|
+
# @see https://www.w3.org/TR/ldp#h-ldpr-put-precond LDP ETag clause for PUT
|
313
313
|
# @see https://tools.ietf.org/html/rfc7232#section-2.1
|
314
314
|
# Weak vs. strong validators
|
315
315
|
def etag
|
@@ -393,7 +393,7 @@ module RDF::LDP
|
|
393
393
|
# Runs the request and returns the object's desired HTTP response body,
|
394
394
|
# conforming to the Rack interfare.
|
395
395
|
#
|
396
|
-
# @see
|
396
|
+
# @see https://www.rubydoc.info/github/rack/rack/master/file/SPEC#The_Body
|
397
397
|
# Rack body documentation
|
398
398
|
def to_response
|
399
399
|
[]
|
@@ -536,10 +536,10 @@ module RDF::LDP
|
|
536
536
|
# @return [Array<String>] an array of link headers to add to the
|
537
537
|
# existing ones
|
538
538
|
#
|
539
|
-
# @see
|
540
|
-
# @see
|
541
|
-
# @see
|
542
|
-
# @see
|
539
|
+
# @see https://www.w3.org/TR/ldp/#h-ldpr-gen-linktypehdr
|
540
|
+
# @see https://www.w3.org/TR/ldp/#h-ldprs-are-ldpr
|
541
|
+
# @see https://www.w3.org/TR/ldp/#h-ldpnr-type
|
542
|
+
# @see https://www.w3.org/TR/ldp/#h-ldpc-linktypehdr
|
543
543
|
def link_headers
|
544
544
|
return [] unless is_a? RDF::LDP::Resource
|
545
545
|
headers = [link_type_header(RDF::LDP::Resource.to_uri)]
|
data/lib/rdf/ldp.rb
CHANGED
@@ -19,7 +19,7 @@ module RDF
|
|
19
19
|
# Rack servers.
|
20
20
|
#
|
21
21
|
# @see RDF::LDP::Resource
|
22
|
-
# @see
|
22
|
+
# @see https://www.w3.org/TR/ldp/ for the Linked Data platform specification
|
23
23
|
module LDP
|
24
24
|
InteractionModel.register(RDF::LDP::RDFSource, default: true)
|
25
25
|
InteractionModel.register(RDF::LDP::Container,
|
metadata
CHANGED
@@ -1,139 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-ldp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Johnson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.6'
|
20
|
-
- - "<"
|
17
|
+
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
19
|
+
version: '2.2'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.6'
|
30
|
-
- - "<"
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
26
|
+
version: '2.2'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: rdf
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
31
|
- - "~>"
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: '2
|
33
|
+
version: '3.2'
|
40
34
|
type: :runtime
|
41
35
|
prerelease: false
|
42
36
|
version_requirements: !ruby/object:Gem::Requirement
|
43
37
|
requirements:
|
44
38
|
- - "~>"
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version: '2
|
40
|
+
version: '3.2'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: rdf-turtle
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
50
44
|
requirements:
|
51
45
|
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: '2
|
47
|
+
version: '3.2'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
51
|
requirements:
|
58
52
|
- - "~>"
|
59
53
|
- !ruby/object:Gem::Version
|
60
|
-
version: '2
|
54
|
+
version: '3.2'
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
56
|
name: ld-patch
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
64
58
|
requirements:
|
65
59
|
- - "~>"
|
66
60
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
61
|
+
version: '3.2'
|
68
62
|
type: :runtime
|
69
63
|
prerelease: false
|
70
64
|
version_requirements: !ruby/object:Gem::Requirement
|
71
65
|
requirements:
|
72
66
|
- - "~>"
|
73
67
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
68
|
+
version: '3.2'
|
75
69
|
- !ruby/object:Gem::Dependency
|
76
70
|
name: rdf-vocab
|
77
71
|
requirement: !ruby/object:Gem::Requirement
|
78
72
|
requirements:
|
79
73
|
- - "~>"
|
80
74
|
- !ruby/object:Gem::Version
|
81
|
-
version: '2
|
75
|
+
version: '3.2'
|
82
76
|
type: :runtime
|
83
77
|
prerelease: false
|
84
78
|
version_requirements: !ruby/object:Gem::Requirement
|
85
79
|
requirements:
|
86
80
|
- - "~>"
|
87
81
|
- !ruby/object:Gem::Version
|
88
|
-
version: '2
|
82
|
+
version: '3.2'
|
89
83
|
- !ruby/object:Gem::Dependency
|
90
84
|
name: rack-linkeddata
|
91
85
|
requirement: !ruby/object:Gem::Requirement
|
92
86
|
requirements:
|
93
87
|
- - "~>"
|
94
88
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
89
|
+
version: '3.1'
|
96
90
|
type: :runtime
|
97
91
|
prerelease: false
|
98
92
|
version_requirements: !ruby/object:Gem::Requirement
|
99
93
|
requirements:
|
100
94
|
- - "~>"
|
101
95
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
96
|
+
version: '3.1'
|
103
97
|
- !ruby/object:Gem::Dependency
|
104
98
|
name: json-ld
|
105
99
|
requirement: !ruby/object:Gem::Requirement
|
106
100
|
requirements:
|
107
101
|
- - "~>"
|
108
102
|
- !ruby/object:Gem::Version
|
109
|
-
version: '2
|
103
|
+
version: '3.2'
|
110
104
|
type: :runtime
|
111
105
|
prerelease: false
|
112
106
|
version_requirements: !ruby/object:Gem::Requirement
|
113
107
|
requirements:
|
114
108
|
- - "~>"
|
115
109
|
- !ruby/object:Gem::Version
|
116
|
-
version: '2
|
110
|
+
version: '3.2'
|
117
111
|
- !ruby/object:Gem::Dependency
|
118
112
|
name: sinatra
|
119
113
|
requirement: !ruby/object:Gem::Requirement
|
120
114
|
requirements:
|
121
|
-
- - "
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
version: '1.4'
|
124
|
-
- - "<"
|
115
|
+
- - "~>"
|
125
116
|
- !ruby/object:Gem::Version
|
126
|
-
version: '
|
117
|
+
version: '2.1'
|
127
118
|
type: :runtime
|
128
119
|
prerelease: false
|
129
120
|
version_requirements: !ruby/object:Gem::Requirement
|
130
121
|
requirements:
|
131
|
-
- - "
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: '1.4'
|
134
|
-
- - "<"
|
122
|
+
- - "~>"
|
135
123
|
- !ruby/object:Gem::Version
|
136
|
-
version: '
|
124
|
+
version: '2.1'
|
137
125
|
- !ruby/object:Gem::Dependency
|
138
126
|
name: link_header
|
139
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -160,210 +148,210 @@ dependencies:
|
|
160
148
|
requirements:
|
161
149
|
- - "~>"
|
162
150
|
- !ruby/object:Gem::Version
|
163
|
-
version: '2
|
151
|
+
version: '3.2'
|
164
152
|
type: :development
|
165
153
|
prerelease: false
|
166
154
|
version_requirements: !ruby/object:Gem::Requirement
|
167
155
|
requirements:
|
168
156
|
- - "~>"
|
169
157
|
- !ruby/object:Gem::Version
|
170
|
-
version: '2
|
158
|
+
version: '3.2'
|
171
159
|
- !ruby/object:Gem::Dependency
|
172
160
|
name: rdf-rdfxml
|
173
161
|
requirement: !ruby/object:Gem::Requirement
|
174
162
|
requirements:
|
175
163
|
- - "~>"
|
176
164
|
- !ruby/object:Gem::Version
|
177
|
-
version: '2
|
165
|
+
version: '3.2'
|
178
166
|
type: :development
|
179
167
|
prerelease: false
|
180
168
|
version_requirements: !ruby/object:Gem::Requirement
|
181
169
|
requirements:
|
182
170
|
- - "~>"
|
183
171
|
- !ruby/object:Gem::Version
|
184
|
-
version: '2
|
172
|
+
version: '3.2'
|
185
173
|
- !ruby/object:Gem::Dependency
|
186
174
|
name: rdf-rdfa
|
187
175
|
requirement: !ruby/object:Gem::Requirement
|
188
176
|
requirements:
|
189
177
|
- - "~>"
|
190
178
|
- !ruby/object:Gem::Version
|
191
|
-
version: '2
|
179
|
+
version: '3.2'
|
192
180
|
type: :development
|
193
181
|
prerelease: false
|
194
182
|
version_requirements: !ruby/object:Gem::Requirement
|
195
183
|
requirements:
|
196
184
|
- - "~>"
|
197
185
|
- !ruby/object:Gem::Version
|
198
|
-
version: '2
|
186
|
+
version: '3.2'
|
199
187
|
- !ruby/object:Gem::Dependency
|
200
188
|
name: rdf-xsd
|
201
189
|
requirement: !ruby/object:Gem::Requirement
|
202
190
|
requirements:
|
203
191
|
- - "~>"
|
204
192
|
- !ruby/object:Gem::Version
|
205
|
-
version: '2
|
193
|
+
version: '3.2'
|
206
194
|
type: :development
|
207
195
|
prerelease: false
|
208
196
|
version_requirements: !ruby/object:Gem::Requirement
|
209
197
|
requirements:
|
210
198
|
- - "~>"
|
211
199
|
- !ruby/object:Gem::Version
|
212
|
-
version: '2
|
200
|
+
version: '3.2'
|
213
201
|
- !ruby/object:Gem::Dependency
|
214
202
|
name: rest-client
|
215
203
|
requirement: !ruby/object:Gem::Requirement
|
216
204
|
requirements:
|
217
205
|
- - "~>"
|
218
206
|
- !ruby/object:Gem::Version
|
219
|
-
version: '1
|
207
|
+
version: '2.1'
|
220
208
|
type: :development
|
221
209
|
prerelease: false
|
222
210
|
version_requirements: !ruby/object:Gem::Requirement
|
223
211
|
requirements:
|
224
212
|
- - "~>"
|
225
213
|
- !ruby/object:Gem::Version
|
226
|
-
version: '1
|
214
|
+
version: '2.1'
|
227
215
|
- !ruby/object:Gem::Dependency
|
228
216
|
name: rspec
|
229
217
|
requirement: !ruby/object:Gem::Requirement
|
230
218
|
requirements:
|
231
219
|
- - "~>"
|
232
220
|
- !ruby/object:Gem::Version
|
233
|
-
version: '3.
|
221
|
+
version: '3.10'
|
234
222
|
type: :development
|
235
223
|
prerelease: false
|
236
224
|
version_requirements: !ruby/object:Gem::Requirement
|
237
225
|
requirements:
|
238
226
|
- - "~>"
|
239
227
|
- !ruby/object:Gem::Version
|
240
|
-
version: '3.
|
228
|
+
version: '3.10'
|
241
229
|
- !ruby/object:Gem::Dependency
|
242
230
|
name: rubocop
|
243
231
|
requirement: !ruby/object:Gem::Requirement
|
244
232
|
requirements:
|
245
233
|
- - "~>"
|
246
234
|
- !ruby/object:Gem::Version
|
247
|
-
version: '
|
235
|
+
version: '1.23'
|
248
236
|
type: :development
|
249
237
|
prerelease: false
|
250
238
|
version_requirements: !ruby/object:Gem::Requirement
|
251
239
|
requirements:
|
252
240
|
- - "~>"
|
253
241
|
- !ruby/object:Gem::Version
|
254
|
-
version: '
|
242
|
+
version: '1.23'
|
255
243
|
- !ruby/object:Gem::Dependency
|
256
244
|
name: rubocop-rspec
|
257
245
|
requirement: !ruby/object:Gem::Requirement
|
258
246
|
requirements:
|
259
247
|
- - "~>"
|
260
248
|
- !ruby/object:Gem::Version
|
261
|
-
version: '
|
249
|
+
version: '2.6'
|
262
250
|
type: :development
|
263
251
|
prerelease: false
|
264
252
|
version_requirements: !ruby/object:Gem::Requirement
|
265
253
|
requirements:
|
266
254
|
- - "~>"
|
267
255
|
- !ruby/object:Gem::Version
|
268
|
-
version: '
|
256
|
+
version: '2.6'
|
269
257
|
- !ruby/object:Gem::Dependency
|
270
258
|
name: rack-test
|
271
259
|
requirement: !ruby/object:Gem::Requirement
|
272
260
|
requirements:
|
273
261
|
- - "~>"
|
274
262
|
- !ruby/object:Gem::Version
|
275
|
-
version: '
|
263
|
+
version: '1.1'
|
276
264
|
type: :development
|
277
265
|
prerelease: false
|
278
266
|
version_requirements: !ruby/object:Gem::Requirement
|
279
267
|
requirements:
|
280
268
|
- - "~>"
|
281
269
|
- !ruby/object:Gem::Version
|
282
|
-
version: '
|
270
|
+
version: '1.1'
|
283
271
|
- !ruby/object:Gem::Dependency
|
284
272
|
name: rspec-its
|
285
273
|
requirement: !ruby/object:Gem::Requirement
|
286
274
|
requirements:
|
287
275
|
- - "~>"
|
288
276
|
- !ruby/object:Gem::Version
|
289
|
-
version: '1.
|
277
|
+
version: '1.3'
|
290
278
|
type: :development
|
291
279
|
prerelease: false
|
292
280
|
version_requirements: !ruby/object:Gem::Requirement
|
293
281
|
requirements:
|
294
282
|
- - "~>"
|
295
283
|
- !ruby/object:Gem::Version
|
296
|
-
version: '1.
|
284
|
+
version: '1.3'
|
297
285
|
- !ruby/object:Gem::Dependency
|
298
286
|
name: timecop
|
299
287
|
requirement: !ruby/object:Gem::Requirement
|
300
288
|
requirements:
|
301
289
|
- - "~>"
|
302
290
|
- !ruby/object:Gem::Version
|
303
|
-
version: '0.
|
291
|
+
version: '0.9'
|
304
292
|
type: :development
|
305
293
|
prerelease: false
|
306
294
|
version_requirements: !ruby/object:Gem::Requirement
|
307
295
|
requirements:
|
308
296
|
- - "~>"
|
309
297
|
- !ruby/object:Gem::Version
|
310
|
-
version: '0.
|
298
|
+
version: '0.9'
|
311
299
|
- !ruby/object:Gem::Dependency
|
312
300
|
name: webmock
|
313
301
|
requirement: !ruby/object:Gem::Requirement
|
314
302
|
requirements:
|
315
303
|
- - "~>"
|
316
304
|
- !ruby/object:Gem::Version
|
317
|
-
version: '
|
305
|
+
version: '3.14'
|
318
306
|
type: :development
|
319
307
|
prerelease: false
|
320
308
|
version_requirements: !ruby/object:Gem::Requirement
|
321
309
|
requirements:
|
322
310
|
- - "~>"
|
323
311
|
- !ruby/object:Gem::Version
|
324
|
-
version: '
|
312
|
+
version: '3.14'
|
325
313
|
- !ruby/object:Gem::Dependency
|
326
314
|
name: yard
|
327
315
|
requirement: !ruby/object:Gem::Requirement
|
328
316
|
requirements:
|
329
317
|
- - "~>"
|
330
318
|
- !ruby/object:Gem::Version
|
331
|
-
version: '0.
|
319
|
+
version: '0.9'
|
332
320
|
type: :development
|
333
321
|
prerelease: false
|
334
322
|
version_requirements: !ruby/object:Gem::Requirement
|
335
323
|
requirements:
|
336
324
|
- - "~>"
|
337
325
|
- !ruby/object:Gem::Version
|
338
|
-
version: '0.
|
326
|
+
version: '0.9'
|
339
327
|
- !ruby/object:Gem::Dependency
|
340
328
|
name: faraday
|
341
329
|
requirement: !ruby/object:Gem::Requirement
|
342
330
|
requirements:
|
343
|
-
- - "
|
331
|
+
- - "~>"
|
344
332
|
- !ruby/object:Gem::Version
|
345
|
-
version: '
|
333
|
+
version: '1.1'
|
346
334
|
type: :development
|
347
335
|
prerelease: false
|
348
336
|
version_requirements: !ruby/object:Gem::Requirement
|
349
337
|
requirements:
|
350
|
-
- - "
|
338
|
+
- - "~>"
|
351
339
|
- !ruby/object:Gem::Version
|
352
|
-
version: '
|
340
|
+
version: '1.1'
|
353
341
|
- !ruby/object:Gem::Dependency
|
354
342
|
name: capybara_discoball
|
355
343
|
requirement: !ruby/object:Gem::Requirement
|
356
344
|
requirements:
|
357
|
-
- - "
|
345
|
+
- - "~>"
|
358
346
|
- !ruby/object:Gem::Version
|
359
|
-
version:
|
347
|
+
version: 0.1.0
|
360
348
|
type: :development
|
361
349
|
prerelease: false
|
362
350
|
version_requirements: !ruby/object:Gem::Requirement
|
363
351
|
requirements:
|
364
|
-
- - "
|
352
|
+
- - "~>"
|
365
353
|
- !ruby/object:Gem::Version
|
366
|
-
version:
|
354
|
+
version: 0.1.0
|
367
355
|
- !ruby/object:Gem::Dependency
|
368
356
|
name: ldp_testsuite_wrapper
|
369
357
|
requirement: !ruby/object:Gem::Requirement
|
@@ -413,11 +401,11 @@ files:
|
|
413
401
|
- lib/rdf/ldp/spec/resource.rb
|
414
402
|
- lib/rdf/ldp/storage_adapters/file_storage_adapter.rb
|
415
403
|
- lib/rdf/ldp/version.rb
|
416
|
-
homepage:
|
404
|
+
homepage: https://ruby-rdf.github.com/
|
417
405
|
licenses:
|
418
406
|
- Unlicense
|
419
407
|
metadata: {}
|
420
|
-
post_install_message:
|
408
|
+
post_install_message:
|
421
409
|
rdoc_options: []
|
422
410
|
require_paths:
|
423
411
|
- lib
|
@@ -426,16 +414,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
426
414
|
requirements:
|
427
415
|
- - ">="
|
428
416
|
- !ruby/object:Gem::Version
|
429
|
-
version: 2.
|
417
|
+
version: '2.6'
|
430
418
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
431
419
|
requirements:
|
432
420
|
- - ">="
|
433
421
|
- !ruby/object:Gem::Version
|
434
422
|
version: '0'
|
435
423
|
requirements: []
|
436
|
-
|
437
|
-
|
438
|
-
signing_key:
|
424
|
+
rubygems_version: 3.1.4
|
425
|
+
signing_key:
|
439
426
|
specification_version: 4
|
440
427
|
summary: A suite of LDP software and middleware for RDF.rb.
|
441
428
|
test_files: []
|