dbd_onto_engine 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/dbd_onto_engine/ontologies_controller.rb +22 -1
- data/app/views/dbd_onto_engine/ontologies/_ontology_predicate.html.haml +1 -0
- data/app/views/dbd_onto_engine/ontologies/_ontology_title.html.haml +1 -0
- data/app/views/dbd_onto_engine/ontologies/index.html.haml +1 -1
- data/app/views/dbd_onto_engine/ontologies/show.html.haml +5 -0
- data/config/routes.rb +2 -1
- data/lib/dbd_onto_engine/version.rb +1 -1
- data/lib/dbd_onto_engine.rb +1 -0
- data/spec/dummy/log/test.log +2004 -0
- data/spec/features/dbd_onto_engine/ontologies_spec.rb +22 -1
- metadata +18 -2
- data/app/views/dbd_onto_engine/ontologies/_ontology_entry.html.haml +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24a2e9f3bf0cbaa63aed887623762cabff44208d
|
4
|
+
data.tar.gz: 6bbffce2afa32dae65d7e9991549661957a11b30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc74cd90bc69ce6262d5328e36556ad3378a702606c543376b49349578462b082fa96180bc098fbf487929ee4e4e4b8d0c94ba5fe470340b2bee9e91678c4822
|
7
|
+
data.tar.gz: b6119fd94e257a6f86fdf72bb978f25f21083b6af466123ed188fc5ea3bde8246278a92e5ba92759401e53df4e724a472dedc3bdca35c437d46e200729f965e7
|
@@ -3,7 +3,28 @@ require_dependency "dbd_onto_engine/application_controller"
|
|
3
3
|
module DbdOntoEngine
|
4
4
|
class OntologiesController < ApplicationController
|
5
5
|
def index
|
6
|
-
@ontologies =
|
6
|
+
@ontologies = supported_ontologies
|
7
|
+
end
|
8
|
+
|
9
|
+
def show
|
10
|
+
@ontology = params[:id]
|
11
|
+
@ontology_predicates = ontology_class(@ontology).new.
|
12
|
+
select{ |e| e.predicate == 'meta:defines_predicate'}.
|
13
|
+
map(&:object)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def supported_ontologies
|
19
|
+
%w{context meta}
|
20
|
+
end
|
21
|
+
|
22
|
+
def ontology_class(ontology_name)
|
23
|
+
if supported_ontologies.include? @ontology
|
24
|
+
Object.const_get("DbdOnto::#{@ontology.capitalize}")
|
25
|
+
else
|
26
|
+
raise "Invalid ontology"
|
27
|
+
end
|
7
28
|
end
|
8
29
|
end
|
9
30
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
%p= ontology_predicate
|
@@ -0,0 +1 @@
|
|
1
|
+
%h3= ontology_title.capitalize
|
data/config/routes.rb
CHANGED