rdf-ldp 0.2.0 → 0.3.0
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/CHANGELOG.md +18 -0
- data/IMPLEMENTATION.md +280 -0
- data/README.md +72 -11
- data/VERSION +1 -1
- data/bin/lamprey +9 -0
- data/lib/rdf/ldp/container.rb +30 -0
- data/lib/rdf/ldp/direct_container.rb +61 -14
- data/lib/rdf/ldp/indirect_container.rb +81 -0
- data/lib/rdf/ldp/non_rdf_source.rb +237 -0
- data/lib/rdf/ldp/rdf_source.rb +84 -21
- data/lib/rdf/ldp/resource.rb +91 -5
- data/lib/rdf/ldp.rb +44 -1
- metadata +21 -3
data/lib/rdf/ldp.rb
CHANGED
@@ -11,6 +11,14 @@ require 'rdf/ldp/direct_container'
|
|
11
11
|
require 'rdf/ldp/indirect_container'
|
12
12
|
|
13
13
|
module RDF
|
14
|
+
##
|
15
|
+
# This module implements a basic domain model for Linked Data Platform (LDP).
|
16
|
+
# Its classes allow CRUD operations on LDP RDFSources, NonRDFSources and
|
17
|
+
# Containers, while presenting an interface appropriate for consumption by
|
18
|
+
# Rack servers.
|
19
|
+
#
|
20
|
+
# @see RDF::LDP::Resource
|
21
|
+
# @see http://www.w3.org/TR/ldp/ for the Linked Data platform specification
|
14
22
|
module LDP
|
15
23
|
##
|
16
24
|
# Interaction models are in reverse order of preference for POST/PUT
|
@@ -20,7 +28,7 @@ module RDF
|
|
20
28
|
RDF::Vocab::LDP.Resource => RDF::LDP::RDFSource,
|
21
29
|
RDF::LDP::RDFSource.to_uri => RDF::LDP::RDFSource,
|
22
30
|
RDF::LDP::Container.to_uri => RDF::LDP::Container,
|
23
|
-
RDF::
|
31
|
+
RDF::Vocab::LDP.BasicContainer => RDF::LDP::Container,
|
24
32
|
RDF::LDP::DirectContainer.to_uri => RDF::LDP::DirectContainer,
|
25
33
|
RDF::LDP::IndirectContainer.to_uri => RDF::LDP::IndirectContainer,
|
26
34
|
RDF::LDP::NonRDFSource.to_uri => RDF::LDP::NonRDFSource
|
@@ -38,6 +46,9 @@ module RDF
|
|
38
46
|
# A base class for HTTP request errors.
|
39
47
|
#
|
40
48
|
# This and its subclasses are caught and handled by Rack::LDP middleware.
|
49
|
+
# When a `RequestError` is caught by server middleware, its `#status` can be
|
50
|
+
# used as a response code and `#headers` may be added to (or replace) the
|
51
|
+
# existing HTTP headers.
|
41
52
|
class RequestError < RuntimeError
|
42
53
|
STATUS = 500
|
43
54
|
|
@@ -52,34 +63,66 @@ module RDF
|
|
52
63
|
end
|
53
64
|
end
|
54
65
|
|
66
|
+
##
|
67
|
+
# An error for 400 Bad Request responses
|
68
|
+
#
|
69
|
+
# @see RDF::LDP::RequestError
|
55
70
|
class BadRequest < RequestError
|
56
71
|
STATUS = 400
|
57
72
|
end
|
58
73
|
|
74
|
+
##
|
75
|
+
# An error for 404 NotFound responses
|
76
|
+
#
|
77
|
+
# @see RDF::LDP::RequestError
|
59
78
|
class NotFound < RequestError
|
60
79
|
STATUS = 404
|
61
80
|
end
|
62
81
|
|
82
|
+
##
|
83
|
+
# An error for 405 MethodNotAllowed responses
|
84
|
+
#
|
85
|
+
# @see RDF::LDP::RequestError
|
63
86
|
class MethodNotAllowed < RequestError
|
64
87
|
STATUS = 405
|
65
88
|
end
|
66
89
|
|
90
|
+
##
|
91
|
+
# An error for 406 NotAcceptable responses
|
92
|
+
#
|
93
|
+
# @see RDF::LDP::RequestError
|
67
94
|
class NotAcceptable < RequestError
|
68
95
|
STATUS = 406
|
69
96
|
end
|
70
97
|
|
98
|
+
##
|
99
|
+
# An error for 409 Conflict responses
|
100
|
+
#
|
101
|
+
# @see RDF::LDP::RequestError
|
71
102
|
class Conflict < RequestError
|
72
103
|
STATUS = 409
|
73
104
|
end
|
74
105
|
|
106
|
+
##
|
107
|
+
# An error for 410 Gone responses
|
108
|
+
#
|
109
|
+
# @see RDF::LDP::RequestError
|
75
110
|
class Gone < RequestError
|
76
111
|
STATUS = 410
|
77
112
|
end
|
78
113
|
|
114
|
+
##
|
115
|
+
# An error for 412 Precondition Failed responses
|
116
|
+
#
|
117
|
+
# @see RDF::LDP::RequestError
|
79
118
|
class PreconditionFailed < RequestError
|
80
119
|
STATUS = 412
|
81
120
|
end
|
82
121
|
|
122
|
+
##
|
123
|
+
# An error for 415 Unsupported Media Type responses
|
124
|
+
#
|
125
|
+
# @see RDF::LDP::RequestError
|
83
126
|
class UnsupportedMediaType < RequestError
|
84
127
|
STATUS = 415
|
85
128
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-ldp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ld-patch
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.1'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rdf-vocab
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -271,15 +285,19 @@ dependencies:
|
|
271
285
|
description: Implements a Linked Data Platform domain model, Rack middleware for server
|
272
286
|
implementers, and a simple Sinatra-based server for RDF.rb
|
273
287
|
email: public-rdf-ruby@w3.org
|
274
|
-
executables:
|
288
|
+
executables:
|
289
|
+
- lamprey
|
275
290
|
extensions: []
|
276
291
|
extra_rdoc_files: []
|
277
292
|
files:
|
278
293
|
- AUTHORS
|
294
|
+
- CHANGELOG.md
|
279
295
|
- CREDITS
|
296
|
+
- IMPLEMENTATION.md
|
280
297
|
- README.md
|
281
298
|
- UNLICENSE
|
282
299
|
- VERSION
|
300
|
+
- bin/lamprey
|
283
301
|
- lib/rack/ldp.rb
|
284
302
|
- lib/rdf/ldp.rb
|
285
303
|
- lib/rdf/ldp/container.rb
|