triannon-client 0.0.0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/bin/console +5 -0
- data/bin/setup.sh +10 -0
- data/bin/test.sh +16 -0
- data/lib/triannon-client.rb +1 -4
- data/lib/triannon-client/triannon-client.rb +9 -0
- data/spec/lib/triannon-client/triannon-client_spec.rb +6 -0
- data/triannon-client.gemspec +5 -5
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07b7dcae42e6b63eced37e16ee442d2db563eaa0
|
4
|
+
data.tar.gz: 0e24d31959302b0722a1f72e735a0d3b06902814
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0423905c2873604f3fc43a18c93b57f998065b0720f7f02fc215af31b7ffcdfd7cfa6617d99bd4d77b12ac1a383a3880b502b63966a081ee7ff55a275a57dad
|
7
|
+
data.tar.gz: df43ac27b95f8427ff9d21083235a219687a19affd3c9ab99081ec559f6dddb41e9a9e2a1c52bb75beeb15236125649b7891e7e68b3628b2ebc2a6842cedbf25
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
triannon-client (0.
|
4
|
+
triannon-client (0.1.0)
|
5
5
|
dotenv
|
6
6
|
linkeddata (~> 1.0)
|
7
7
|
pry
|
8
8
|
pry-doc
|
9
|
-
rest-client (~> 1.
|
9
|
+
rest-client (~> 1.7)
|
10
10
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
@@ -74,8 +74,8 @@ GEM
|
|
74
74
|
rdf-turtle (~> 1.1, >= 1.1.5)
|
75
75
|
sparql (~> 1.1, >= 1.1.4)
|
76
76
|
sparql-client (~> 1.1, >= 1.1.3)
|
77
|
-
listen (2.
|
78
|
-
celluloid (
|
77
|
+
listen (2.10.0)
|
78
|
+
celluloid (~> 0.16.0)
|
79
79
|
rb-fsevent (>= 0.9.3)
|
80
80
|
rb-inotify (>= 0.9)
|
81
81
|
lumberjack (1.0.9)
|
data/bin/console
ADDED
data/bin/setup.sh
ADDED
data/bin/test.sh
ADDED
data/lib/triannon-client.rb
CHANGED
@@ -1,15 +1,12 @@
|
|
1
1
|
require 'dotenv'
|
2
2
|
Dotenv.load
|
3
|
-
|
4
3
|
require 'pry'
|
5
4
|
require 'pry-doc'
|
6
|
-
|
7
5
|
# require rest client prior to linkeddata, so the latter can use it.
|
8
6
|
require 'rest-client'
|
9
|
-
require 'linkeddata'
|
10
7
|
RestClient.proxy = ENV['http_proxy'] unless ENV['http_proxy'].nil?
|
11
8
|
RestClient.proxy = ENV['HTTP_PROXY'] unless ENV['HTTP_PROXY'].nil?
|
12
|
-
|
9
|
+
require 'linkeddata'
|
13
10
|
require_relative 'triannon-client/configuration'
|
14
11
|
require_relative 'triannon-client/triannon-client'
|
15
12
|
|
@@ -19,6 +19,15 @@ module TriannonClient
|
|
19
19
|
)
|
20
20
|
end
|
21
21
|
|
22
|
+
# Delete an annotation
|
23
|
+
# @param iri [String] HTTP URL for a triannon annotation
|
24
|
+
# @response [true|false] true when successful
|
25
|
+
def delete_annotation(iri)
|
26
|
+
uri = RDF::URI.parse(iri)
|
27
|
+
response = @site[uri.path].delete
|
28
|
+
[200, 202, 204].include? response.code
|
29
|
+
end
|
30
|
+
|
22
31
|
# @param oa [JSON-LD] a json-ld object with an open annotation context
|
23
32
|
# @return response [RestClient::Response|nil]
|
24
33
|
def post_annotation(oa)
|
data/triannon-client.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'triannon-client'
|
5
|
-
s.version = '0.
|
5
|
+
s.version = '0.1.0'
|
6
6
|
s.licenses = ['Apache-2.0']
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
# Use ENV for config
|
21
21
|
s.add_dependency 'dotenv'
|
22
22
|
# HTTP and RDF clients
|
23
|
-
s.add_dependency 'rest-client', '~> 1.
|
23
|
+
s.add_dependency 'rest-client', '~> 1.7'
|
24
24
|
s.add_dependency 'linkeddata', '~> 1.0'
|
25
25
|
# Use pry for console and debugging
|
26
26
|
s.add_dependency 'pry'
|
@@ -33,11 +33,11 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.add_development_dependency 'rspec'
|
34
34
|
|
35
35
|
s.files = `git ls-files`.split($/)
|
36
|
-
dev_files = %w(.gitignore bin/console bin/setup.sh bin/test.sh)
|
37
|
-
dev_files.each {|f| s.files.delete f }
|
38
|
-
|
39
36
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
40
37
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
41
38
|
|
39
|
+
dev_files = %w(.gitignore bin/console bin/ctags.rb bin/setup.sh bin/test.sh)
|
40
|
+
dev_files.each {|f| s.files.delete f; s.executables.delete f; }
|
41
|
+
|
42
42
|
end
|
43
43
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: triannon-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Weber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.7'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.7'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: linkeddata
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,7 +154,10 @@ description: A client for RESTful transactions with a triannon annotation server
|
|
154
154
|
email:
|
155
155
|
- darren.weber@stanford.edu
|
156
156
|
executables:
|
157
|
+
- console
|
157
158
|
- ctags.rb
|
159
|
+
- setup.sh
|
160
|
+
- test.sh
|
158
161
|
extensions: []
|
159
162
|
extra_rdoc_files:
|
160
163
|
- README.md
|
@@ -167,7 +170,10 @@ files:
|
|
167
170
|
- LICENSE
|
168
171
|
- README.md
|
169
172
|
- Rakefile
|
173
|
+
- bin/console
|
170
174
|
- bin/ctags.rb
|
175
|
+
- bin/setup.sh
|
176
|
+
- bin/test.sh
|
171
177
|
- lib/triannon-client.rb
|
172
178
|
- lib/triannon-client/configuration.rb
|
173
179
|
- lib/triannon-client/triannon-client.rb
|