easy_data 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -0
- data/lib/controllers/easy_datas_controller.rb +96 -26
- data/lib/data_models/RDFa.rb +91 -0
- data/lib/data_models/linked_data_graph.rb +7 -10
- data/lib/data_models/model_rdf.rb +83 -21
- data/lib/easy_data/tasks.rb +6 -2
- data/lib/easy_data/templates/easy_datas/_data_publications.html.erb +16 -0
- data/lib/easy_data/templates/easy_datas/_footer.html.erb +3 -0
- data/lib/easy_data/templates/easy_datas/_list_model_info.html.erb +23 -0
- data/lib/easy_data/templates/easy_datas/_list_properties_edit.html.erb +1 -1
- data/lib/easy_data/templates/easy_datas/_menu.html.erb +20 -4
- data/lib/easy_data/templates/easy_datas/_menu_custom.html.erb +15 -0
- data/lib/easy_data/templates/easy_datas/_model_attributes.html.erb +21 -5
- data/lib/easy_data/templates/easy_datas/_model_attributes_edit.html.erb +6 -3
- data/lib/easy_data/templates/easy_datas/_model_attributes_info.html.erb +4 -3
- data/lib/easy_data/templates/easy_datas/_settings.html.erb +30 -0
- data/lib/easy_data/templates/easy_datas/custom_rdf.html.erb +17 -15
- data/lib/easy_data/templates/easy_datas/info_easy_data.html.erb +2 -2
- data/lib/easy_data/templates/easy_datas/view_settings.html.erb +29 -0
- data/lib/easy_data/templates/images/bg_ft.png +0 -0
- data/lib/easy_data/templates/images/bg_link.jpg +0 -0
- data/lib/easy_data/templates/images/logo_ft.png +0 -0
- data/lib/easy_data/templates/images/main_menu.jpg +0 -0
- data/lib/easy_data/templates/images/rdf_icon.jpeg +0 -0
- data/lib/easy_data/templates/images/shadow_menu.png +0 -0
- data/lib/easy_data/templates/layouts/easy_data_layout.html.erb +3 -1
- data/lib/easy_data/templates/stylesheets/easy_data_style.css +38 -6
- data/lib/easy_data/version.rb +1 -1
- data/lib/easy_data.rb +2 -1
- data/lib/routes.rb +4 -0
- data/lib/tasks/testing_installation.rb +1 -1
- metadata +16 -7
- data/lib/data_models/parser_rdf.rb +0 -22
- data/lib/easy_data/templates/stylesheets/.easy_data_style.css.swp +0 -0
- data/lib/tasks/.rakes.rb.swp +0 -0
data/README
CHANGED
@@ -13,6 +13,10 @@ At the end, execute the next task:
|
|
13
13
|
|
14
14
|
rake easy_data:install RAILS_ENV=development
|
15
15
|
|
16
|
+
To start with administration, you should assign at admin user:
|
17
|
+
|
18
|
+
rake easy_data:add_user[user,pass] RAILS_ENV=development
|
19
|
+
|
16
20
|
Commandas and Query
|
17
21
|
======================
|
18
22
|
|
@@ -58,6 +58,7 @@ class EasyDatasController < ActionController::Base
|
|
58
58
|
def info_easy_data
|
59
59
|
models = DataModels.load_models
|
60
60
|
@list = []
|
61
|
+
@settings ||= YAML::load(File.open("#{RAILS_ROOT}/config/easy_data/setting.yaml"))
|
61
62
|
|
62
63
|
models.each do |mod|
|
63
64
|
@list << "#{mod.gsub("::","_")}"
|
@@ -83,6 +84,7 @@ class EasyDatasController < ActionController::Base
|
|
83
84
|
|
84
85
|
def custom_rdf
|
85
86
|
@models = DataModels.load_models
|
87
|
+
@settings ||= YAML::load(File.open("#{RAILS_ROOT}/config/easy_data/setting.yaml"))
|
86
88
|
end
|
87
89
|
|
88
90
|
def model_attributes
|
@@ -91,6 +93,7 @@ class EasyDatasController < ActionController::Base
|
|
91
93
|
|
92
94
|
@model_attributes = rdf.get_attributes_model(params[:model])
|
93
95
|
@model = params[:model]
|
96
|
+
|
94
97
|
|
95
98
|
render :partial => "model_attributes",:layout => nil
|
96
99
|
|
@@ -126,14 +129,22 @@ class EasyDatasController < ActionController::Base
|
|
126
129
|
|
127
130
|
@namespace = params[:id]
|
128
131
|
@model_attributes = rdf.get_attributes_model(params[:model])
|
129
|
-
|
132
|
+
|
130
133
|
properties = (eval namespace).properties_form
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
134
|
+
|
135
|
+
if params[:attribute]!=params[:model]
|
136
|
+
render :inline => "<span>Property:</span><%= select type+'_property',attribute,properties,{:prompt => 'Select a property...'} -%><span class='rdf_info'>(Current value: <%= current_value%>)</span>",
|
137
|
+
:locals => {:properties => properties,
|
138
|
+
:type => params[:type],
|
139
|
+
:attribute => params[:attribute],
|
140
|
+
:current_value => @model_attributes[params[:type]][params[:attribute]][:property]}
|
141
|
+
else
|
142
|
+
render :inline => "<span>Property:</span><%= select 'property',attribute,properties,{:prompt => 'Select a property...'} -%><span class='rdf_info'>(Current value: <%= current_value%>)</span><br />",
|
143
|
+
:locals => {:properties => properties,
|
144
|
+
:attribute => params[:model],
|
145
|
+
:current_value => @model_attributes[:property]}
|
146
|
+
|
147
|
+
end
|
137
148
|
else
|
138
149
|
render :inline => ""
|
139
150
|
end
|
@@ -159,37 +170,84 @@ class EasyDatasController < ActionController::Base
|
|
159
170
|
|
160
171
|
rdf = ModelRdf.new
|
161
172
|
@model = params[:model]
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
173
|
+
unless params["attributes_property"].nil?
|
174
|
+
params["rdf_type_attributes"].each do |att,value|
|
175
|
+
if params["attributes_property"][att] != "" && value != ""
|
176
|
+
rdf.update_attributes_model(params[:model],att,'namespace',value)
|
177
|
+
rdf.update_attributes_model(params[:model],att,'property',params["attributes_property"][att])
|
178
|
+
rdf.update_attributes_model(params[:model],att,'privacy',rdf.privacy(params[:privacy][att].to_i))
|
179
|
+
end
|
180
|
+
end
|
169
181
|
end
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
182
|
+
unless params["associations_property"].nil?
|
183
|
+
params["rdf_type_associations"].each do |assoc,value|
|
184
|
+
if value != "" && params["associations_property"][assoc] != ""
|
185
|
+
rdf.update_associations_model(params[:model],assoc,'namespace',value)
|
186
|
+
rdf.update_associations_model(params[:model],assoc,'property',params["associations_property"][assoc])
|
187
|
+
rdf.update_associations_model(params[:model],assoc,'privacy',rdf.privacy(params[:privacy][assoc].to_i))
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
rdf.update_model(params[:model],"privacy",params[:privacy][params[:model]]) if params[:privacy][params[:model]]
|
193
|
+
if params[:property]
|
194
|
+
rdf.update_model(params[:model],"namespace",params[:namespace][params[:model]])
|
195
|
+
rdf.update_model(params[:model],"property",params[:property][params[:model]])
|
177
196
|
end
|
178
|
-
|
179
197
|
rdf.save
|
180
198
|
|
181
199
|
@model_attributes = rdf.get_attributes_model(@model)
|
182
200
|
|
183
201
|
render :partial => "model_attributes",:layout => nil
|
184
202
|
end
|
203
|
+
|
204
|
+
def view_settings
|
205
|
+
@settings ||= YAML::load(File.open("#{RAILS_ROOT}/config/easy_data/setting.yaml"))
|
206
|
+
render :template => "easy_datas/view_settings", :layout => false
|
207
|
+
end
|
208
|
+
|
209
|
+
def settings
|
210
|
+
@settings ||= YAML::load(File.open("#{RAILS_ROOT}/config/easy_data/setting.yaml"))
|
211
|
+
@images = Dir["#{RAILS_ROOT}/public/images/*"].map{|img| [img.gsub("#{RAILS_ROOT}/public/images/",""),img.gsub("#{RAILS_ROOT}/public/images/","")]}
|
212
|
+
render :partial => "settings",:layout => nil
|
213
|
+
end
|
214
|
+
|
215
|
+
def custom_settings
|
216
|
+
@settings = YAML::load(File.open("#{RAILS_ROOT}/config/easy_data/setting.yaml"))
|
217
|
+
|
218
|
+
if !params["project"]["project"].empty? && params["project"]["project"]!=@settings["project"]["name"]
|
219
|
+
@settings["project"]["name"] = params["project"]["project"]
|
220
|
+
end
|
221
|
+
|
222
|
+
if !params["project"]["logo"].empty? && params["project"]["logo"]!=@settings["project"]["logo"]
|
223
|
+
@settings["project"]["logo"] = params["project"]["logo"]
|
224
|
+
end
|
225
|
+
|
226
|
+
if !params["project"]["description"].empty? && params["project"]["description"]!=@settings["project"]["description"]
|
227
|
+
@settings["project"]["description"] = params["project"]["description"]
|
228
|
+
end
|
229
|
+
|
230
|
+
if !params["user_admin"]["user"].empty? && !params["user_admin"]["pass"].empty?
|
231
|
+
(@settings["user_admin"]["user"] = params["user_admin"]["user"]) if @settings["user_admin"]["user"]!=params["user_admin"]["user"]
|
232
|
+
(@settings["user_admin"]["pass"] = params["user_admin"]["pass"]) if @settings["user_admin"]["pass"]!=params["user_admin"]["pass"]
|
233
|
+
end
|
234
|
+
|
235
|
+
if !params["access"]["ip"].empty?
|
236
|
+
(@settings["access"]["ip"] = params["access"]["ip"]) if params["access"]["ip"]!=@settings["access"]["ip"]
|
237
|
+
end
|
238
|
+
|
239
|
+
save_settings(@settings)
|
240
|
+
|
241
|
+
render :template => "easy_datas/view_settings",:layout => false
|
242
|
+
end
|
185
243
|
|
186
244
|
def authenticate_user
|
187
245
|
end
|
188
246
|
|
189
247
|
def login
|
190
|
-
admin = YAML::load(File.open("#{RAILS_ROOT}/config/easy_data/setting.yaml"))
|
248
|
+
@admin = YAML::load(File.open("#{RAILS_ROOT}/config/easy_data/setting.yaml"))
|
191
249
|
|
192
|
-
if admin["user_admin"]["user"] == params[:nick] && admin["user_admin"]["password"] == params[:pass]
|
250
|
+
if @admin["user_admin"]["user"] == params[:nick] && @admin["user_admin"]["password"] == params[:pass]
|
193
251
|
@current_user = params[:nick]
|
194
252
|
session[:easy_data_session] = params[:nick]
|
195
253
|
redirect_to :action => "custom_rdf"
|
@@ -223,9 +281,21 @@ class EasyDatasController < ActionController::Base
|
|
223
281
|
end
|
224
282
|
|
225
283
|
def authenticated
|
226
|
-
|
227
|
-
|
284
|
+
admin = YAML::load(File.open("#{RAILS_ROOT}/config/easy_data/setting.yaml"))
|
285
|
+
|
286
|
+
if admin["access"]["ip"].nil? || admin["access"]["ip"].to_s == request.ip.to_s
|
287
|
+
if session[:easy_data_session].nil?
|
288
|
+
redirect_to :action => "authenticate_user"
|
289
|
+
end
|
290
|
+
else
|
291
|
+
render :nothing => true, :status => 404
|
228
292
|
end
|
229
293
|
end
|
230
294
|
|
295
|
+
def save_settings(settings)
|
296
|
+
file = File.open("#{RAILS_ROOT}/config/easy_data/setting.yaml",'w')
|
297
|
+
file.puts YAML::dump(settings)
|
298
|
+
file.close
|
299
|
+
end
|
300
|
+
|
231
301
|
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
require "data_models/model_rdf"
|
2
|
+
|
3
|
+
class RDFa
|
4
|
+
|
5
|
+
def self.model(model)
|
6
|
+
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.attribute(model,attributes)
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
####################################
|
14
|
+
# HTML Tags
|
15
|
+
####################################
|
16
|
+
|
17
|
+
#-----------------------------------------------Links
|
18
|
+
def a(model,href,attribute=nil,options=nil)
|
19
|
+
_html_code('a',model,attribute,"href='#{href||'#'}' "+options.to_s)
|
20
|
+
end
|
21
|
+
|
22
|
+
#-----------------------------------------------End Links
|
23
|
+
#-----------------------------------------------List_to_user
|
24
|
+
def ul(model,value,attribute=nil,options=nil)
|
25
|
+
_html_code_list('ul',model,value,options)
|
26
|
+
end
|
27
|
+
|
28
|
+
def ol(model,value,attribute=nil,options=nil)
|
29
|
+
_html_code_list('ol',model,value,options)
|
30
|
+
end
|
31
|
+
#-----------------------------------------------End List_to_user
|
32
|
+
#------------------------------------------------AUTO-CLOSED
|
33
|
+
def img(model,value,attribute=nil,options=nil)
|
34
|
+
_html_code('img',model,nil,attribute,"src='#{value||'#'}' "+options.to_s)
|
35
|
+
end
|
36
|
+
|
37
|
+
def input(model,type,attribute=nil,options=nil)
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
#------------------------------------------------END AUTO-CLOSED
|
41
|
+
|
42
|
+
# This method is called if doesnt exist the method called by class's users
|
43
|
+
def method_missing(sym, *args, &block)
|
44
|
+
_html_code(sym.to_s,args[0],args[1],args[2],args[3])
|
45
|
+
end
|
46
|
+
|
47
|
+
#######################################
|
48
|
+
# Generate html code with RDFa info
|
49
|
+
#######################################
|
50
|
+
private
|
51
|
+
|
52
|
+
def _html_code(tag,model,value,attribute,options = "")
|
53
|
+
rdf_info = ModelRdf.new
|
54
|
+
|
55
|
+
if attribute.nil? #prefix + type_of
|
56
|
+
options = (options || "") + rdf_info.get_prefix(model)
|
57
|
+
options = options + rdf_info.model(model)
|
58
|
+
else #property
|
59
|
+
options = (options||"") + rdf_info.attribute(model,attribute)
|
60
|
+
end
|
61
|
+
|
62
|
+
unless value.nil?
|
63
|
+
"<#{tag} #{options}>#{value}</#{tag}>"
|
64
|
+
else
|
65
|
+
"<#{tag} #{options}/>"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def _html_code_list(tag,model,value,options = "")
|
70
|
+
rdf_info = ModelRdf.new
|
71
|
+
|
72
|
+
options = (options || "") + rdf_info.get_prefix(model)
|
73
|
+
options = options + rdf_info.model(model)
|
74
|
+
|
75
|
+
data_model = rdf_info.get_attributes_model(model)
|
76
|
+
|
77
|
+
html = "<#{tag} #{options}>"
|
78
|
+
unless value.nil?
|
79
|
+
data_model["attributes"].each do |att,info|
|
80
|
+
if info[:namespace] && info[:property]
|
81
|
+
html << "<li property='#{info[:namespace]}:#{info[:property]}'>#{value.attributes[att]}</li>"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
html << "</#{tag}>"
|
86
|
+
end
|
87
|
+
html
|
88
|
+
end
|
89
|
+
|
90
|
+
|
91
|
+
end
|
@@ -37,7 +37,7 @@ class LinkedDataGraph
|
|
37
37
|
eval mod_assoc
|
38
38
|
rescue
|
39
39
|
begin
|
40
|
-
eval
|
40
|
+
eval mod_assoc.pluralize
|
41
41
|
mod_assoc = (mod_assoc.pluralize)
|
42
42
|
rescue
|
43
43
|
(mod_assoc = info.options[:source].to_s.camelize)if info.options[:source]
|
@@ -57,22 +57,19 @@ class LinkedDataGraph
|
|
57
57
|
|
58
58
|
file.puts "digraph G {"
|
59
59
|
#file.puts 'size="15,15";'
|
60
|
-
file.puts
|
61
|
-
file.puts
|
62
|
-
|
60
|
+
file.puts 'graph [rotate=0, rankdir="LR"]'
|
61
|
+
file.puts 'node [color="#333333", style=filled,shape=box, fontname="Trebuchet MS"]'
|
62
|
+
file.puts 'edge [color="#666666", arrowhead="open", fontname="Trebuchet MS", fontsize="11"]'
|
63
|
+
file.puts model.to_s+' [fillcolor="#116611", fontcolor="white"]'
|
64
|
+
|
63
65
|
#Draw nodes
|
64
66
|
|
65
67
|
graph_info[:assoc].each do |assoc|
|
66
|
-
file.puts
|
68
|
+
file.puts assoc.to_s+' [fillcolor="#294b76", fontcolor="white"]'
|
67
69
|
file.puts '"'+model+'" -> "'+assoc.to_s+'"[dir=none];'
|
68
70
|
end
|
69
71
|
|
70
72
|
|
71
|
-
#Draw associations between nodes
|
72
|
-
# graph_info[:assoc].each do |assoc,nodes|
|
73
|
-
# file.puts nodes+' [dir=none];'
|
74
|
-
# end
|
75
|
-
|
76
73
|
file.puts "}"
|
77
74
|
|
78
75
|
file.close
|
@@ -23,21 +23,80 @@ class ModelRdf
|
|
23
23
|
def get_models
|
24
24
|
self.model_rdf
|
25
25
|
end
|
26
|
+
|
27
|
+
def public?()
|
28
|
+
self.model_rdf[model][:privacy] == "Public"
|
29
|
+
end
|
30
|
+
|
31
|
+
def private?()
|
32
|
+
self.model_rdf[model][:privacy] == "Private"
|
33
|
+
end
|
26
34
|
|
35
|
+
def hidden?()
|
36
|
+
self.model_rdf[model][:privacy] == "Hidden"
|
37
|
+
end
|
38
|
+
|
39
|
+
def get_rdf_info_model(model)
|
40
|
+
{:namespace => self.model_rdf[model][:namespace],:property => self.model_rdf[model][:property]}
|
41
|
+
end
|
27
42
|
#Return attributes of model stored in the configuration yaml file
|
28
43
|
def get_attributes_model(model)
|
29
44
|
self.model_rdf[model]
|
30
45
|
end
|
46
|
+
|
47
|
+
# RDFa: Return attributes of model RDF info
|
48
|
+
def model(model)
|
49
|
+
info = get_rdf_info_model(model)
|
50
|
+
if info[:property] && info[:property]!= "not defined"
|
51
|
+
" typeof='#{info[:namespace]}:#{info[:property]}'"
|
52
|
+
else
|
53
|
+
" "
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# update model rdf info
|
58
|
+
def update_model(model,param,value)
|
59
|
+
self.model_rdf[model][param.to_sym] = value
|
60
|
+
end
|
31
61
|
|
32
62
|
# update attributes with rdf properties.
|
33
63
|
def update_attributes_model(model,attribute,param,value)
|
34
64
|
self.model_rdf[model]['attributes'][attribute][param.to_sym] = value
|
35
65
|
end
|
36
66
|
|
67
|
+
# RDFa: Return attribute rdf info
|
68
|
+
def attribute(model,attribute)
|
69
|
+
att_rdf = self.model_rdf[model]['attributes'][attribute]
|
70
|
+
" property='#{att_rdf[:namespace]}:#{att_rdf[:property]}'"
|
71
|
+
end
|
72
|
+
|
37
73
|
def update_associations_model(model,association,param,value)
|
38
74
|
self.model_rdf[model]['associations'][association][param.to_sym] = value
|
39
75
|
end
|
40
|
-
|
76
|
+
|
77
|
+
# RDFa: return a string with all prefix used to describes attributes
|
78
|
+
def get_prefix(model)
|
79
|
+
prefix = []
|
80
|
+
data_model = get_attributes_model(model)
|
81
|
+
data_model["attributes"].each do |att,info|
|
82
|
+
if info[:namespace] && info[:namespace] != 'not defined'
|
83
|
+
puts info[:namespace]
|
84
|
+
prefix << "#{info[:namespace]}:#{(eval "EasyData::RDF::#{info[:namespace].upcase}.get_uri")} "
|
85
|
+
end
|
86
|
+
end
|
87
|
+
data_model["associations"].each do |assoc,info|
|
88
|
+
if info[:namespace] && info[:namespace] != 'not defined'
|
89
|
+
prefix << "#{info[:namespace]}:#{(eval "EasyData::RDF::#{info[:namespace].upcase}.get_uri")} "
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
if data_model[:namespace] && data_model[:namespace] != 'not defined'
|
94
|
+
prefix << "#{data_model[:namespace]}:#{(eval "EasyData::RDF::#{data_model[:namespace].upcase}.get_uri")}"
|
95
|
+
end
|
96
|
+
|
97
|
+
prefix.uniq.join(" ")
|
98
|
+
end
|
99
|
+
|
41
100
|
# Return privacy of a attribute
|
42
101
|
def privacy(index)
|
43
102
|
@@privacy[index]
|
@@ -50,31 +109,34 @@ class ModelRdf
|
|
50
109
|
file.close
|
51
110
|
end
|
52
111
|
|
53
|
-
|
54
112
|
#######################################################################
|
55
|
-
# Building RDF
|
113
|
+
# Building RDF
|
56
114
|
#######################################################################
|
57
115
|
|
58
116
|
def get_model_rdf(query,model,host)
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
117
|
+
if public?model.to_sym
|
118
|
+
request = {:body => "",:header => {"xmlns:rdf"=>"http://www.w3.org/1999/02/22-rdf-syntax-ns#"}}
|
119
|
+
elements = {}
|
120
|
+
models = []
|
121
|
+
query.each do |element|
|
122
|
+
elements[element.id] = {'description' => "#{host}/#{element.class.to_s}/#id:#{element.id}",
|
123
|
+
'attributes' => get_properties_tag(element),
|
124
|
+
'associations' => get_associations_tag(element)
|
125
|
+
}
|
67
126
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
127
|
+
models << element.class.to_s
|
128
|
+
end
|
129
|
+
|
130
|
+
attributes = {}
|
131
|
+
request[:body] = elements
|
132
|
+
models.each do |mod|
|
133
|
+
attributes = get_attributes_model(mod) || get_attributes_model((eval mod).base_class.to_s)
|
134
|
+
request[:header].merge!(get_header(attributes))
|
135
|
+
end
|
136
|
+
request
|
137
|
+
else
|
138
|
+
{}
|
139
|
+
end
|
78
140
|
end
|
79
141
|
|
80
142
|
def get_header(attributes)
|
data/lib/easy_data/tasks.rb
CHANGED
@@ -44,7 +44,7 @@ namespace :easy_data do
|
|
44
44
|
easy_data_dir = "#{RAILS_ROOT}/config/easy_data"
|
45
45
|
|
46
46
|
unless File.exist? easy_data_dir
|
47
|
-
|
47
|
+
Dir.mkdir easy_data_dir
|
48
48
|
end
|
49
49
|
|
50
50
|
file = File.open("#{easy_data_dir}/rdf_info.yaml","w")
|
@@ -90,6 +90,7 @@ namespace :easy_data do
|
|
90
90
|
end
|
91
91
|
|
92
92
|
FileUtils.copy(File.join(File.dirname(__FILE__), 'templates/stylesheets/easy_data_style.css'),"#{easy_data_stylesheets}/easy_data_style.css")
|
93
|
+
|
93
94
|
FileUtils.cp_r(File.join(File.dirname(__FILE__), 'templates/images/'),"#{easy_data_stylesheets}/")
|
94
95
|
|
95
96
|
unless File.exist? easy_data_linked_data_graphs
|
@@ -110,7 +111,10 @@ namespace :easy_data do
|
|
110
111
|
file = File.open("#{easy_data_dir}/setting.yaml","w")
|
111
112
|
file.puts "#User admin:"
|
112
113
|
|
113
|
-
admin = {"user_admin" =>{"user" => args.user,"pass" => args.pass}
|
114
|
+
admin = {"user_admin" =>{"user" => args.user,"pass" => args.pass},
|
115
|
+
"project" => {"name" => nil, "contact_email" => nil,"description" => nil},
|
116
|
+
"access" => {"ip" => nil}
|
117
|
+
}
|
114
118
|
file.puts admin.to_yaml
|
115
119
|
|
116
120
|
file.close
|
@@ -13,4 +13,20 @@
|
|
13
13
|
</div>
|
14
14
|
|
15
15
|
<div id="info_models" class="ed_info_models">
|
16
|
+
|
17
|
+
<span class="title_data_publications">Bienvenido al sistema de información de la interfaz RDF del proyecto <%#= proyect%></span>
|
18
|
+
<p>
|
19
|
+
En el panel izquierdo se listan los modelos de la aplicación de los cuales se han publicado sus datos para acceso mediante URI's desreferenciables. Si pincha sobre cualquiera de ellos podrá visualizar los datos publicados de éstos. Los datos se dividen en atributos, que son propios del modelo y que lo describen y, asociaciones con otros modelos. De esta forma tendrá una visión de la información que puede consultar a la aplicación mediante la interfaz RDF de la que dispone.
|
20
|
+
</p>
|
21
|
+
<p>
|
22
|
+
Si tiene alguna duda sobre el funcionamiento o el modo de acceso a los datos publicados y no encuentra solución aquí puede enviarnos un email de consulta a <%#= email_admin%>.
|
23
|
+
</p>
|
24
|
+
<p>
|
25
|
+
Un saludo.
|
26
|
+
</p>
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
16
32
|
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div id="select_privacy">
|
2
|
+
<span>Access privacy: </span>
|
3
|
+
<%= select "privacy","#{model_name}", {"Hidden" => "Hidden","Public" => "Public","Privacy" => "Privacy"}%>
|
4
|
+
<span class="rdf_info"><%= "(Current value: #{model[:privacy]})"%></span>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<br />
|
8
|
+
|
9
|
+
<div id="<%="select_#{model_name}"%>">
|
10
|
+
<span>Rdf Type: </span>
|
11
|
+
<%= select "namespace","#{model_name}",namespaces,{:prompt => "Select a namespaces..."} -%>
|
12
|
+
<span class="rdf_info"><%= "(Current value: #{model[:namespace]})" %></span>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<%= observe_field "namespace_#{model_name}",{:url => {:controller => "easy_datas",:action => "load_properties",
|
16
|
+
:block=>"properties_#{model_name}",:attribute => model_name,:model => model_name,:type => type},
|
17
|
+
:with => '"id="+value',
|
18
|
+
:on => :selected,
|
19
|
+
:update => "properties_#{model_name}"}
|
20
|
+
%>
|
21
|
+
<br/>
|
22
|
+
<div id="<%= "properties_#{model_name}"%>"> </div>
|
23
|
+
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<% unless properties[:privacy].nil?%>
|
7
7
|
<div id="select_privacy">
|
8
8
|
<span>Access privacy: </span>
|
9
|
-
<%= select "privacy",att, {"Hidden" =>
|
9
|
+
<%= select "privacy",att, {"Hidden" => "Hidden","Public" => "Public","Private" => "Private"}%>
|
10
10
|
<span class="rdf_info"><%= "(Current value: #{properties[:privacy]})"%></span>
|
11
11
|
</div>
|
12
12
|
<br />
|
@@ -1,8 +1,24 @@
|
|
1
1
|
<div class="ed_main_menu">
|
2
2
|
<ul>
|
3
|
-
<li
|
4
|
-
<li><%=
|
5
|
-
|
6
|
-
|
3
|
+
<li class="layer_menu"><%= "#{@settings["project"]["name"]||nil} - "%>Data Publications Information</li>
|
4
|
+
<li class="menu_link"><%= link_to "Data Publications",{:controller => "easy_datas",:action => "info_easy_data"},
|
5
|
+
{:title => "Data Publications"}
|
6
|
+
%>
|
7
|
+
</li>
|
8
|
+
<li class="menu_link"><%= link_to_remote "Linked Data",:url => {:controller => "easy_datas",:action => "load_linked_data_graph"},
|
9
|
+
:update => "information_content",
|
10
|
+
:html => {:title => "Linked Data"}
|
11
|
+
%>
|
12
|
+
</li>
|
13
|
+
<li class="menu_link"><%= link_to_remote "Access to Data", :url => {:controller => "easy_datas", :action => "access_to_data"},
|
14
|
+
:update => "information_content",
|
15
|
+
:html => {:title => "How to access to data publications?"}
|
16
|
+
%>
|
17
|
+
</li>
|
18
|
+
<li class="menu_link"><%= link_to_remote "Quiz", :url => {:controller => 'easy_datas',:action => 'faq'},
|
19
|
+
:update => "information_content",
|
20
|
+
:html => {:title => "Any questions?"}
|
21
|
+
%>
|
22
|
+
</li>
|
7
23
|
</ul>
|
8
24
|
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="ed_main_menu">
|
2
|
+
<ul>
|
3
|
+
<li class="layer_menu"><%= "#{@settings["project"]["name"]||nil} - "%>Custom RDF Information</li>
|
4
|
+
<li class="menu_link"><%= link_to "Custom Rdf",{:controller => "easy_datas",:action => "custom_rdf"},
|
5
|
+
{:title => "Custom RDF information"}
|
6
|
+
%>
|
7
|
+
</li>
|
8
|
+
<li class="menu_link"><%= link_to_remote "Settings",:url => {:controller => "easy_datas",:action => "view_settings"},
|
9
|
+
:update => "custom_content",
|
10
|
+
:html => {:title => "Project Settings"}
|
11
|
+
%>
|
12
|
+
</li>
|
13
|
+
<li class="menu_link"><a href="mailto:jnillo9@gmail.com?subject='Any cuestion about EasyData'" title="Cuestion to Jnillo">Quiz</a></li>
|
14
|
+
</ul>
|
15
|
+
</div>
|
@@ -2,9 +2,25 @@
|
|
2
2
|
|
3
3
|
<%if @model_attributes.respond_to?:each%>
|
4
4
|
<!-- ATTRIBUTES -->
|
5
|
-
|
5
|
+
|
6
|
+
<span class="title_data_publications">Model</span>
|
7
|
+
<div class="attributes_info">
|
8
|
+
<div id="privacy">
|
9
|
+
<span>Access privacy:</span>
|
10
|
+
<span><%= @model_attributes[:privacy] %></span>
|
11
|
+
</div>
|
12
|
+
<div id="<%="namespace"%>">
|
13
|
+
<span><b>Rdf Namespace:</b></span>
|
14
|
+
<span><%= @model_attributes[:namespace] -%></span>
|
15
|
+
</div>
|
16
|
+
<div id="<%= "property"%>">
|
17
|
+
<span><b>Property:</b></span>
|
18
|
+
<span><%=@model_attributes[:property] %></span>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<span class="title_data_publications">Resource Attributes</span>
|
6
22
|
<%= render :partial => "list_properties",:locals => {:attributes => @model_attributes["attributes"]} %>
|
7
|
-
<span>Associations whit others Resources</span>
|
23
|
+
<span class="title_data_publications">Associations whit others Resources</span>
|
8
24
|
<!--ASSOCIATIONS-->
|
9
25
|
<%= render :partial => "list_properties",:locals => {:attributes => @model_attributes["associations"]} %>
|
10
26
|
<%else%>
|
@@ -14,13 +30,13 @@
|
|
14
30
|
<%= link_to_remote "Edit",:url => {:controller => 'easy_datas',
|
15
31
|
:action => :model_attributes_edit,
|
16
32
|
:model => @model},
|
17
|
-
:update => "
|
18
|
-
:success => "Effect.Appear('#{@model}_attributes', { duration: 0.4 })",
|
33
|
+
:update => "model_attributes",
|
34
|
+
:success => "Effect.Appear('#{@model}_attributes', { duration: 0.4 });",
|
19
35
|
:failure => "alert('Ooops! An error occurred.')"
|
20
36
|
%>
|
21
37
|
</span>
|
22
38
|
|
23
|
-
<%= link_to_function "[Close]","Effect.Fade('
|
39
|
+
<%= link_to_function "[Close]","Effect.Fade('model_attributes',{ duration : 0.3});",:class=>"close_list"%>
|
24
40
|
|
25
41
|
</div>
|
26
42
|
|
@@ -1,11 +1,14 @@
|
|
1
1
|
<% form_remote_tag :url => {:controller => 'easy_datas',:action => "custom_attributes",:model => @model},
|
2
|
-
:update => "
|
2
|
+
:update => "list_attributes" do -%>
|
3
|
+
|
3
4
|
<div id="list_attributes" class="model_attributes">
|
5
|
+
<span class="title_data_publications">Model</span>
|
6
|
+
<%= render :partial => "list_model_info", :locals => {:model_name => @model, :model=> @model_attributes, :namespaces => @namespaces}%>
|
4
7
|
<!-- Attributes -->
|
5
|
-
<span>Attributes</span>
|
8
|
+
<span class="title_data_publications">Attributes</span>
|
6
9
|
<%= render :partial => "list_properties_edit",:locals => {:attributes => @model_attributes["attributes"],:model => @model,:namespaces => @namespaces,:type => "attributes"}%>
|
7
10
|
<!--Associations-->
|
8
|
-
<span>Associations</span>
|
11
|
+
<span class="title_data_publications">Associations</span>
|
9
12
|
<%= render :partial => "list_properties_edit",:locals => {:attributes => @model_attributes["associations"],:model => @model,:namespaces => @namespaces,:type => "associations"}%>
|
10
13
|
<%= submit_tag "Send" %>
|
11
14
|
<%= link_to_function "[Close]","Effect.Fade('#{@model}_attributes',{duration: .3})",:class=>"close_list"%>
|
@@ -1,16 +1,17 @@
|
|
1
1
|
<% if @model_attributes["attributes"]%>
|
2
|
-
<
|
3
|
-
<ul>
|
2
|
+
<span class="data_info"> Attributes: </span>
|
3
|
+
<ul>
|
4
4
|
<%@model_attributes["attributes"].keys.each do |att|%>
|
5
5
|
<li><%=att%></li>
|
6
6
|
<%end%>
|
7
7
|
</ul>
|
8
8
|
<%end%>
|
9
9
|
<%if @model_attributes["associations"] %>
|
10
|
-
<
|
10
|
+
<span class="data_info"> Associations: </span>
|
11
11
|
<ul>
|
12
12
|
<%@model_attributes["associations"].keys.each do |assoc|%>
|
13
13
|
<li><%=assoc%></li>
|
14
14
|
<%end%>
|
15
15
|
</ul>
|
16
16
|
<%end%>
|
17
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%- form_remote_for :settings,:url => {:controller => "easy_datas",:action=>"custom_settings"},:update => "custom_content" do%>
|
2
|
+
|
3
|
+
<table class="settings_table">
|
4
|
+
<tr>
|
5
|
+
<th colspan=2>Proyecto</th>
|
6
|
+
</tr>
|
7
|
+
<tr>
|
8
|
+
<td><span>Project's name(?):</span></td><td><%= text_field "project","project",:value =>@settings["project"]["name"] %></td>
|
9
|
+
</tr>
|
10
|
+
<tr>
|
11
|
+
<td><span>Logo(?):</span></td><td><%= select "project","logo",@images,{:selected => @settings["project"]["logo"]||nil,:prompt => "Select logo ..."}%></td>
|
12
|
+
</tr>
|
13
|
+
<tr>
|
14
|
+
<td><span>Description(?):</span></td><td><%= text_area "project","description","cols" => 80,"rows"=>5,:value=>@settings["project"]["description"]%></td>
|
15
|
+
</tr>
|
16
|
+
<tr><th colspan="2">Access</th>
|
17
|
+
<tr>
|
18
|
+
<td><span>User:</span></td><td><%= text_field "user_admin","user",:value=>@settings["user_admin"]["user"]%></td>
|
19
|
+
</tr>
|
20
|
+
<tr>
|
21
|
+
<td><span>Password:</span></td><td><%= password_field "user_admin","pass"%></td>
|
22
|
+
</tr>
|
23
|
+
<tr>
|
24
|
+
<td><span>IP:</span></td><td><%= text_field "access","ip",:value => @settings["access"]["ip"]%></td>
|
25
|
+
</tr>
|
26
|
+
</table>
|
27
|
+
|
28
|
+
<%= submit_tag %>
|
29
|
+
|
30
|
+
<%end%>
|
@@ -1,24 +1,26 @@
|
|
1
|
-
|
2
|
-
<span><%= link_to "[Logout]", :controller => "easy_datas",:action => "logout" %></span>
|
3
|
-
<hr/>
|
1
|
+
<%= render :partial => "menu_custom"%>
|
4
2
|
<%if @models.respond_to?:each%>
|
5
|
-
|
6
|
-
|
3
|
+
<div id="custom_content" class="ed_info_content">
|
4
|
+
<div id="list_models" class="list_model_info">
|
5
|
+
<ul>
|
6
|
+
<%@models.each do |model|%>
|
7
7
|
<li class="list_model">
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
:
|
13
|
-
:success => "Effect.Appear('#{model}_attributes', { duration: 0.4 })",
|
8
|
+
<span class="model"><%= link_to_remote model,:url => {:controller => 'easy_datas',
|
9
|
+
:action => :model_attributes,
|
10
|
+
:model => model},
|
11
|
+
:update => "model_attributes",
|
12
|
+
:success => "Effect.Appear('model_attributes', { duration: 0.4 });",
|
14
13
|
:failure => "alert('Ooops! An error occurred.')"
|
15
14
|
%>
|
16
15
|
</span>
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
</li>
|
18
|
+
<%end%>
|
19
|
+
</ul>
|
20
|
+
</div>
|
21
|
+
<div id="model_attributes" class="ed_info_models" style="display:none"></div>
|
22
|
+
</div>
|
22
23
|
<%else%>
|
23
24
|
<h3> Not list model </h3>
|
24
25
|
<%end%>
|
26
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<span class="title_data_publications">Settings</span>
|
2
|
+
<table class="settings_table">
|
3
|
+
<tr>
|
4
|
+
<th>Projects Data</th>
|
5
|
+
</tr>
|
6
|
+
<tr>
|
7
|
+
<td>Project's name: <%=@settings["project"]["name"]||""%></td>
|
8
|
+
</tr>
|
9
|
+
<tr>
|
10
|
+
<td>Logo: <%=(image_tag(image_path(@settings["project"]["logo"])))unless@settings["project"]["logo"].nil?%></td>
|
11
|
+
</tr>
|
12
|
+
<tr>
|
13
|
+
<td>Description: <%=@settings["project"]["description"]%></td>
|
14
|
+
</tr>
|
15
|
+
<tr><th>Access Data<th></tr>
|
16
|
+
<tr>
|
17
|
+
<td>User: <%=@settings["user_admin"]["user"]%></td>
|
18
|
+
</tr>
|
19
|
+
<tr>
|
20
|
+
<td>Password: <%=@settings["user_admin"]["pass"]%></td>
|
21
|
+
</tr>
|
22
|
+
<tr>
|
23
|
+
<td>IP: <%=@settings["access"]["ip"]%></td>
|
24
|
+
</tr>
|
25
|
+
</table>
|
26
|
+
|
27
|
+
<%= link_to_remote "Edit Settings",:url => {:controller => "easy_datas",:action => "settings"},
|
28
|
+
:update => "custom_content",
|
29
|
+
:html => {:title => "Project Settings"}%>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,14 +1,46 @@
|
|
1
|
-
body{width:
|
2
|
-
|
1
|
+
body{width:100%;height:100%;margin:0;padding:0;font-family:helvetica;}
|
2
|
+
a{text-decoration:none}
|
3
|
+
.authenticate{background:url("images/easy_data_logo.png")no-repeat 0 0;padding-top:130px;margin:0 auto;width:400px}
|
3
4
|
.authenticate form{background:#767676;width:375px;color:white;overflow:hidden;padding: 20px 30px}
|
4
5
|
.authenticate form .lbl_auth{float:left}
|
5
6
|
.authenticate form input{float:right}
|
6
|
-
.authenticate form span{width:95%;display:block;overflow:hidden}
|
7
|
-
ul{list-style:none;width:90%;float:left;}
|
8
|
-
ul li.list_model{color:white;background:grey}
|
7
|
+
.authenticate form span{width:95%;display:block;overflow:hidden}
|
8
|
+
ul{list-style:none;width:90%;float:left;margin-top:30px;}
|
9
9
|
ul div.list_attributes{overflow:hidden;background-color:white;color:black;padding:0 5%;}
|
10
|
+
|
10
11
|
ul.attributes_info{width:100%;clear:left;padding:0}
|
11
12
|
div.attributes_info{padding: 1% 3%;overflow:hidden}
|
12
13
|
div.attributes_info div.property{border-bottom:1px black solid;padding:1em}
|
13
14
|
div.attributes_info div.property span.attribute{font-size:1.15em;font-weight:bold;}
|
14
|
-
|
15
|
+
.rdf_info{color:grey;font-size:12px}
|
16
|
+
|
17
|
+
/*EASY DATA INFO*/
|
18
|
+
.content{width:100%}
|
19
|
+
|
20
|
+
.ed_main_menu{background:url('images/main_menu.jpg') repeat-x 0 0;overflow:hidden;width:100%;margin:0 auto;display:block;}
|
21
|
+
.ed_main_menu ul{color:white !important;;margin:0px;width:100%;padding:0px 20%}
|
22
|
+
.ed_main_menu ul li{float:left;width:10%;text-align:center;padding:10px 0px;}
|
23
|
+
.ed_main_menu ul li.menu_link{width:10% !important}
|
24
|
+
.ed_main_menu ul li.menu_link a:hover{background:url("images/bg_link.jpg") no-repeat 0 0;padding:10px 0px;cursor:pointer}
|
25
|
+
.ed_main_menu ul li a{color:white}
|
26
|
+
.ed_main_menu ul li.layer_menu{font-size:14px;width:300px !important;padding:11px 0;font-weight:bold;max-height:26px}
|
27
|
+
|
28
|
+
|
29
|
+
.ed_info_content{background:url('images/shadow_menu.png') repeat-x 0 0 ;margin:0;padding:2% 20%;overflow:hidden;min-height: 100%;height: auto !important;height: 100%;margin: 0 auto -70px;}
|
30
|
+
.list_model_info{float:left;width:40%;overflow:hidden}
|
31
|
+
.list_model_info ul li{margin:0;overflow:hidden;color:blue;padding:5px 20px}
|
32
|
+
.list_model_info ul li:hover{margin:0;color:blue !important;}
|
33
|
+
.list_model_info ul li a{color:#085DAD;font-weight:bold}
|
34
|
+
.list_model_info ul li span{float:left}
|
35
|
+
.list_model_info ul li .model{width:80%;font-size:20px}
|
36
|
+
.ed_info_content .list_model_info ul li a:hover{background:url("images/bg_link.jpg") no-repeat 0 0;font-weight:bold;}
|
37
|
+
.ed_info_content .ed_info_models{float:left;width:60%;padding:4% 0;}
|
38
|
+
.ed_info_content .settings_table{text-align:left;margin-left:5%;margin-bottom:5%;i}
|
39
|
+
.ed_info_content .settings_table th{padding: 10px 0}
|
40
|
+
.title_data_publications{color:#085DAD;text-decoration:underline;}
|
41
|
+
.ed_info_content .ed_info_models .data_info{text-decoration:underline;color:#085DAD;font-size:15px;width:100%;display:block;}
|
42
|
+
/*Footer*/
|
43
|
+
|
44
|
+
.easy_data_footer,.push{height:70px;}
|
45
|
+
.easy_data_footer{background:url("images/bg_ft.png") repeat-x 0 0;width:100%;clear:both;}
|
46
|
+
.easy_data_footer a{margin-left:60%}
|
data/lib/easy_data/version.rb
CHANGED
data/lib/easy_data.rb
CHANGED
@@ -4,6 +4,7 @@ require "action_controller"
|
|
4
4
|
require "controllers/easy_datas_controller"
|
5
5
|
require "data_models/model_rdf"
|
6
6
|
require "data_models/linked_data_graph"
|
7
|
+
require "data_models/RDFa"
|
7
8
|
require "routes"
|
8
9
|
#require 'ftools'
|
9
10
|
require 'ruby-debug'
|
@@ -41,7 +42,7 @@ module EasyData
|
|
41
42
|
associations[ref.to_s] = {:privacy => 'Public',:namespace => 'not defined',:property => 'not defined'}
|
42
43
|
end
|
43
44
|
|
44
|
-
{"attributes" => attributes,"associations" => associations}
|
45
|
+
{:privacy => "Private",:namespace => "not defined",:property => "not defined","attributes" => attributes,"associations" => associations}
|
45
46
|
end
|
46
47
|
|
47
48
|
def self.get_view_path
|
data/lib/routes.rb
CHANGED
@@ -10,6 +10,7 @@ module EasyDataRouting
|
|
10
10
|
ed_views.connect 'easy_datas/authenticate_user', :action => "authenticate_user"
|
11
11
|
|
12
12
|
ed_views.connect 's/data_publications', :action => 'info_easy_data'
|
13
|
+
ed_views.connect 'easy_datas/info_easy_data', :action => 'info_easy_data'
|
13
14
|
ed_views.connect 'easy_datas/linked_data', :action => 'linked_data'
|
14
15
|
ed_views.connect 'easy_datas/access_to_data', :action => 'access_to_data'
|
15
16
|
ed_views.connect 'easy_datas/faq', :action => 'faq'
|
@@ -35,6 +36,9 @@ module EasyDataRouting
|
|
35
36
|
ed_actions.connect 'easy_datas/load_properties/:block/:attribute', :action => 'load_properties'
|
36
37
|
ed_actions.connect 'easy_datas/login', :action => 'login'
|
37
38
|
ed_actions.connect 'easy_datas/custom_attributes/:model', :action => 'custom_attributes'
|
39
|
+
ed_actions.connect 'easy_datas/settings', :action => 'settings'
|
40
|
+
ed_actions.connect 'easy_datas/custom_settings', :action => 'custom_settings'
|
41
|
+
ed_actions.connect 'easy_datas/view_settings', :action => 'view_settings'
|
38
42
|
end
|
39
43
|
|
40
44
|
#Ajax routes:
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- jnillo
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-08-25 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- bin/linked_data
|
68
68
|
- easy_data.gemspec
|
69
69
|
- lib/controllers/easy_datas_controller.rb
|
70
|
+
- lib/data_models/RDFa.rb
|
70
71
|
- lib/data_models/data_models.rb
|
71
72
|
- lib/data_models/linked_data_graph.rb
|
72
73
|
- lib/data_models/model_rdf.rb
|
@@ -89,18 +90,21 @@ files:
|
|
89
90
|
- lib/data_models/namespaces/wot.rb
|
90
91
|
- lib/data_models/namespaces/xhtml.rb
|
91
92
|
- lib/data_models/namespaces/xsd.rb
|
92
|
-
- lib/data_models/parser_rdf.rb
|
93
93
|
- lib/easy_data.rb
|
94
94
|
- lib/easy_data/tasks.rb
|
95
95
|
- lib/easy_data/templates/easy_datas/_data_publications.html.erb
|
96
|
+
- lib/easy_data/templates/easy_datas/_footer.html.erb
|
96
97
|
- lib/easy_data/templates/easy_datas/_linked_data_model.html.erb
|
97
98
|
- lib/easy_data/templates/easy_datas/_linked_datas.html.erb
|
99
|
+
- lib/easy_data/templates/easy_datas/_list_model_info.html.erb
|
98
100
|
- lib/easy_data/templates/easy_datas/_list_properties.html.erb
|
99
101
|
- lib/easy_data/templates/easy_datas/_list_properties_edit.html.erb
|
100
102
|
- lib/easy_data/templates/easy_datas/_menu.html.erb
|
103
|
+
- lib/easy_data/templates/easy_datas/_menu_custom.html.erb
|
101
104
|
- lib/easy_data/templates/easy_datas/_model_attributes.html.erb
|
102
105
|
- lib/easy_data/templates/easy_datas/_model_attributes_edit.html.erb
|
103
106
|
- lib/easy_data/templates/easy_datas/_model_attributes_info.html.erb
|
107
|
+
- lib/easy_data/templates/easy_datas/_settings.html.erb
|
104
108
|
- lib/easy_data/templates/easy_datas/authenticate_user.html.erb
|
105
109
|
- lib/easy_data/templates/easy_datas/custom_rdf.html.erb
|
106
110
|
- lib/easy_data/templates/easy_datas/info_easy_data.html.erb
|
@@ -108,15 +112,20 @@ files:
|
|
108
112
|
- lib/easy_data/templates/easy_datas/show.xml.builder
|
109
113
|
- lib/easy_data/templates/easy_datas/show_all.html.erb
|
110
114
|
- lib/easy_data/templates/easy_datas/show_all.xml.builder
|
115
|
+
- lib/easy_data/templates/easy_datas/view_settings.html.erb
|
116
|
+
- lib/easy_data/templates/images/bg_ft.png
|
117
|
+
- lib/easy_data/templates/images/bg_link.jpg
|
111
118
|
- lib/easy_data/templates/images/easy_data_logo.png
|
119
|
+
- lib/easy_data/templates/images/logo_ft.png
|
120
|
+
- lib/easy_data/templates/images/main_menu.jpg
|
121
|
+
- lib/easy_data/templates/images/rdf_icon.jpeg
|
122
|
+
- lib/easy_data/templates/images/shadow_menu.png
|
112
123
|
- lib/easy_data/templates/layouts/easy_data_layout.html.erb
|
113
124
|
- lib/easy_data/templates/rdf/request.xml.builder
|
114
125
|
- lib/easy_data/templates/rdf/show.builder
|
115
|
-
- lib/easy_data/templates/stylesheets/.easy_data_style.css.swp
|
116
126
|
- lib/easy_data/templates/stylesheets/easy_data_style.css
|
117
127
|
- lib/easy_data/version.rb
|
118
128
|
- lib/routes.rb
|
119
|
-
- lib/tasks/.rakes.rb.swp
|
120
129
|
- lib/tasks/testing_installation.rb
|
121
130
|
has_rdoc: true
|
122
131
|
homepage: http://rubygems.org/gem/easy_data
|
@@ -1,22 +0,0 @@
|
|
1
|
-
class ParserRdf
|
2
|
-
|
3
|
-
def to_rdf(model)
|
4
|
-
rdf_info = ModelRdf.new
|
5
|
-
|
6
|
-
model_rdf = {}
|
7
|
-
|
8
|
-
rdf_info.get_attributes_model(model).each do |att|
|
9
|
-
model_rdf << parser_attribute(att)
|
10
|
-
end
|
11
|
-
|
12
|
-
model_rdf
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def parser_attribute(att,info_rdf)
|
20
|
-
{info_rdf => att}
|
21
|
-
end
|
22
|
-
end
|
Binary file
|
data/lib/tasks/.rakes.rb.swp
DELETED
Binary file
|