triannon 1.0.0 → 1.0.1
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/README.md +80 -28
- data/Rakefile +0 -11
- data/lib/triannon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d20d2124fb17c180ab12ea7b7327231153911b78
|
4
|
+
data.tar.gz: 983a6a576832035c3fdc880c6f238543330abd9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa243bfb9936f35133da5a99f863698415fcbeb9c05ebe924b4af6250579351ed719b4c3b6a23dcd2de94a9017b1721455fef48527630abbd7d95b54aff32c6b
|
7
|
+
data.tar.gz: 7343b0510476dde7a96efad33f16b2d3d771361edd2c4155be3342911c40da2e154ce38d5de0a944400e4c30ccf48221ed7477e407a77fb7e3c66161775f3e49
|
data/README.md
CHANGED
@@ -4,30 +4,20 @@
|
|
4
4
|
|
5
5
|
Store Open Annotation in Fedora4 to support the Linked Data for Libraries use cases.
|
6
6
|
|
7
|
-
##
|
7
|
+
## Installation into Your Rails Application
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
```console
|
12
|
-
$ rake
|
13
|
-
```
|
14
|
-
|
15
|
-
## Installation into Rails app
|
16
|
-
|
17
|
-
Add this line to your Rails app gemfile
|
9
|
+
Add this line to your Rails application's Gemfile
|
18
10
|
|
19
11
|
```ruby
|
20
12
|
gem 'triannon'
|
21
13
|
```
|
22
14
|
|
23
15
|
Then execute:
|
24
|
-
|
25
16
|
```console
|
26
|
-
$ bundle
|
17
|
+
$ bundle install
|
27
18
|
```
|
28
19
|
|
29
20
|
Then run the triannon generator:
|
30
|
-
|
31
21
|
```console
|
32
22
|
$ rails g triannon:install
|
33
23
|
```
|
@@ -47,6 +37,7 @@ $ rake triannon:create_root_container
|
|
47
37
|
Set up caching for jsonld context documents:
|
48
38
|
|
49
39
|
* by using Rack::Cache for RestClient:
|
40
|
+
|
50
41
|
** add to Gemfile:
|
51
42
|
|
52
43
|
```ruby
|
@@ -54,6 +45,7 @@ gem 'rest-client'
|
|
54
45
|
gem 'rack-cache'
|
55
46
|
gem 'rest-client-components'
|
56
47
|
```
|
48
|
+
|
57
49
|
*** bundle install
|
58
50
|
** create a config/initializers/rest_client.rb
|
59
51
|
|
@@ -71,9 +63,22 @@ RestClient.enable Rack::Cache,
|
|
71
63
|
## Client Interactions with Triannon
|
72
64
|
|
73
65
|
### Get a list of annos
|
74
|
-
|
75
|
-
|
76
|
-
* `GET`: `http://(host)/annotations`
|
66
|
+
as a IIIF Annotation List (see http://iiif.io/api/presentation/2.0/#other-content-resources)
|
67
|
+
|
68
|
+
* `GET`: `http://(host)/annotations/search?targetUri=some.url.org`
|
69
|
+
|
70
|
+
Search Parameters:
|
71
|
+
* `targetUri` - matches URI for target, with or without http or https scheme prefix
|
72
|
+
* `bodyUri` - matches URI for target, with or without http or https scheme prefix
|
73
|
+
* `bodyExact` - matches body characters exactly
|
74
|
+
* `bodyKeyword` - matches terms in body characters
|
75
|
+
* `motivatedBy` - matches fragment part of motivation predicate URI, e.g. commenting, tagging, painting
|
76
|
+
|
77
|
+
* use HTTP `Accept` header with mime type to indicate desired format
|
78
|
+
* default: jsonld
|
79
|
+
* `Accept`: `application/ld+json`
|
80
|
+
* also supports turtle, rdfxml, json, html
|
81
|
+
* `Accept`: `application/x-turtle`
|
77
82
|
|
78
83
|
### Get a particular anno
|
79
84
|
`GET`: `http://(host)/annotations/(anno_id)`
|
@@ -128,49 +133,96 @@ Note that OA (Open Annotation) is the default context if none is specified.
|
|
128
133
|
`DELETE`: `http://(host)/annotations/(anno_id)`
|
129
134
|
|
130
135
|
|
131
|
-
|
136
|
+
# Running This Code in Development
|
132
137
|
|
133
|
-
There is a bundled rake task for running
|
138
|
+
There is a bundled rake task for running triannon in a test rails application, but there is some one-time set up.
|
134
139
|
|
135
|
-
|
140
|
+
## One time setup
|
136
141
|
|
137
|
-
|
142
|
+
### Set up a local instance of Fedora4
|
138
143
|
```console
|
139
144
|
$ rake jetty:download
|
140
145
|
$ rake jetty:unzip
|
141
146
|
```
|
142
|
-
|
147
|
+
|
148
|
+
### Set up a Triannon flavored Solr
|
143
149
|
```console
|
144
150
|
rake triannon:solr_jetty_setup
|
145
151
|
```
|
146
152
|
|
147
|
-
|
153
|
+
### Set up the testing Rails app that uses triannon gem
|
148
154
|
```console
|
149
155
|
$ rake engine_cart:generate # (first run only)
|
150
156
|
```
|
151
157
|
|
152
|
-
|
158
|
+
### Start jetty
|
153
159
|
```console
|
154
160
|
$ rake jetty:start
|
155
161
|
```
|
156
162
|
|
157
|
-
|
163
|
+
Note that jetty can be very sloooooooow to start up with Fedora and Solr.
|
164
|
+
|
165
|
+
#### Check if Solr is up
|
166
|
+
Go to http://localhost:8983/solr/#/triannon
|
167
|
+
or to http://localhost:8983/solr/triannon/select
|
168
|
+
|
169
|
+
If all is well, you will not get an error message; the triannon core exists in Solr. If all is not
|
170
|
+
well, try:
|
171
|
+
|
172
|
+
```console
|
173
|
+
$ rake jetty:stop
|
174
|
+
$ rake triannon:solr_jetty_setup
|
175
|
+
$ rake jetty:start
|
176
|
+
```
|
177
|
+
|
178
|
+
and then check again.
|
179
|
+
|
180
|
+
|
181
|
+
#### Check if Fedora is up
|
182
|
+
Go to http://localhost:8983/fedora/rest/
|
183
|
+
|
184
|
+
If all is well, you will not get an error message. If all is not well, try:
|
185
|
+
|
186
|
+
```console
|
187
|
+
$ rake jetty:stop
|
188
|
+
$ rake jetty:clean
|
189
|
+
$ rake triannon:solr_jetty_startup
|
190
|
+
$ rake jetty:start
|
191
|
+
```
|
192
|
+
|
193
|
+
and check for Solr and Fedora again.
|
194
|
+
|
195
|
+
#### Generate root annotations container
|
196
|
+
After you ensure that Fedora4 is running:
|
197
|
+
|
158
198
|
```console
|
159
199
|
$ cd spec/internal
|
160
200
|
$ rake triannon:create_root_container
|
161
201
|
$ cd ../..
|
162
202
|
```
|
163
203
|
|
164
|
-
|
204
|
+
#### Configure spec/internal/config/triannon.yml as specified above
|
165
205
|
You might not need to change the file.
|
166
206
|
```console
|
167
207
|
$ vi spec/internal/config/triannon.yml
|
168
208
|
```
|
169
209
|
|
170
210
|
|
171
|
-
|
211
|
+
## Run the testing Rails application
|
172
212
|
```console
|
173
|
-
$ rake jetty:start
|
213
|
+
$ rake jetty:start # if it isn't still running
|
174
214
|
$ rake triannon:server
|
175
|
-
$
|
215
|
+
$ <cntl + C> # to stop Rails application
|
216
|
+
$ rake jetty:stop # to stop Fedora and Solr
|
217
|
+
```
|
218
|
+
|
219
|
+
The app will be running at localhost:3000
|
220
|
+
|
221
|
+
# Running the Tests
|
222
|
+
|
223
|
+
Run tests:
|
224
|
+
|
225
|
+
```console
|
226
|
+
$ rake spec
|
176
227
|
```
|
228
|
+
|
data/Rakefile
CHANGED
@@ -101,15 +101,4 @@ namespace :doc do
|
|
101
101
|
rm_r 'rdoc' if File.exists?('rdoc')
|
102
102
|
end
|
103
103
|
end
|
104
|
-
|
105
|
-
require 'rdoc/task'
|
106
|
-
|
107
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
108
|
-
rdoc.rdoc_dir = 'rdoc'
|
109
|
-
rdoc.title = 'Triannon'
|
110
|
-
rdoc.options << '--line-numbers'
|
111
|
-
rdoc.rdoc_files.include('README.rdoc')
|
112
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
113
|
-
end
|
114
|
-
|
115
104
|
Bundler::GemHelper.install_tasks
|
data/lib/triannon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: triannon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-04-
|
13
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|