summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2012-06-14 11:28:01 +0000
committerChristoph Helma <helma@in-silico.ch>2012-06-14 11:28:01 +0000
commit5e8461b65787ac2f4dbb321dd258cee90b4a91ab (patch)
tree1206a0d7164e5cfd9e80d8b2f26247028ca95ffa
parent4f82f43d02b40809f6bff5763c694a9816f546d4 (diff)
Initial version of 4store based dataset service
-rw-r--r--Gemfile4
-rw-r--r--Rakefile1
-rw-r--r--VERSION1
-rw-r--r--application.rb29
-rw-r--r--config.ru10
-rw-r--r--data/.gitignore3
-rw-r--r--dataset.gemspec25
-rw-r--r--public/.gitignore2
-rw-r--r--public/robots.txt2
9 files changed, 64 insertions, 13 deletions
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..36f1a90
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,4 @@
+source :gemcutter
+gemspec
+gem "opentox-server", :path => "~/opentox-server"
+gem "opentox-client", :path => "~/opentox-client"
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..2995527
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1 @@
+require "bundler/gem_tasks"
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..3eefcb9
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+1.0.0
diff --git a/application.rb b/application.rb
index bda0ff9..b3e3843 100644
--- a/application.rb
+++ b/application.rb
@@ -1,3 +1,31 @@
+module OpenTox
+ class Application < Service
+
+ # Get metadata of the dataset
+ # @return [application/rdf+xml] Metadata OWL-DL
+ get '/:id/metadata' do
+ end
+
+ # Get a dataset feature
+ # @param [Header] Accept one of `application/rdf+xml or application-x-yaml` (default application/rdf+xml)
+ # @return [application/rdf+xml,application/x-yaml] Feature metadata
+ get %r{/(\d+)/feature/(.*)$} do |id,feature|
+ end
+
+ # Get a list of all features
+ # @param [Header] Accept one of `application/rdf+xml, application-x-yaml, text/uri-list` (default application/rdf+xml)
+ # @return [application/rdf+xml, application-x-yaml, text/uri-list] Feature list
+ get '/:id/features' do
+ end
+
+ # Get a list of all compounds
+ # @return [text/uri-list] Feature list
+ get '/:id/compounds' do
+ end
+ end
+end
+
+=begin
require 'rubygems'
gem "opentox-ruby", "~> 3"
require 'opentox-ruby'
@@ -410,3 +438,4 @@ delete '/?' do
response['Content-Type'] = 'text/plain'
"All datasets deleted."
end
+=end
diff --git a/config.ru b/config.ru
index a1aab0d..39d9385 100644
--- a/config.ru
+++ b/config.ru
@@ -1,6 +1,4 @@
-require 'rubygems'
-require 'opentox-ruby'
-require 'config/config_ru'
-run Sinatra::Application
-set :raise_errors, false
-set :show_exceptions, false \ No newline at end of file
+SERVICE = "dataset"
+require 'bundler'
+Bundler.require
+run OpenTox::Service
diff --git a/data/.gitignore b/data/.gitignore
deleted file mode 100644
index 59e3edd..0000000
--- a/data/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*.rdfxml
-*.xls
-*.yaml
diff --git a/dataset.gemspec b/dataset.gemspec
new file mode 100644
index 0000000..37d2d62
--- /dev/null
+++ b/dataset.gemspec
@@ -0,0 +1,25 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+
+Gem::Specification.new do |s|
+ s.name = "feature"
+ s.version = File.read("./VERSION")
+ s.authors = ["Christoph Helma"]
+ s.email = ["helma@in-silico.ch"]
+ s.homepage = ""
+ s.summary = %q{Simple OpenTox Dataset Service}
+ s.description = %q{TODO: Write a gem description}
+ s.license = 'GPL-3'
+
+ s.rubyforge_project = "feature"
+
+ s.files = `git ls-files`.split("\n")
+ #s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ #s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ #s.require_paths = ["lib"]
+ s.required_ruby_version = '>= 1.9.2'
+
+ # specify any dependencies here; for example:
+ s.add_runtime_dependency "opentox-server"
+ s.post_install_message = "Please configure your service in ~/.opentox/config/dataset.rb"
+end
diff --git a/public/.gitignore b/public/.gitignore
deleted file mode 100644
index debc7d4..0000000
--- a/public/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.rdfxml
-*.xls
diff --git a/public/robots.txt b/public/robots.txt
deleted file mode 100644
index 1f53798..0000000
--- a/public/robots.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-User-agent: *
-Disallow: /