publisci 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -9
- data/README.md +40 -5
- data/README.rdoc +7 -7
- data/Rakefile +2 -2
- data/bin/{bio-publisci → publisci} +6 -6
- data/examples/bio-band_integration.rb +1 -1
- data/examples/no_magic.prov +1 -1
- data/examples/no_magic.rb +1 -1
- data/examples/safe_gen.rb +1 -1
- data/examples/visualization/prov_viz.rb +1 -1
- data/features/orm_steps.rb +1 -1
- data/features/reader_steps.rb +1 -1
- data/features/store_steps.rb +1 -1
- data/features/support/env.rb +1 -1
- data/lib/publisci.rb +58 -0
- data/lib/{bio-publisci → publisci}/analyzer.rb +0 -0
- data/lib/{bio-publisci → publisci}/datacube_model.rb +1 -32
- data/lib/{bio-publisci → publisci}/dataset/ORM/data_cube_orm.rb +0 -0
- data/lib/{bio-publisci → publisci}/dataset/ORM/observation.rb +0 -8
- data/lib/{bio-publisci → publisci}/dataset/configuration.rb +0 -0
- data/lib/{bio-publisci → publisci}/dataset/data_cube.rb +0 -0
- data/lib/{bio-publisci → publisci}/dataset/dataset.rb +0 -0
- data/lib/{bio-publisci → publisci}/dataset/dataset_for.rb +0 -0
- data/lib/{bio-publisci → publisci}/dataset/interactive.rb +0 -0
- data/lib/{bio-publisci → publisci}/dsl/config.rb +0 -0
- data/lib/{bio-publisci → publisci}/dsl/dataset_dsl.rb +2 -1
- data/lib/{bio-publisci → publisci}/dsl/dsl.rb +0 -0
- data/lib/{bio-publisci → publisci}/dsl/metadata_dsl.rb +4 -0
- data/lib/{bio-publisci → publisci}/dsl/prov_dsl.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/generator.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/metadata.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/metadata_model.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/activity.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/agent.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/association.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/config.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/derivation.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/element.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/entity.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/model/prov_models.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/plan.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/prov.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/role.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/prov/usage.rb +0 -0
- data/lib/{bio-publisci → publisci}/metadata/publisher.rb +0 -0
- data/lib/{bio-publisci → publisci}/mixins/custom_predicate.rb +0 -0
- data/lib/{bio-publisci → publisci}/mixins/dereferencable.rb +0 -0
- data/lib/{bio-publisci → publisci}/mixins/registry.rb +0 -0
- data/lib/{bio-publisci → publisci}/mixins/vocabulary.rb +0 -0
- data/lib/{bio-publisci → publisci}/output.rb +0 -0
- data/lib/{bio-publisci → publisci}/parser.rb +0 -0
- data/lib/{bio-publisci → publisci}/post_processor.rb +0 -0
- data/lib/{bio-publisci → publisci}/query/query_helper.rb +2 -2
- data/lib/{bio-publisci → publisci}/readers/arff.rb +0 -0
- data/lib/{bio-publisci → publisci}/readers/base.rb +0 -0
- data/lib/{bio-publisci → publisci}/readers/csv.rb +0 -0
- data/lib/{bio-publisci → publisci}/readers/dataframe.rb +0 -0
- data/lib/{bio-publisci → publisci}/readers/maf.rb +0 -0
- data/lib/{bio-publisci → publisci}/readers/r_cross.rb +0 -0
- data/lib/{bio-publisci → publisci}/readers/r_matrix.rb +0 -0
- data/lib/{bio-publisci → publisci}/store.rb +0 -0
- data/lib/{bio-publisci → publisci}/writers/arff.rb +0 -0
- data/lib/{bio-publisci → publisci}/writers/base.rb +0 -0
- data/lib/{bio-publisci → publisci}/writers/csv.rb +0 -0
- data/lib/{bio-publisci → publisci}/writers/dataframe.rb +0 -0
- data/lib/template_bak.rb +1 -1
- data/scripts/get_gene_lengths.rb +2 -2
- data/scripts/islet_mlratio.rb +1 -1
- data/scripts/scan_islet.rb +1 -1
- data/scripts/update_reference.rb +1 -1
- data/spec/ORM/data_cube_orm_spec.rb +1 -1
- data/spec/ORM/prov_model_spec.rb +1 -1
- data/spec/analyzer_spec.rb +1 -1
- data/spec/bnode_spec.rb +1 -1
- data/spec/data_cube_spec.rb +1 -1
- data/spec/dataset_for_spec.rb +3 -3
- data/spec/dsl_spec.rb +12 -2
- data/spec/generators/csv_spec.rb +1 -1
- data/spec/generators/dataframe_spec.rb +1 -1
- data/spec/generators/maf_spec.rb +1 -1
- data/spec/generators/r_cross_spec.rb +1 -1
- data/spec/generators/r_matrix_spec.rb +1 -1
- data/spec/maf_query_spec.rb +1 -1
- data/spec/metadata/metadata_dsl_spec.rb +1 -1
- data/spec/prov/activity_spec.rb +1 -1
- data/spec/prov/agent_spec.rb +1 -1
- data/spec/prov/association_spec.rb +1 -1
- data/spec/prov/config_spec.rb +1 -1
- data/spec/prov/derivation_spec.rb +1 -1
- data/spec/prov/entity_spec.rb +1 -1
- data/spec/prov/role_spec.rb +1 -1
- data/spec/prov/usage_spec.rb +1 -1
- data/spec/r_builder_spec.rb +1 -1
- data/spec/writer_spec.rb +11 -9
- metadata +65 -191
- data/bin/bio-publisci-server +0 -50
- data/lib/bio-publisci.rb +0 -64
- data/lib/bio-publisci/r_client.rb +0 -54
- data/lib/bio-publisci/writers/json.rb +0 -18
- data/server/helpers.rb +0 -215
- data/server/public/src-min-noconflict/LICENSE +0 -24
- data/server/public/src-min-noconflict/ace.js +0 -11
- data/server/public/src-min-noconflict/ext-chromevox.js +0 -1
- data/server/public/src-min-noconflict/ext-elastic_tabstops_lite.js +0 -1
- data/server/public/src-min-noconflict/ext-emmet.js +0 -1
- data/server/public/src-min-noconflict/ext-keybinding_menu.js +0 -1
- data/server/public/src-min-noconflict/ext-language_tools.js +0 -1
- data/server/public/src-min-noconflict/ext-modelist.js +0 -1
- data/server/public/src-min-noconflict/ext-old_ie.js +0 -1
- data/server/public/src-min-noconflict/ext-searchbox.js +0 -1
- data/server/public/src-min-noconflict/ext-settings_menu.js +0 -1
- data/server/public/src-min-noconflict/ext-spellcheck.js +0 -1
- data/server/public/src-min-noconflict/ext-split.js +0 -1
- data/server/public/src-min-noconflict/ext-static_highlight.js +0 -1
- data/server/public/src-min-noconflict/ext-statusbar.js +0 -1
- data/server/public/src-min-noconflict/ext-textarea.js +0 -1
- data/server/public/src-min-noconflict/ext-themelist.js +0 -1
- data/server/public/src-min-noconflict/ext-whitespace.js +0 -1
- data/server/public/src-min-noconflict/keybinding-emacs.js +0 -1
- data/server/public/src-min-noconflict/keybinding-vim.js +0 -1
- data/server/public/src-min-noconflict/mode-ruby.js +0 -1
- data/server/public/src-min-noconflict/snippets/ruby.js +0 -1
- data/server/public/src-min-noconflict/theme-twilight.js +0 -1
- data/server/public/src-min-noconflict/worker-coffee.js +0 -1
- data/server/public/src-min-noconflict/worker-css.js +0 -1
- data/server/public/src-min-noconflict/worker-javascript.js +0 -1
- data/server/public/src-min-noconflict/worker-json.js +0 -1
- data/server/public/src-min-noconflict/worker-lua.js +0 -1
- data/server/public/src-min-noconflict/worker-php.js +0 -1
- data/server/public/src-min-noconflict/worker-xquery.js +0 -1
- data/server/routes.rb +0 -123
- data/server/views/dsl.haml +0 -65
- data/server/views/dump.haml +0 -3
- data/server/views/import.haml +0 -35
- data/server/views/new_repository.haml +0 -25
- data/server/views/query.haml +0 -28
- data/server/views/repository.haml +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 992e9282183a5b68f85d5835b91c761a53dd53f2
|
4
|
+
data.tar.gz: 5764fee6d82a2a8fc6b8835cc3fc0383ab2ad6eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 186f61e059fbb8d60038c2181829dc8f231af53dd87aaa3556a1ecb59a7e1289d62dc2d682a385e0d0d700b8533f8f4c50235fb6e4f35879407d2703e5a6fdcd
|
7
|
+
data.tar.gz: 341714efc592cbd634f2b427f37a72e6151902184e455028217d3c04d1cf3ee1b589cebb1da9cfde0055f612eb42743a7718f16e09a2d556feef430700fe1e1f
|
data/Gemfile
CHANGED
@@ -14,9 +14,9 @@ group :development do
|
|
14
14
|
gem "bio", ">= 1.4.2"
|
15
15
|
gem "rdoc", "~> 3.12"
|
16
16
|
gem "spoon"
|
17
|
-
gem "spira", git: "https://github.com/ruby-rdf/spira.git"
|
18
17
|
end
|
19
18
|
|
19
|
+
gem 'rest-client'
|
20
20
|
|
21
21
|
gem 'rdf'
|
22
22
|
gem 'rdf-4store', :git => "https://github.com/fumi/rdf-4store.git"
|
@@ -26,11 +26,4 @@ gem 'json-ld'
|
|
26
26
|
gem 'rserve-client'
|
27
27
|
gem 'sparql'
|
28
28
|
|
29
|
-
gem
|
30
|
-
|
31
|
-
gem 'sinatra'
|
32
|
-
gem 'sinatra-contrib'
|
33
|
-
gem 'sinatra-linkeddata'
|
34
|
-
gem 'sinatra-cross_origin'
|
35
|
-
gem 'rack-flash3'
|
36
|
-
gem 'rest-client'
|
29
|
+
gem "spira", git: "https://github.com/ruby-rdf/spira.git"
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# PubliSci
|
2
2
|
|
3
|
-
[![Build Status](https://
|
3
|
+
[![Build Status](https://travis-ci.org/wstrinz/publisci.png?branch=master)](https://travis-ci.org/wstrinz/publisci)
|
4
4
|
|
5
5
|
Full description goes here
|
6
6
|
|
@@ -9,15 +9,50 @@ Note: this software is under active development!
|
|
9
9
|
## Installation
|
10
10
|
|
11
11
|
```sh
|
12
|
-
gem install
|
12
|
+
gem install publisci
|
13
13
|
```
|
14
14
|
|
15
15
|
## Usage
|
16
16
|
|
17
17
|
```ruby
|
18
|
-
require '
|
18
|
+
require 'publisci'
|
19
|
+
include PubliSci::DSL
|
20
|
+
|
21
|
+
# Specify input data
|
22
|
+
data do
|
23
|
+
# use local or remote paths
|
24
|
+
source 'https://github.com/wstrinz/publisci/raw/master/spec/csv/bacon.csv'
|
25
|
+
|
26
|
+
# specify datacube properties
|
27
|
+
dimension 'producer', 'pricerange'
|
28
|
+
measure 'chunkiness'
|
29
|
+
|
30
|
+
# set parser specific options
|
31
|
+
option 'label_column', 'producer'
|
32
|
+
end
|
33
|
+
|
34
|
+
# Describe dataset
|
35
|
+
metadata do
|
36
|
+
dataset 'bacon'
|
37
|
+
title 'Bacon dataset'
|
38
|
+
creator 'Will Strinz'
|
39
|
+
description 'some data about bacon'
|
40
|
+
date '1-10-2010'
|
41
|
+
end
|
42
|
+
|
43
|
+
# Send output to an RDF::Repository
|
44
|
+
# can also use 'generate_n3' to output a turtle string
|
45
|
+
repo = to_repository
|
46
|
+
|
47
|
+
# run SPARQL queries on the dataset
|
48
|
+
PubliSci::QueryHelper.execute('select * where {?s ?p ?o} limit 5', repo)
|
49
|
+
|
50
|
+
# export in other formats
|
51
|
+
PubliSci::Writers::ARFF.new.from_store(repo)
|
19
52
|
```
|
20
53
|
|
54
|
+
|
55
|
+
|
21
56
|
The API doc is online. For more code examples see the test files in
|
22
57
|
the source tree.
|
23
58
|
|
@@ -26,7 +61,7 @@ the source tree.
|
|
26
61
|
Information on the source tree, documentation, examples, issues and
|
27
62
|
how to contribute, see
|
28
63
|
|
29
|
-
http://github.com/wstrinz/
|
64
|
+
http://github.com/wstrinz/publisci
|
30
65
|
|
31
66
|
The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.
|
32
67
|
|
@@ -43,7 +78,7 @@ and one of
|
|
43
78
|
|
44
79
|
## Biogems.info
|
45
80
|
|
46
|
-
This Biogem is published at (http://biogems.info/index.html#
|
81
|
+
This Biogem is published at (http://biogems.info/index.html#publisci)
|
47
82
|
|
48
83
|
## Copyright
|
49
84
|
|
data/README.rdoc
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
=
|
1
|
+
= publisci
|
2
2
|
|
3
3
|
{<img
|
4
|
-
src="https://secure.travis-ci.org/wstrinz/
|
5
|
-
/>}[http://travis-ci.org/#!/wstrinz/
|
4
|
+
src="https://secure.travis-ci.org/wstrinz/publisci.png"
|
5
|
+
/>}[http://travis-ci.org/#!/wstrinz/publisci]
|
6
6
|
|
7
7
|
Full description goes here
|
8
8
|
|
@@ -10,7 +10,7 @@ Note: this software is under active development!
|
|
10
10
|
|
11
11
|
== Installation
|
12
12
|
|
13
|
-
gem install
|
13
|
+
gem install publisci
|
14
14
|
|
15
15
|
== Usage
|
16
16
|
|
@@ -18,7 +18,7 @@ Note: this software is under active development!
|
|
18
18
|
|
19
19
|
To use the library
|
20
20
|
|
21
|
-
require '
|
21
|
+
require 'publisci'
|
22
22
|
|
23
23
|
The API doc is online. For more code examples see also the test files in
|
24
24
|
the source tree.
|
@@ -27,7 +27,7 @@ the source tree.
|
|
27
27
|
|
28
28
|
Information on the source tree, documentation, issues and how to contribute, see
|
29
29
|
|
30
|
-
http://github.com/wstrinz/
|
30
|
+
http://github.com/wstrinz/publisci
|
31
31
|
|
32
32
|
The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.
|
33
33
|
|
@@ -40,7 +40,7 @@ The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.
|
|
40
40
|
|
41
41
|
== Biogems.info
|
42
42
|
|
43
|
-
This Biogem is published at http://biogems.info/index.html#
|
43
|
+
This Biogem is published at http://biogems.info/index.html#publisci
|
44
44
|
|
45
45
|
== Copyright
|
46
46
|
|
data/Rakefile
CHANGED
@@ -15,13 +15,13 @@ require 'jeweler'
|
|
15
15
|
Jeweler::Tasks.new do |gem|
|
16
16
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
17
|
gem.name = "publisci"
|
18
|
-
gem.homepage = "http://github.com/wstrinz/
|
18
|
+
gem.homepage = "http://github.com/wstrinz/publisci"
|
19
19
|
gem.license = "MIT"
|
20
20
|
gem.summary = %Q{Publish scientific results to the semantic web}
|
21
21
|
gem.description = %Q{A toolkit for publishing scientific results and datasets using RDF, OWL, and related technologies }
|
22
22
|
gem.email = "wstrinz@gmail.com"
|
23
23
|
gem.authors = ["Will Strinz"]
|
24
|
-
gem.version = "0.1.
|
24
|
+
gem.version = "0.1.3"
|
25
25
|
|
26
26
|
# dependencies defined in Gemfile
|
27
27
|
end
|
@@ -1,23 +1,23 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
#
|
3
|
-
# BioRuby
|
3
|
+
# BioRuby publisci Plugin BioPublisci
|
4
4
|
# Author:: wstrinz
|
5
5
|
# Copyright:: 2013
|
6
6
|
|
7
7
|
version = "0.0.4" #File.new(VERSION_FILENAME).read.chomp
|
8
8
|
|
9
9
|
USAGE = <<-EOF
|
10
|
-
|
10
|
+
publisci #{version} by Will Strinz 2013
|
11
11
|
|
12
12
|
Usage:
|
13
13
|
|
14
|
-
|
14
|
+
publisci file
|
15
15
|
(execute PROV dsl file)
|
16
16
|
EOF
|
17
17
|
|
18
18
|
gempath = File.dirname(File.dirname(__FILE__))
|
19
19
|
$: << File.join(gempath,'lib')
|
20
|
-
require '
|
20
|
+
require 'publisci'
|
21
21
|
|
22
22
|
#VERSION_FILENAME=File.join(gempath,'VERSION')
|
23
23
|
|
@@ -42,7 +42,7 @@ else
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
require '
|
45
|
+
require 'publisci'
|
46
46
|
require 'optparse'
|
47
47
|
|
48
48
|
# Uncomment when using the bio-logger
|
@@ -97,7 +97,7 @@ begin
|
|
97
97
|
opts.parse!(ARGV)
|
98
98
|
|
99
99
|
# Uncomment the following when using the bio-logger
|
100
|
-
# Bio::Log::CLI.configure('
|
100
|
+
# Bio::Log::CLI.configure('publisci')
|
101
101
|
|
102
102
|
# TODO: your code here
|
103
103
|
# use options for your logic
|
data/examples/no_magic.prov
CHANGED
data/examples/no_magic.rb
CHANGED
data/examples/safe_gen.rb
CHANGED
data/features/orm_steps.rb
CHANGED
data/features/reader_steps.rb
CHANGED
data/features/store_steps.rb
CHANGED
data/features/support/env.rb
CHANGED
data/lib/publisci.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# This is temporary, just to help w/ development so I don't have to rewrite r2rdf.rb to be
|
2
|
+
# a standard gem base yet. Also load s the files instead of require for easy reloading
|
3
|
+
require 'tempfile'
|
4
|
+
require 'fileutils'
|
5
|
+
require 'csv'
|
6
|
+
|
7
|
+
require 'rdf'
|
8
|
+
require 'sparql'
|
9
|
+
require 'sparql/client'
|
10
|
+
require 'rdf/turtle'
|
11
|
+
require 'rdf/rdfxml'
|
12
|
+
require 'json/ld'
|
13
|
+
|
14
|
+
require 'rserve'
|
15
|
+
require 'rest-client'
|
16
|
+
|
17
|
+
begin
|
18
|
+
require 'spira'
|
19
|
+
rescue LoadError
|
20
|
+
puts "can't load spira; orm unavailable"
|
21
|
+
end
|
22
|
+
|
23
|
+
def load_folder(folder)
|
24
|
+
Dir.foreach(File.dirname(__FILE__) + "/#{folder}") do |file|
|
25
|
+
unless file == "." or file == ".."
|
26
|
+
f = File.dirname(__FILE__) + "/#{folder}/" + file
|
27
|
+
load f unless File.directory?(f)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
load_folder('publisci/mixins')
|
33
|
+
|
34
|
+
load File.dirname(__FILE__) + '/publisci/dataset/interactive.rb'
|
35
|
+
load File.dirname(__FILE__) + '/publisci/query/query_helper.rb'
|
36
|
+
load File.dirname(__FILE__) + '/publisci/parser.rb'
|
37
|
+
load File.dirname(__FILE__) + '/publisci/post_processor.rb'
|
38
|
+
load File.dirname(__FILE__) + '/publisci/analyzer.rb'
|
39
|
+
load File.dirname(__FILE__) + '/publisci/store.rb'
|
40
|
+
load File.dirname(__FILE__) + '/publisci/dataset/data_cube.rb'
|
41
|
+
load File.dirname(__FILE__) + '/publisci/dataset/dataset_for.rb'
|
42
|
+
load File.dirname(__FILE__) + '/publisci/dataset/configuration.rb'
|
43
|
+
load File.dirname(__FILE__) + '/publisci/dataset/dataset.rb'
|
44
|
+
load File.dirname(__FILE__) + '/publisci/datacube_model.rb'
|
45
|
+
load File.dirname(__FILE__) + '/publisci/output.rb'
|
46
|
+
load File.dirname(__FILE__) + '/publisci/metadata/prov/element.rb'
|
47
|
+
load File.dirname(__FILE__) + '/publisci/metadata/prov/prov.rb'
|
48
|
+
load File.dirname(__FILE__) + '/publisci/writers/base.rb'
|
49
|
+
load File.dirname(__FILE__) + '/publisci/readers/base.rb'
|
50
|
+
|
51
|
+
|
52
|
+
load_folder('publisci/dsl')
|
53
|
+
load_folder('publisci/metadata')
|
54
|
+
load_folder('publisci/metadata/prov')
|
55
|
+
load_folder('publisci/metadata/prov/model')
|
56
|
+
load_folder('publisci/readers')
|
57
|
+
load_folder('publisci/writers')
|
58
|
+
load_folder('publisci/dataset/ORM')
|
File without changes
|
@@ -3,11 +3,6 @@ begin
|
|
3
3
|
require 'spira'
|
4
4
|
module PubliSci
|
5
5
|
module ORM
|
6
|
-
# class Observation < Spira::Base
|
7
|
-
# type RDF::URI.new('http://purl.org/linked-data/cube#Observation')
|
8
|
-
# property :label, predicate: RDFS.label
|
9
|
-
|
10
|
-
# end
|
11
6
|
QB ||= RDF::Vocabulary.new(RDF::URI.new('http://purl.org/linked-data/cube#'))
|
12
7
|
|
13
8
|
class Component < Spira::Base
|
@@ -45,22 +40,6 @@ begin
|
|
45
40
|
Spira.add_repository :default, repo
|
46
41
|
end
|
47
42
|
|
48
|
-
# def observation
|
49
|
-
# unless PubliSci::ORM.const_defined?("Observation")
|
50
|
-
# obs = Class.new(Spira::Base) do
|
51
|
-
# type RDF::URI.new('http://purl.org/linked-data/cube#Observation')
|
52
|
-
|
53
|
-
# property :structure, predicate: QB.dataSet
|
54
|
-
|
55
|
-
# ((Dimension.each.to_a | Measure.each.to_a) || []).each{|component|
|
56
|
-
# property strip_uri(component.subject.to_s), predicate: component.subject
|
57
|
-
# }
|
58
|
-
# end
|
59
|
-
# PubliSci::ORM.const_set("Observation",obs)
|
60
|
-
# end
|
61
|
-
# Observation
|
62
|
-
# end
|
63
|
-
|
64
43
|
class Observation < Spira::Base
|
65
44
|
type QB.Observation
|
66
45
|
property :label, predicate: RDFS.label
|
@@ -76,22 +55,12 @@ begin
|
|
76
55
|
}
|
77
56
|
end
|
78
57
|
|
79
|
-
# for testing; DRY up eventually
|
80
58
|
def strip_uri(uri)
|
81
59
|
uri = uri.to_s.dup
|
82
60
|
uri[-1] = '' if uri[-1] == '>'
|
83
61
|
uri.to_s.split('/').last.split('#').last
|
84
62
|
end
|
85
|
-
|
86
|
-
# def method_missing(meth, *args, &block)
|
87
|
-
# if meth.to_s =~ /^find_by_(.+)$/
|
88
|
-
# run_find_by_method($1, *args, &block)
|
89
|
-
# else
|
90
|
-
# super # You *must* call super if you don't handle the
|
91
|
-
# # method, otherwise you'll mess up Ruby's method
|
92
|
-
# # lookup.
|
93
|
-
# end
|
94
|
-
# end
|
63
|
+
|
95
64
|
end
|
96
65
|
|
97
66
|
def reload_observation
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -18,6 +18,7 @@ module PubliSci
|
|
18
18
|
add_or_get('object',file)
|
19
19
|
end
|
20
20
|
alias_method :source, :object
|
21
|
+
alias_method :input, :object
|
21
22
|
|
22
23
|
def dimension(*args)
|
23
24
|
if args.size == 0
|
@@ -55,7 +56,7 @@ module PubliSci
|
|
55
56
|
def generate_n3
|
56
57
|
opts = {}
|
57
58
|
%w{dimension measure}.each{|field|
|
58
|
-
opts[field.to_sym] = send(field.to_sym) if send(field.to_sym)
|
59
|
+
opts["#{field}s".to_sym] = send(field.to_sym) if send(field.to_sym)
|
59
60
|
}
|
60
61
|
interact = settings.interactive
|
61
62
|
if options
|