roadforest 0.5 → 0.7
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/examples/file-management.rb +70 -58
- data/lib/roadforest/application.rb +9 -17
- data/lib/roadforest/application/dispatcher.rb +76 -9
- data/lib/roadforest/application/parameters.rb +9 -1
- data/lib/roadforest/application/path-provider.rb +30 -3
- data/lib/roadforest/application/route-adapter.rb +96 -14
- data/lib/roadforest/application/services-host.rb +21 -3
- data/lib/roadforest/augment/affordance.rb +82 -11
- data/lib/roadforest/augment/augmentation.rb +24 -6
- data/lib/roadforest/augment/augmenter.rb +12 -3
- data/lib/roadforest/authorization.rb +7 -229
- data/lib/roadforest/authorization/auth-entity.rb +26 -0
- data/lib/roadforest/authorization/authentication-chain.rb +79 -0
- data/lib/roadforest/authorization/default-authentication-store.rb +33 -0
- data/lib/roadforest/authorization/grant-builder.rb +23 -0
- data/lib/roadforest/authorization/grants-holder.rb +58 -0
- data/lib/roadforest/authorization/manager.rb +85 -0
- data/lib/roadforest/authorization/policy.rb +19 -0
- data/lib/roadforest/graph/access-manager.rb +25 -2
- data/lib/roadforest/graph/focus-list.rb +4 -0
- data/lib/roadforest/graph/graph-focus.rb +30 -13
- data/lib/roadforest/graph/nav-affordance-builder.rb +62 -0
- data/lib/roadforest/graph/normalization.rb +3 -3
- data/lib/roadforest/graph/path-vocabulary.rb +64 -0
- data/lib/roadforest/graph/post-focus.rb +5 -0
- data/lib/roadforest/graph/vocabulary.rb +4 -1
- data/lib/roadforest/http/adapters/excon.rb +4 -0
- data/lib/roadforest/http/graph-transfer.rb +17 -1
- data/lib/roadforest/http/keychain.rb +121 -33
- data/lib/roadforest/http/user-agent.rb +5 -3
- data/lib/roadforest/interface/application.rb +25 -8
- data/lib/roadforest/interface/rdf.rb +114 -15
- data/lib/roadforest/interface/utility.rb +3 -0
- data/lib/roadforest/interface/utility/backfill.rb +63 -0
- data/lib/roadforest/interface/utility/grant-list.rb +45 -0
- data/lib/roadforest/interface/utility/grant.rb +22 -0
- data/lib/roadforest/interfaces.rb +1 -0
- data/lib/roadforest/path-matcher.rb +471 -0
- data/lib/roadforest/remote-host.rb +159 -35
- data/lib/roadforest/resource/read-only.rb +23 -4
- data/lib/roadforest/server.rb +32 -3
- data/lib/roadforest/source-rigor/graph-store.rb +0 -2
- data/lib/roadforest/source-rigor/rigorous-access.rb +138 -21
- data/lib/roadforest/templates/affordance-property-values.haml +3 -0
- data/lib/roadforest/templates/rdfpost-curie.haml +1 -1
- data/lib/roadforest/test-support/matchers.rb +41 -12
- data/lib/roadforest/test-support/remote-host.rb +3 -3
- data/lib/roadforest/type-handlers/rdfa-writer/environment-decorator.rb +1 -1
- data/lib/roadforest/type-handlers/rdfa-writer/render-engine.rb +40 -27
- data/lib/roadforest/type-handlers/rdfa.rb +10 -3
- data/lib/roadforest/utility/class-registry.rb +44 -4
- data/spec/affordance-augmenter.rb +46 -19
- data/spec/affordances-flow.rb +46 -30
- data/spec/authorization.rb +16 -4
- data/spec/client.rb +22 -4
- data/spec/focus-list.rb +24 -0
- data/spec/full-integration.rb +8 -3
- data/spec/graph-store.rb +8 -0
- data/spec/keychain.rb +18 -14
- data/spec/rdf-normalization.rb +32 -6
- data/spec/update-focus.rb +36 -39
- metadata +19 -5
data/spec/update-focus.rb
CHANGED
@@ -19,10 +19,18 @@ describe RoadForest::Graph::GraphFocus, "with UpdateManager" do
|
|
19
19
|
::RDF::Statement.from [ context_node, Voc[:a], 7 ]
|
20
20
|
end
|
21
21
|
|
22
|
+
let :simple_pattern do
|
23
|
+
::RDF::Query::Pattern.from(simple_statement.to_hash.merge(:context => :context))
|
24
|
+
end
|
25
|
+
|
22
26
|
let :blank_node_statement do
|
23
27
|
::RDF::Statement.from [ context_node, Voc[:b], blank_node ]
|
24
28
|
end
|
25
29
|
|
30
|
+
let :blank_node_pattern do
|
31
|
+
::RDF::Query::Pattern.from(blank_node_statement.to_hash.merge(:object => nil, :context => :context))
|
32
|
+
end
|
33
|
+
|
26
34
|
let :context_statements do
|
27
35
|
[
|
28
36
|
simple_statement,
|
@@ -67,6 +75,7 @@ describe RoadForest::Graph::GraphFocus, "with UpdateManager" do
|
|
67
75
|
access.source_graph = source_graph
|
68
76
|
access.target_graph = target_graph
|
69
77
|
access.rigor = source_rigor
|
78
|
+
access.reset
|
70
79
|
end
|
71
80
|
end
|
72
81
|
|
@@ -84,35 +93,29 @@ describe RoadForest::Graph::GraphFocus, "with UpdateManager" do
|
|
84
93
|
it "should copy entire context when resource is written" do
|
85
94
|
updater[Voc[:a]] = 17
|
86
95
|
|
87
|
-
|
96
|
+
target_graph.query(:object => RoadForest::Graph::Vocabulary::RF[:Impulse]).should be_empty
|
97
|
+
target_graph.query([context_node, Voc[:a], 17, :context]).should_not be_empty
|
98
|
+
target_graph.query(simple_pattern).should be_empty
|
88
99
|
|
89
|
-
|
90
|
-
resource_graph.query(simple_statement).should be_empty
|
91
|
-
|
92
|
-
resource_graph.query(blank_node_statement).should_not be_empty
|
93
|
-
resource_graph.query([context_node, Voc[:a], 17]).should_not be_empty
|
100
|
+
target_graph.query(blank_node_pattern).should_not be_empty
|
94
101
|
end
|
95
102
|
|
96
103
|
it "should copy entire context when blank node is written to" do
|
97
104
|
updater[Voc[:b]][Voc[:c]] = "jagular" #they drop from trees
|
98
105
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
resource_graph.query(simple_statement).should_not be_empty
|
103
|
-
resource_graph.query([nil, Voc[:c], "jagular", context_node]).should_not be_empty
|
106
|
+
target_graph.query(blank_node_pattern).should_not be_empty
|
107
|
+
target_graph.query(simple_pattern).should_not be_empty
|
108
|
+
target_graph.query([nil, Voc[:c], "jagular", :context]).should_not be_empty
|
104
109
|
end
|
105
110
|
|
106
111
|
it "should trigger (only one) Store query just by writing" do
|
107
112
|
updater[Voc[:d]] = 14
|
108
113
|
updater[Voc[:e]] = "fourteen"
|
109
114
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
resource_graph.query([context_node, Voc[:d], 14]).should_not be_empty
|
115
|
-
resource_graph.query([context_node, Voc[:e], "fourteen"]).should_not be_empty
|
115
|
+
target_graph.query(blank_node_pattern).should_not be_empty
|
116
|
+
target_graph.query(simple_pattern).should_not be_empty
|
117
|
+
target_graph.query([context_node, Voc[:d], 14, :context]).should_not be_empty
|
118
|
+
target_graph.query([context_node, Voc[:e], "fourteen", :context]).should_not be_empty
|
116
119
|
end
|
117
120
|
|
118
121
|
it "should return statements that have been written" do
|
@@ -120,38 +123,32 @@ describe RoadForest::Graph::GraphFocus, "with UpdateManager" do
|
|
120
123
|
updater[Voc[:a]].should == 17
|
121
124
|
end
|
122
125
|
|
123
|
-
it "should not copy contexts simply because they're read from" do
|
124
|
-
updater[Voc[:a]].should == 7
|
125
|
-
target_graph.should be_empty
|
126
|
-
end
|
127
|
-
|
128
126
|
it "should add a list to the target graph" do
|
129
|
-
list_focus = updater.add_node(Voc[:list])
|
130
127
|
nodes = []
|
131
|
-
list_focus.
|
132
|
-
|
133
|
-
|
134
|
-
|
128
|
+
list_focus = updater.add_list(Voc[:list]) do |list_focus|
|
129
|
+
list_focus.append_node do |node|
|
130
|
+
nodes << node
|
131
|
+
node[Voc[:d]] = 107
|
132
|
+
end
|
135
133
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
134
|
+
list_focus.append_node do |node|
|
135
|
+
nodes << node
|
136
|
+
node[Voc[:d]] = 109
|
137
|
+
end
|
140
138
|
|
141
|
-
|
142
|
-
|
143
|
-
|
139
|
+
list_focus.append_node do |node|
|
140
|
+
nodes << node
|
141
|
+
node[Voc[:d]] = 113
|
142
|
+
end
|
144
143
|
end
|
145
144
|
|
146
|
-
resource_graph = ::RDF::Graph.new(context_node, :data => target_graph)
|
147
|
-
|
148
145
|
list = ::RDF::List.new(list_focus.subject, target_graph)
|
149
146
|
|
150
147
|
list[0].should == nodes[0].subject
|
151
148
|
list[1].should == nodes[1].subject
|
152
149
|
list[2].should == nodes[2].subject
|
153
|
-
|
154
|
-
|
155
|
-
|
150
|
+
target_graph.query([nodes[0].subject, Voc[:d], 107, :context]).should_not be_empty
|
151
|
+
target_graph.query([nodes[1].subject, Voc[:d], 109, :context]).should_not be_empty
|
152
|
+
target_graph.query([nodes[2].subject, Voc[:d], 113, :context]).should_not be_empty
|
156
153
|
end
|
157
154
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roadforest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Judson Lester
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.
|
75
|
+
version: 2.3.6
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 2.
|
82
|
+
version: 2.3.6
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: excon
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -135,6 +135,18 @@ executables: []
|
|
135
135
|
extensions: []
|
136
136
|
extra_rdoc_files: []
|
137
137
|
files:
|
138
|
+
- lib/roadforest/authorization/auth-entity.rb
|
139
|
+
- lib/roadforest/authorization/authentication-chain.rb
|
140
|
+
- lib/roadforest/authorization/default-authentication-store.rb
|
141
|
+
- lib/roadforest/authorization/grant-builder.rb
|
142
|
+
- lib/roadforest/authorization/grants-holder.rb
|
143
|
+
- lib/roadforest/authorization/manager.rb
|
144
|
+
- lib/roadforest/authorization/policy.rb
|
145
|
+
- lib/roadforest/graph/nav-affordance-builder.rb
|
146
|
+
- lib/roadforest/interface/utility.rb
|
147
|
+
- lib/roadforest/interface/utility/backfill.rb
|
148
|
+
- lib/roadforest/interface/utility/grant-list.rb
|
149
|
+
- lib/roadforest/interface/utility/grant.rb
|
138
150
|
- lib/roadforest-client.rb
|
139
151
|
- lib/roadforest/http/message.rb
|
140
152
|
- lib/roadforest/http/graph-response.rb
|
@@ -149,9 +161,11 @@ files:
|
|
149
161
|
- lib/roadforest/graph/etagging.rb
|
150
162
|
- lib/roadforest/graph/post-focus.rb
|
151
163
|
- lib/roadforest/graph/vocabulary.rb
|
164
|
+
- lib/roadforest/graph/path-vocabulary.rb
|
152
165
|
- lib/roadforest/graph/document.rb
|
153
166
|
- lib/roadforest/graph/access-manager.rb
|
154
167
|
- lib/roadforest/graph.rb
|
168
|
+
- lib/roadforest/path-matcher.rb
|
155
169
|
- lib/roadforest/resource/role/writable.rb
|
156
170
|
- lib/roadforest/resource/role/has-children.rb
|
157
171
|
- lib/roadforest/resource/list.rb
|
@@ -276,7 +290,7 @@ rdoc_options:
|
|
276
290
|
- --main
|
277
291
|
- doc/README
|
278
292
|
- --title
|
279
|
-
- roadforest-0.
|
293
|
+
- roadforest-0.7 Documentation
|
280
294
|
require_paths:
|
281
295
|
- lib/
|
282
296
|
required_ruby_version: !ruby/object:Gem::Requirement
|