From 5e8461b65787ac2f4dbb321dd258cee90b4a91ab Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 14 Jun 2012 11:28:01 +0000 Subject: Initial version of 4store based dataset service --- Gemfile | 4 ++++ Rakefile | 1 + VERSION | 1 + application.rb | 29 +++++++++++++++++++++++++++++ config.ru | 10 ++++------ data/.gitignore | 3 --- dataset.gemspec | 25 +++++++++++++++++++++++++ public/.gitignore | 2 -- public/robots.txt | 2 -- 9 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 Gemfile create mode 100644 Rakefile create mode 100644 VERSION delete mode 100644 data/.gitignore create mode 100644 dataset.gemspec delete mode 100644 public/.gitignore delete mode 100644 public/robots.txt 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: / -- cgit v1.2.3