roadforest 0.0.1 → 0.0.2
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.
- data/examples/file-management.rb +2 -1
- data/lib/roadforest/application/dispatcher.rb +12 -2
- data/lib/roadforest/application/services-host.rb +1 -1
- data/lib/roadforest/application.rb +12 -5
- data/lib/roadforest/blob-model.rb +7 -1
- data/lib/roadforest/content-handling/engine.rb +4 -1
- data/lib/roadforest/content-handling/type-handlers/jsonld.rb +25 -17
- data/lib/roadforest/http/adapters/excon.rb +1 -1
- data/lib/roadforest/http/graph-response.rb +18 -4
- data/lib/roadforest/http/graph-transfer.rb +52 -8
- data/lib/roadforest/http/message.rb +10 -1
- data/lib/roadforest/model.rb +17 -4
- data/lib/roadforest/rdf/context-fascade.rb +80 -5
- data/lib/roadforest/rdf/etagging.rb +53 -0
- data/lib/roadforest/rdf/focus-list.rb +47 -5
- data/lib/roadforest/rdf/graph-copier.rb +4 -5
- data/lib/roadforest/rdf/graph-focus.rb +38 -14
- data/lib/roadforest/rdf/graph-reading.rb +102 -47
- data/lib/roadforest/rdf/graph-store.rb +12 -8
- data/lib/roadforest/rdf/investigation.rb +0 -1
- data/lib/roadforest/rdf/normalization.rb +37 -4
- data/lib/roadforest/rdf/resource-pattern.rb +1 -0
- data/lib/roadforest/rdf/source-rigor/credence-annealer.rb +2 -0
- data/lib/roadforest/rdf/source-rigor/http-investigator.rb +12 -14
- data/lib/roadforest/rdf/update-focus.rb +7 -62
- data/lib/roadforest/remote-host.rb +21 -10
- data/lib/roadforest/resource/rdf/read-only.rb +4 -0
- data/lib/roadforest/server.rb +22 -0
- data/lib/roadforest/test-support/dispatcher-facade.rb +1 -1
- data/lib/roadforest/test-support/http-client.rb +8 -0
- data/spec/client.rb +20 -2
- data/spec/credence-annealer.rb +1 -1
- data/spec/excon-adapater.rb +30 -0
- data/spec/focus-list.rb +34 -0
- data/spec/form-parsing.rb +1 -0
- data/spec/full-integration.rb +193 -0
- data/spec/rdf-normalization.rb +17 -0
- data/spec/update-focus.rb +37 -0
- metadata +22 -17
- data/lib/roadforest/rdf/focus-wrapping.rb +0 -30
@@ -9,8 +9,12 @@ module RoadForest
|
|
9
9
|
include RDF::Normalization
|
10
10
|
|
11
11
|
def initialize(well_known_url)
|
12
|
-
|
13
|
-
|
12
|
+
self.url = well_known_url
|
13
|
+
end
|
14
|
+
attr_reader :url
|
15
|
+
|
16
|
+
def url=(string)
|
17
|
+
@url = normalize_resource(string)
|
14
18
|
end
|
15
19
|
|
16
20
|
def build_graph_store
|
@@ -19,7 +23,7 @@ module RoadForest
|
|
19
23
|
|
20
24
|
attr_writer :http_client
|
21
25
|
def http_client
|
22
|
-
@http_client ||= HTTP::ExconAdapter.new(
|
26
|
+
@http_client ||= HTTP::ExconAdapter.new(url)
|
23
27
|
end
|
24
28
|
|
25
29
|
def graph_transfer
|
@@ -42,7 +46,8 @@ module RoadForest
|
|
42
46
|
end
|
43
47
|
|
44
48
|
def anneal(focus)
|
45
|
-
|
49
|
+
graph = build_graph_store
|
50
|
+
annealer = RDF::SourceRigor::CredenceAnnealer.new(graph)
|
46
51
|
annealer.resolve do
|
47
52
|
yield focus
|
48
53
|
end
|
@@ -50,12 +55,16 @@ module RoadForest
|
|
50
55
|
|
51
56
|
def putting(&block)
|
52
57
|
require 'roadforest/rdf/update-focus'
|
53
|
-
|
54
|
-
updater = RDF::UpdateFocus.new(
|
55
|
-
|
58
|
+
graph = build_graph_store
|
59
|
+
updater = RDF::UpdateFocus.new(url, graph, source_rigor)
|
60
|
+
annealer = RDF::SourceRigor::CredenceAnnealer.new(graph)
|
56
61
|
|
57
|
-
|
62
|
+
annealer.resolve do
|
63
|
+
updater.target_graph = ::RDF::Repository.new
|
64
|
+
yield updater
|
65
|
+
end
|
58
66
|
|
67
|
+
target_graph = updater.target_graph
|
59
68
|
target_graph.each_context do |context|
|
60
69
|
graph = ::RDF::Graph.new(context, :data => target_graph)
|
61
70
|
graph_transfer.put(context, graph)
|
@@ -64,7 +73,8 @@ module RoadForest
|
|
64
73
|
|
65
74
|
def posting(&block)
|
66
75
|
require 'roadforest/rdf/post-focus'
|
67
|
-
|
76
|
+
graph = build_graph_store
|
77
|
+
poster = RDF::PostFocus.new(url, graph, source_rigor)
|
68
78
|
|
69
79
|
anneal(poster, &block)
|
70
80
|
|
@@ -72,7 +82,8 @@ module RoadForest
|
|
72
82
|
end
|
73
83
|
|
74
84
|
def getting(&block)
|
75
|
-
|
85
|
+
graph = build_graph_store
|
86
|
+
reader = RDF::GraphReading.new(url, graph, source_rigor)
|
76
87
|
|
77
88
|
anneal(reader, &block)
|
78
89
|
end
|
data/lib/roadforest/server.rb
CHANGED
@@ -1,3 +1,25 @@
|
|
1
1
|
#This file is intended as the single entry point for RoadForest server code
|
2
2
|
require 'roadforest/application'
|
3
3
|
require 'roadforest/models'
|
4
|
+
|
5
|
+
module RoadForest
|
6
|
+
def self.serve(application, services)
|
7
|
+
require 'webrick/accesslog'
|
8
|
+
application.services = services
|
9
|
+
|
10
|
+
logfile = services.logger
|
11
|
+
logfile.info("#{Time.now.to_s}: Starting Roadforest server")
|
12
|
+
|
13
|
+
application.configure do |config|
|
14
|
+
config.adapter_options = {
|
15
|
+
:Logger => WEBrick::Log.new(logfile),
|
16
|
+
:AccessLog => [
|
17
|
+
[logfile, WEBrick::AccessLog::COMMON_LOG_FORMAT ],
|
18
|
+
[logfile, WEBrick::AccessLog::REFERER_LOG_FORMAT ]
|
19
|
+
]
|
20
|
+
}
|
21
|
+
yield config if block_given?
|
22
|
+
end
|
23
|
+
application.run
|
24
|
+
end
|
25
|
+
end
|
@@ -47,10 +47,18 @@ module RoadForest
|
|
47
47
|
response.status = exchange.response.code
|
48
48
|
response.body_string = exchange.response.body
|
49
49
|
|
50
|
+
enrich_with_server_stuff(response)
|
51
|
+
|
50
52
|
#puts; puts "#{__FILE__}:#{__LINE__} => #{(response).inspect}"
|
51
53
|
return response
|
52
54
|
end
|
53
55
|
|
56
|
+
def enrich_with_server_stuff(response)
|
57
|
+
response.headers["Server"]="RoadForest Test Server"
|
58
|
+
response.headers["Date"]=Time.now.httpdate
|
59
|
+
response.headers["Connection"] = "Keep-Alive"
|
60
|
+
end
|
61
|
+
|
54
62
|
class Exchange
|
55
63
|
def initialize
|
56
64
|
@uri = nil
|
data/spec/client.rb
CHANGED
@@ -13,6 +13,7 @@ describe RoadForest::RemoteHost do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
let :services do
|
16
|
+
require 'logger'
|
16
17
|
FileManagementExample::ServicesHost.new.tap do |host|
|
17
18
|
host.file_records = [
|
18
19
|
FileManagementExample::FileRecord.new("one", false),
|
@@ -24,7 +25,7 @@ describe RoadForest::RemoteHost do
|
|
24
25
|
end
|
25
26
|
|
26
27
|
let :server do
|
27
|
-
RoadForest::TestSupport::RemoteHost.new(FileManagementExample::Application.new("http://
|
28
|
+
RoadForest::TestSupport::RemoteHost.new(FileManagementExample::Application.new("http://localhost:8778", services))
|
28
29
|
end
|
29
30
|
|
30
31
|
def dump_trace
|
@@ -72,7 +73,7 @@ describe RoadForest::RemoteHost do
|
|
72
73
|
end
|
73
74
|
|
74
75
|
it "should set destination" do
|
75
|
-
@destination.to_context.to_s.should == "http://
|
76
|
+
@destination.to_context.to_s.should == "http://localhost:8778/files/one"
|
76
77
|
end
|
77
78
|
|
78
79
|
it "should deliver file to destination path" do
|
@@ -134,6 +135,23 @@ describe RoadForest::RemoteHost do
|
|
134
135
|
end
|
135
136
|
end
|
136
137
|
|
138
|
+
it "should change the server's responses" do
|
139
|
+
server.getting do |graph|
|
140
|
+
@correct = 0
|
141
|
+
items = graph.all(:skos, "hasTopConcept")
|
142
|
+
|
143
|
+
unresolved = items.find do |nav_item|
|
144
|
+
nav_item[:skos, "label"] == "Unresolved"
|
145
|
+
end
|
146
|
+
|
147
|
+
unresolved.first(:foaf, "page").first(:lc, "needs").as_list.each do |need|
|
148
|
+
@correct += 1
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
@correct.should == 0
|
153
|
+
end
|
154
|
+
|
137
155
|
it "should extract data from server responses" do
|
138
156
|
server.should match_query do
|
139
157
|
pattern(:subject, [:lc, "path"], nil)
|
data/spec/credence-annealer.rb
CHANGED
@@ -20,7 +20,7 @@ describe RoadForest::RDF::SourceRigor::CredenceAnnealer do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should re-run it's block until the GraphStore settles" do
|
23
|
-
graph.stub(:quiet_impulse?).and_return(false, false, true)
|
23
|
+
graph.stub(:quiet_impulse?).and_return(false, false, false, false, true) #called twice per resolution loop
|
24
24
|
|
25
25
|
times_run = 0
|
26
26
|
annealer.resolve do
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'roadforest/http/adapters/excon'
|
2
|
+
|
3
|
+
describe RoadForest::HTTP::ExconAdapter do
|
4
|
+
let :adapter do
|
5
|
+
RoadForest::HTTP::ExconAdapter.new("http://test-site.com").tap do |adapter|
|
6
|
+
adapter.connection_defaults[:mock] = true
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
before :each do
|
11
|
+
Excon.stub do
|
12
|
+
{
|
13
|
+
:body => "Hello!"
|
14
|
+
}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "responses to GET requests" do
|
19
|
+
let :request do
|
20
|
+
RoadForest::HTTP::Request.new("GET", "http://test-site.com/test")
|
21
|
+
end
|
22
|
+
|
23
|
+
subject :response do
|
24
|
+
adapter.do_request(request)
|
25
|
+
end
|
26
|
+
|
27
|
+
its(:status){ should == 200 }
|
28
|
+
its(:body_string){ should == "Hello!" }
|
29
|
+
end
|
30
|
+
end
|
data/spec/focus-list.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'rdf'
|
2
|
+
require 'roadforest/rdf/focus-list'
|
3
|
+
require 'roadforest/rdf/graph-focus'
|
4
|
+
|
5
|
+
describe RoadForest::RDF::FocusList do
|
6
|
+
let :graph do
|
7
|
+
RDF::Graph.new
|
8
|
+
end
|
9
|
+
|
10
|
+
let :focus do
|
11
|
+
RoadForest::RDF::GraphFocus.new("urn:root", graph)
|
12
|
+
end
|
13
|
+
|
14
|
+
let :list do
|
15
|
+
focus.as_list
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should add an item to graph" do
|
19
|
+
list.append_node("#test")
|
20
|
+
|
21
|
+
graph.should match_query do |query|
|
22
|
+
query.pattern(:subject => "urn:root#test")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should add several items to the graph" do
|
27
|
+
list.append_node("#1")
|
28
|
+
list.append_node("#2")
|
29
|
+
list.append_node("#3")
|
30
|
+
|
31
|
+
focus.as_list.to_a.should have(3).nodes
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'roadforest/resource/http/form-parsing'
|
@@ -0,0 +1,193 @@
|
|
1
|
+
require 'socket'
|
2
|
+
require 'rdf'
|
3
|
+
|
4
|
+
describe "RoadForest integration", :integration => true do
|
5
|
+
class LC < ::RDF::Vocabulary("http://lrdesign.com/vocabularies/logical-construct#"); end
|
6
|
+
def kill_server(pid)
|
7
|
+
return if pid.nil?
|
8
|
+
Process.kill("KILL", pid) rescue nil
|
9
|
+
Process.wait(pid)
|
10
|
+
rescue Errno::ECHILD
|
11
|
+
end
|
12
|
+
|
13
|
+
before :each do
|
14
|
+
@server_port = 8778
|
15
|
+
|
16
|
+
begin
|
17
|
+
test_conn = TCPSocket.new 'localhost', @server_port
|
18
|
+
raise "Something is still running on localhost:#{@server_port}"
|
19
|
+
rescue Errno::ECONNREFUSED
|
20
|
+
#That's what we're hoping for
|
21
|
+
ensure
|
22
|
+
#test_conn.close
|
23
|
+
end
|
24
|
+
|
25
|
+
@setup_time_limit = 3
|
26
|
+
@destination_dir = "spec_support/destination"
|
27
|
+
@server_logs = "integration-tests.log"
|
28
|
+
|
29
|
+
@server_pid = fork do
|
30
|
+
require 'roadforest/server'
|
31
|
+
require 'examples/file-management'
|
32
|
+
require 'logger'
|
33
|
+
RoadForest.serve(
|
34
|
+
FileManagementExample::Application.new("http://localhost:#{@server_port}"),
|
35
|
+
FileManagementExample::ServicesHost.new.tap do |host|
|
36
|
+
host.file_records = [
|
37
|
+
FileManagementExample::FileRecord.new("one", false),
|
38
|
+
FileManagementExample::FileRecord.new("two", false),
|
39
|
+
FileManagementExample::FileRecord.new("three", false)
|
40
|
+
]
|
41
|
+
host.destination_dir = @destination_dir
|
42
|
+
host.logger = Logger.new("integration-test.log")
|
43
|
+
host.logger.level = Logger::DEBUG
|
44
|
+
end
|
45
|
+
) do |config|
|
46
|
+
config.port = @server_port
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
require 'roadforest/remote-host'
|
51
|
+
|
52
|
+
%w{EXIT TERM}.each do |signal|
|
53
|
+
trap(signal) do
|
54
|
+
kill_server(@server_pid)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
begin_time = Time.now
|
59
|
+
begin
|
60
|
+
test_conn = TCPSocket.new 'localhost', @server_port
|
61
|
+
rescue Errno::ECONNREFUSED
|
62
|
+
if Time.now - begin_time > @setup_time_limit
|
63
|
+
raise "Couldn't connect to test server after #{@setup_time_limit} seconds - bailing out"
|
64
|
+
else
|
65
|
+
sleep 0.05
|
66
|
+
retry
|
67
|
+
end
|
68
|
+
ensure
|
69
|
+
test_conn.close rescue nil
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
after :each do
|
74
|
+
kill_server @server_pid
|
75
|
+
end
|
76
|
+
|
77
|
+
let :source_path do
|
78
|
+
"spec_support/test-file.txt"
|
79
|
+
end
|
80
|
+
|
81
|
+
let :server_url do
|
82
|
+
"http://localhost:#{@server_port}"
|
83
|
+
end
|
84
|
+
|
85
|
+
let :server do
|
86
|
+
server = RoadForest::RemoteHost.new(server_url)
|
87
|
+
#server.graph_transfer.trace = true
|
88
|
+
server
|
89
|
+
end
|
90
|
+
|
91
|
+
before :each do
|
92
|
+
require 'fileutils'
|
93
|
+
FileUtils.rm_f(@destination_dir)
|
94
|
+
FileUtils.mkdir_p(@destination_dir)
|
95
|
+
end
|
96
|
+
|
97
|
+
def unresolved_list(graph)
|
98
|
+
items = graph.all(:skos, "hasTopConcept")
|
99
|
+
|
100
|
+
unresolved = items.find do |nav_item|
|
101
|
+
nav_item[:skos, "label"] == "Unresolved"
|
102
|
+
end
|
103
|
+
|
104
|
+
return unresolved.first(:foaf, "page")
|
105
|
+
end
|
106
|
+
|
107
|
+
|
108
|
+
describe "raw put of file data" do
|
109
|
+
before :each do
|
110
|
+
@destination = nil
|
111
|
+
server.getting do |graph|
|
112
|
+
target = unresolved_list(graph)
|
113
|
+
@destination = target.first(:lc, "needs").as_list.first[:lc, "contents"]
|
114
|
+
end
|
115
|
+
|
116
|
+
unless @destination.nil?
|
117
|
+
File::open(source_path) do |file|
|
118
|
+
@response = server.put_file(@destination, "text/plain", file)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
it "should respond with 204" do
|
124
|
+
@response.status.should == 204
|
125
|
+
end
|
126
|
+
|
127
|
+
it "should set destination" do
|
128
|
+
@destination.to_context.to_s.should == "#{server_url}/files/one"
|
129
|
+
end
|
130
|
+
|
131
|
+
it "should deliver file to destination path" do
|
132
|
+
File::read(File::join(@destination_dir, "one")).should == File::read(source_path)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
describe "posting data to server" do
|
137
|
+
before :each do
|
138
|
+
server.posting do |graph|
|
139
|
+
target = unresolved_list(graph)
|
140
|
+
|
141
|
+
target.post_to do |new_need|
|
142
|
+
new_need[[:lc, "name"]] = "lawyers/guns/money"
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
it "should change the server state" do
|
148
|
+
server.getting do |graph|
|
149
|
+
@get_me_out_of_this = unresolved_list(graph).first(:lc, "needs").as_list.find do |need|
|
150
|
+
need[:lc, "name"] == "lawyers/guns/money"
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
@get_me_out_of_this.should_not be_nil
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
describe "getting data from the server" do
|
159
|
+
it "should get a correct count" do
|
160
|
+
server.getting do |graph|
|
161
|
+
@correct = 0
|
162
|
+
unresolved_list(graph).first(:lc, "needs").as_list.each do |need|
|
163
|
+
@correct += 1 unless need[:lc, "resolved"]
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
@correct.should == 3
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
describe "putting data to server" do
|
172
|
+
before :each do
|
173
|
+
server.putting do |graph|
|
174
|
+
target = unresolved_list(graph)
|
175
|
+
|
176
|
+
target.first(:lc, "needs").as_list.each do |need|
|
177
|
+
need[[:lc, "resolved"]] = true
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
it "should change the server state" do
|
183
|
+
server.getting do |graph|
|
184
|
+
@correct = 0
|
185
|
+
unresolved_list(graph).first(:lc, "needs").as_list.each do |need|
|
186
|
+
@correct += 1
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
@correct.should == 0
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'roadforest/rdf/normalization'
|
2
|
+
|
3
|
+
describe RoadForest::RDF::Normalization do
|
4
|
+
include described_class
|
5
|
+
|
6
|
+
it "should match http://test.com and http://test.com/" do
|
7
|
+
normalize_resource("http://test.com").to_s.should == normalize_resource("http://test.com/").to_s
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should match http://test.com:8888 and http://test.com:8888/" do
|
11
|
+
normalize_resource("http://test.com:8888").to_s.should == "http://test.com:8888/"
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should match http://localhost:8778 and http://localhost:8778/" do
|
15
|
+
normalize_resource("http://localhost:8778").to_s.should == "http://localhost:8778/"
|
16
|
+
end
|
17
|
+
end
|
data/spec/update-focus.rb
CHANGED
@@ -71,6 +71,13 @@ describe RoadForest::RDF::UpdateFocus do
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
it "should make relevant prefixes available" do
|
75
|
+
updater[[:rdf, :type]] = [:voc, :Thing]
|
76
|
+
updater[[:voc, :a]] = 15
|
77
|
+
|
78
|
+
updater.relevant_prefixes.keys.sort.should == ["rdf", "voc"]
|
79
|
+
end
|
80
|
+
|
74
81
|
it "should copy entire context when resource is written" do
|
75
82
|
updater[Voc[:a]] = 17
|
76
83
|
|
@@ -114,4 +121,34 @@ describe RoadForest::RDF::UpdateFocus do
|
|
114
121
|
updater[Voc[:a]].should == 7
|
115
122
|
target_graph.should be_empty
|
116
123
|
end
|
124
|
+
|
125
|
+
it "should add a list to the target graph" do
|
126
|
+
list_focus = updater.add_node(Voc[:list])
|
127
|
+
nodes = []
|
128
|
+
list_focus.as_list.append_node do |node|
|
129
|
+
nodes << node
|
130
|
+
node[Voc[:d]] = 107
|
131
|
+
end
|
132
|
+
|
133
|
+
list_focus.as_list.append_node do |node|
|
134
|
+
nodes << node
|
135
|
+
node[Voc[:d]] = 109
|
136
|
+
end
|
137
|
+
|
138
|
+
list_focus.as_list.append_node do |node|
|
139
|
+
nodes << node
|
140
|
+
node[Voc[:d]] = 113
|
141
|
+
end
|
142
|
+
|
143
|
+
resource_graph = ::RDF::Graph.new(context_node, :data => target_graph)
|
144
|
+
|
145
|
+
list = ::RDF::List.new(list_focus.subject, target_graph)
|
146
|
+
|
147
|
+
list[0].should == nodes[0].subject
|
148
|
+
list[1].should == nodes[1].subject
|
149
|
+
list[2].should == nodes[2].subject
|
150
|
+
resource_graph.query([nodes[0].subject, Voc[:d], 107]).should_not be_empty
|
151
|
+
resource_graph.query([nodes[1].subject, Voc[:d], 109]).should_not be_empty
|
152
|
+
resource_graph.query([nodes[2].subject, Voc[:d], 113]).should_not be_empty
|
153
|
+
end
|
117
154
|
end
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: roadforest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Judson Lester
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
prerelease: false
|
@@ -17,15 +17,15 @@ dependencies:
|
|
17
17
|
name: rdf
|
18
18
|
version_requirements: !ruby/object:Gem::Requirement
|
19
19
|
requirements:
|
20
|
-
- -
|
20
|
+
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.0.
|
22
|
+
version: 1.0.6
|
23
23
|
none: false
|
24
24
|
requirement: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.0.
|
28
|
+
version: 1.0.6
|
29
29
|
none: false
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
prerelease: false
|
@@ -142,7 +142,7 @@ files:
|
|
142
142
|
- lib/roadforest/rdf/context-fascade.rb
|
143
143
|
- lib/roadforest/rdf/source-rigor.rb
|
144
144
|
- lib/roadforest/rdf/graph-focus.rb
|
145
|
-
- lib/roadforest/rdf/
|
145
|
+
- lib/roadforest/rdf/etagging.rb
|
146
146
|
- lib/roadforest/rdf/source-rigor/null-investigator.rb
|
147
147
|
- lib/roadforest/rdf/source-rigor/credence.rb
|
148
148
|
- lib/roadforest/rdf/source-rigor/credence/any.rb
|
@@ -151,14 +151,14 @@ files:
|
|
151
151
|
- lib/roadforest/rdf/source-rigor/http-investigator.rb
|
152
152
|
- lib/roadforest/rdf/source-rigor/investigator.rb
|
153
153
|
- lib/roadforest/rdf/source-rigor/credence-annealer.rb
|
154
|
+
- lib/roadforest/rdf/post-focus.rb
|
155
|
+
- lib/roadforest/rdf/investigation.rb
|
154
156
|
- lib/roadforest/rdf/update-focus.rb
|
155
157
|
- lib/roadforest/rdf/vocabulary.rb
|
156
158
|
- lib/roadforest/rdf/document.rb
|
157
|
-
- lib/roadforest/rdf/focus-wrapping.rb
|
158
159
|
- lib/roadforest/rdf/resource-pattern.rb
|
159
160
|
- lib/roadforest/rdf/parcel.rb
|
160
161
|
- lib/roadforest/rdf/resource-query.rb
|
161
|
-
- lib/roadforest/rdf/investigation.rb
|
162
162
|
- lib/roadforest/http/message.rb
|
163
163
|
- lib/roadforest/http/graph-response.rb
|
164
164
|
- lib/roadforest/http/adapters/excon.rb
|
@@ -172,22 +172,22 @@ files:
|
|
172
172
|
- lib/roadforest/resource/role/has-children.rb
|
173
173
|
- lib/roadforest/resource/handlers.rb
|
174
174
|
- lib/roadforest/resource/rdf.rb
|
175
|
-
- lib/roadforest/test-support/
|
176
|
-
- lib/roadforest/test-support/remote-host.rb
|
175
|
+
- lib/roadforest/test-support/http-client.rb
|
177
176
|
- lib/roadforest/test-support/trace-formatter.rb
|
177
|
+
- lib/roadforest/test-support/matchers.rb
|
178
178
|
- lib/roadforest/test-support/dispatcher-facade.rb
|
179
|
-
- lib/roadforest/test-support/
|
179
|
+
- lib/roadforest/test-support/remote-host.rb
|
180
180
|
- lib/roadforest/server.rb
|
181
181
|
- lib/roadforest/application/services-host.rb
|
182
182
|
- lib/roadforest/application/path-provider.rb
|
183
183
|
- lib/roadforest/application/parameters.rb
|
184
184
|
- lib/roadforest/application/dispatcher.rb
|
185
185
|
- lib/roadforest/application/route-adapter.rb
|
186
|
-
- lib/roadforest/models.rb
|
187
186
|
- lib/roadforest/model.rb
|
188
|
-
- lib/roadforest/
|
187
|
+
- lib/roadforest/models.rb
|
189
188
|
- lib/roadforest/test-support.rb
|
190
189
|
- lib/roadforest/rdf.rb
|
190
|
+
- lib/roadforest/blob-model.rb
|
191
191
|
- lib/roadforest/utility/class-registry.rb
|
192
192
|
- lib/roadforest/content-handling/type-handlers/jsonld.rb
|
193
193
|
- lib/roadforest/content-handling/media-type.rb
|
@@ -195,14 +195,19 @@ files:
|
|
195
195
|
- lib/roadforest/application.rb
|
196
196
|
- lib/roadforest/remote-host.rb
|
197
197
|
- lib/roadforest.rb
|
198
|
+
- examples/file-management.rb
|
198
199
|
- spec/graph-store.rb
|
200
|
+
- spec/focus-list.rb
|
199
201
|
- spec/graph-copier.rb
|
200
202
|
- spec/rdf-parcel.rb
|
201
203
|
- spec/media-types.rb
|
204
|
+
- spec/rdf-normalization.rb
|
205
|
+
- spec/excon-adapater.rb
|
202
206
|
- spec/update-focus.rb
|
203
207
|
- spec/client.rb
|
208
|
+
- spec/form-parsing.rb
|
204
209
|
- spec/credence-annealer.rb
|
205
|
-
-
|
210
|
+
- spec/full-integration.rb
|
206
211
|
- spec_support/gem_test_suite.rb
|
207
212
|
homepage: http://nyarly.github.com/roadforest
|
208
213
|
licenses:
|
@@ -213,7 +218,7 @@ rdoc_options:
|
|
213
218
|
- --main
|
214
219
|
- doc/README
|
215
220
|
- --title
|
216
|
-
- roadforest-0.0.
|
221
|
+
- roadforest-0.0.2 Documentation
|
217
222
|
require_paths:
|
218
223
|
- lib/
|
219
224
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -222,7 +227,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
222
227
|
- !ruby/object:Gem::Version
|
223
228
|
segments:
|
224
229
|
- 0
|
225
|
-
hash: -
|
230
|
+
hash: -203066605
|
226
231
|
version: '0'
|
227
232
|
none: false
|
228
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'rdf/model/node'
|
2
|
-
|
3
|
-
module RoadForest::RDF
|
4
|
-
module FocusWrapping
|
5
|
-
def new_focus
|
6
|
-
dup
|
7
|
-
end
|
8
|
-
|
9
|
-
def wrap_node(value)
|
10
|
-
next_step = new_focus
|
11
|
-
if ::RDF::Node === value
|
12
|
-
next_step.root_url = self.root_url
|
13
|
-
else
|
14
|
-
next_step.root_url = normalize_context(value)
|
15
|
-
end
|
16
|
-
next_step.subject = value
|
17
|
-
next_step.graph = graph
|
18
|
-
next_step.source_rigor = source_rigor
|
19
|
-
next_step
|
20
|
-
end
|
21
|
-
|
22
|
-
def unwrap_value(value)
|
23
|
-
if value.respond_to? :object
|
24
|
-
value.object
|
25
|
-
else
|
26
|
-
wrap_node(value)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|