Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Commit

Permalink
return only URI for structured annotation
Browse files Browse the repository at this point in the history
closes #70

biological_context renamed to experiment_context; closes #51

integrated bel.rb format deserialization into POST /evidence

updated evidence shema to include annotation and namespace references in
a "references" section

TODO work still needed to support structured metadata (refs #71)
  • Loading branch information
Anthony Bargnesi committed Jun 9, 2015
1 parent 114a986 commit 0cd666a
Show file tree
Hide file tree
Showing 21 changed files with 794 additions and 213 deletions.
7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
source 'https://rubygems.org'

gem 'activesupport', '~> 4.2.0'
gem 'bel'
gem 'bson_ext', '1.12.0'
gem 'builder'
Expand All @@ -23,6 +22,12 @@ gem 'sinatra-advanced-routes', :require => 'sinatra/advanced_routes'
gem 'sinatra-contrib'
gem 'sqlite3'

group :test do
gem 'faraday_middleware'
gem 'hyperclient'
gem 'rspec'
end

group :development do
gem 'POpen4'
gem 'pry', '~> 0.9.12'
Expand Down
80 changes: 78 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ GEM
ast (2.0.0)
backports (3.6.4)
bel (0.3.0.beta5)
ffi (= 1.9.8)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
blankslate (3.1.3)
bson (1.12.0)
bson_ext (1.12.0)
bson (~> 1.12.0)
Expand All @@ -37,30 +39,77 @@ GEM
timers (~> 4.0.0)
coderay (1.1.0)
debug_inspector (0.0.2)
diff-lcs (1.2.5)
dot_hash (0.5.9)
faraday (0.9.1)
multipart-post (>= 1.2, < 3)
faraday-digestauth (0.2.1)
faraday (~> 0.7)
net-http-digest_auth (~> 1.4)
faraday_hal_middleware (0.0.1)
faraday_middleware (>= 0.9, < 0.10)
faraday_middleware (0.9.1)
faraday (>= 0.7.4, < 0.10)
ffi (1.9.8)
foreman (0.78.0)
thor (~> 0.19.1)
formatador (0.2.5)
futuroscope (0.1.11)
guard (2.12.5)
formatador (>= 0.2.4)
listen (~> 2.7)
lumberjack (~> 1.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-ctags-bundler (1.4.0)
guard (>= 2.0)
guard-compat (>= 0.1.0)
guard-rake (1.0.0)
guard
rake
hitimes (1.2.2)
hyperclient (0.7.0)
faraday (~> 0.8)
faraday-digestauth (~> 0.2)
faraday_hal_middleware (~> 0.0.1)
faraday_middleware (~> 0.9)
futuroscope (>= 0.0.10)
net-http-digest_auth (~> 1.2)
uri_template (~> 0.5)
i18n (0.7.0)
json (1.8.2)
json_schema (0.5.0)
listen (2.9.0)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
lumberjack (1.0.9)
method_source (0.8.2)
mini_portile (0.6.2)
minitest (5.5.1)
mongo (1.12.0)
bson (= 1.12.0)
multi_json (1.11.0)
multipart-post (2.0.0)
nenv (0.2.0)
net-http-digest_auth (1.4)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
notiffany (0.0.6)
nenv (~> 0.1)
shellany (~> 0.0)
oat (0.4.6)
activesupport
oj (2.12.1)
open4 (1.3.4)
parser (2.2.0.3)
ast (>= 1.1, < 3.0)
parslet (1.7.0)
blankslate (>= 2.0, <= 4.0)
pry (0.9.12.6)
coderay (~> 1.0)
method_source (~> 0.8)
Expand All @@ -80,14 +129,29 @@ GEM
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (10.4.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rerun (0.10.0)
listen (~> 2.7, >= 2.7.3)
ripper-tags (0.1.3)
yajl-ruby
ruby-progressbar (1.7.4)
rspec (3.2.0)
rspec-core (~> 3.2.0)
rspec-expectations (~> 3.2.0)
rspec-mocks (~> 3.2.0)
rspec-core (3.2.3)
rspec-support (~> 3.2.0)
rspec-expectations (3.2.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-mocks (3.2.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-support (3.2.2)
ruby-progressbar (1.7.5)
shellany (0.0.1)
sinatra (1.4.5)
rack (~> 1.4)
rack-protection (~> 1.4)
Expand All @@ -110,13 +174,18 @@ GEM
ruby-progressbar (~> 1.5)
term-ansicolor (1.3.0)
tins (~> 1.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
timers (4.0.1)
hitimes
tins (1.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uri_template (0.7.0)
vim-flavor (2.2.1)
parslet (~> 1.7)
thor (~> 0.19)
xml_schema (0.2.0)
yajl-ruby (1.2.1)

Expand All @@ -125,11 +194,16 @@ PLATFORMS

DEPENDENCIES
POpen4
activesupport (~> 4.2.0)
bel
bson_ext (= 1.12.0)
builder
dot_hash
faraday_middleware
foreman
guard
guard-ctags-bundler
guard-rake
hyperclient
jrjackson (~> 0.2)
json_schema
kyotocabinet-ffi!
Expand All @@ -148,9 +222,11 @@ DEPENDENCIES
redlander!
rerun
ripper-tags
rspec
sinatra
sinatra-advanced-routes
sinatra-contrib
sqlite3
starscope
term-ansicolor
vim-flavor
1 change: 1 addition & 0 deletions app/resources/annotation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class AnnotationSerializer < BaseSerializer
schema do
type :annotation
properties do |p|
p.rdf_uri item.uri
p.name item.prefLabel
p.prefix item.prefix
p.domain item.domain
Expand Down
14 changes: 13 additions & 1 deletion app/resources/evidence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ class EvidenceSerializer < BaseSerializer
p.bel_statement item['bel_statement']
p.citation item['citation']
p.summary_text item['summary_text']
p.biological_context item['biological_context']
p.experiment_context prepare_experiment_context(
item['experiment_context']
)
p.metadata item['metadata']
end

Expand All @@ -24,6 +26,16 @@ class EvidenceSerializer < BaseSerializer

private

def prepare_experiment_context(experiment_context)
experiment_context.each do |annotation|
if annotation['uri']
annotation.delete('name')
annotation.delete('value')
end
end
experiment_context
end

def link_self(id)
{
:type => :evidence,
Expand Down
Loading

0 comments on commit 0cd666a

Please sign in to comment.