publish_my_data 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. data/app/helpers/publish_my_data/application_helper.rb +2 -2
  2. data/app/helpers/publish_my_data/stripes_helper.rb +10 -22
  3. data/app/views/layouts/publish_my_data/application.html.haml +4 -4
  4. data/app/views/publish_my_data/classes/show.html.haml +1 -1
  5. data/app/views/publish_my_data/concept_schemes/show.html.haml +2 -2
  6. data/app/views/publish_my_data/concepts/show.html.haml +2 -2
  7. data/app/views/publish_my_data/datasets/index.html.haml +1 -1
  8. data/app/views/publish_my_data/datasets/show.html.haml +1 -2
  9. data/app/views/publish_my_data/docs/index.html.haml +1 -1
  10. data/app/views/publish_my_data/docs/publish_my_data.html.haml +1 -1
  11. data/app/views/publish_my_data/docs/tools.html.haml +1 -1
  12. data/app/views/publish_my_data/ontologies/show.html.haml +1 -1
  13. data/app/views/publish_my_data/properties/show.html.haml +1 -1
  14. data/app/views/publish_my_data/resources/index.html.haml +1 -1
  15. data/app/views/publish_my_data/resources/show.html.haml +1 -1
  16. data/app/views/publish_my_data/searches/index.html.haml +1 -1
  17. data/app/views/publish_my_data/stripes/_dataset_metadata.html.haml +5 -3
  18. data/app/views/publish_my_data/stripes/_linked_data.html.haml +37 -20
  19. data/app/views/publish_my_data/themes/show.html.haml +1 -1
  20. data/app/views/publish_my_data/vocabularies/index.html.haml +1 -1
  21. data/lib/publish_my_data/version.rb +1 -1
  22. metadata +3 -6
  23. data/app/views/publish_my_data/shared/_description.html.haml +0 -15
  24. data/app/views/publish_my_data/shared/_logo.html.haml +0 -1
  25. data/app/views/publish_my_data/stripes/_dataset_download.html.haml +0 -7
@@ -7,8 +7,8 @@ module PublishMyData
7
7
  render template: layout
8
8
  end
9
9
 
10
- def bodyclass(c)
11
- @bodyclass = c;
10
+ def set_pmd_page_class(c)
11
+ @pmd_page_class = c;
12
12
  end
13
13
 
14
14
  def set_page_title(title=nil)
@@ -27,7 +27,7 @@ module PublishMyData
27
27
  def badge(s)
28
28
  content_tag :div, :class => "pmd_badge badge_#{to_css_name(s)}" do
29
29
  s
30
- end
30
+ end
31
31
  end
32
32
 
33
33
  def row &block
@@ -56,7 +56,7 @@ module PublishMyData
56
56
  @highlight_in_menu = str.downcase
57
57
  end
58
58
 
59
- def title_uri(uri)
59
+ def title_uri(uri)
60
60
  html_str = label 'URI'
61
61
  html_str += content_tag :h2, :class => "code click_to_select" do
62
62
  uri.to_s
@@ -74,7 +74,7 @@ module PublishMyData
74
74
  def page_title(text)
75
75
  content_tag :h1 do
76
76
  text
77
- end
77
+ end
78
78
  end
79
79
 
80
80
  def section_title(text, show_icon = true)
@@ -87,25 +87,13 @@ module PublishMyData
87
87
  end
88
88
  str += text
89
89
  str
90
- end
90
+ end
91
91
  else
92
92
  content_tag :h2 do
93
93
  text
94
94
  end
95
-
96
- end
97
- end
98
-
99
- def logo
100
- image_tag(PublishMyData.logo_small)
101
- end
102
-
103
- def big_logo
104
- image_tag(PublishMyData.logo_large)
105
- end
106
95
 
107
- def data_tab_name
108
- "The Data"
96
+ end
109
97
  end
110
98
 
111
99
  def additional_format(format, link)
@@ -134,7 +122,7 @@ module PublishMyData
134
122
  LIMIT 20"
135
123
  q = PublishMyData::SparqlQuery.new(sparql,:interpolations=>{:graph=>graph_uri})
136
124
  querystring = CGI.escape(q.query)
137
- link_to "(Open SPARQL tool at this graph)", "#{publish_my_data.sparql_endpoint_path}?&query=#{querystring}"
125
+ link_to "open the SPARQL tool at this graph", "#{publish_my_data.sparql_endpoint_path}?&query=#{querystring}"
138
126
  end
139
127
 
140
128
  def maybe_link_to_vocabulary(dataset, obj)
@@ -146,7 +134,7 @@ module PublishMyData
146
134
  content_tag :small do
147
135
  "(Defined by ontology: #{link_to ontology.label || ontology.uri.to_s, resource_path_from_uri(ontology.uri)})".html_safe
148
136
  end
149
- end
137
+ end
150
138
  end
151
139
  end
152
140
 
@@ -157,11 +145,11 @@ module PublishMyData
157
145
  content_tag :small do
158
146
  "(In concept scheme: #{link_to concept_scheme.label || concept_scheme.uri.to_s, resource_path_from_uri(concept_scheme.uri)})".html_safe
159
147
  end
160
- end
148
+ end
161
149
  end
162
150
  end
163
151
 
164
- return
152
+ return
165
153
 
166
154
  end
167
155
 
@@ -175,4 +163,4 @@ module PublishMyData
175
163
  #end
176
164
 
177
165
  end
178
- end
166
+ end
@@ -1,12 +1,12 @@
1
1
  = inside_layout 'application' do
2
2
 
3
- %main.pmd
3
+ %main.pmd{class:@pmd_page_class}
4
4
  = render 'publish_my_data/stripes/subnav'
5
5
  = render 'publish_my_data/stripes/status'
6
-
6
+
7
7
  %article
8
8
  = yield
9
9
  = render 'publish_my_data/stripes/formats'
10
-
10
+
11
11
  = render 'publish_my_data/stripes/footer'
12
- = render 'publish_my_data/shared/google_analytics'
12
+ = render 'publish_my_data/shared/google_analytics'
@@ -3,7 +3,7 @@
3
3
  - highlight_in_menu "vocabularies"
4
4
  - set_page_title("Class: #{title}")
5
5
  - page_kind 'ontology class'
6
- - bodyclass 'ontology'
6
+ - set_pmd_page_class 'ontology'
7
7
 
8
8
  - additional_formats_for_resource(ontology_class.uri)
9
9
 
@@ -4,7 +4,7 @@
4
4
  - set_page_title "Concept scheme: #{title}"
5
5
  - highlight_in_menu "vocabularies"
6
6
  - page_kind 'concept scheme'
7
- - bodyclass 'concept_scheme'
7
+ - set_pmd_page_class 'concept_scheme'
8
8
 
9
9
  - additional_formats_for_resource(concept_scheme.uri)
10
10
 
@@ -18,4 +18,4 @@
18
18
 
19
19
  = render 'publish_my_data/stripes/vocabulary_metadata', vocabulary:concept_scheme, is_a:"concept scheme"
20
20
  = render 'publish_my_data/stripes/list_of_resources', title:"Concepts", resources:concept_scheme.concepts_sorted
21
- = render 'publish_my_data/stripes/linked_data', resource:concept_scheme, resource_class_name:"concept scheme"
21
+ = render 'publish_my_data/stripes/linked_data', resource:concept_scheme, resource_class_name:"concept scheme"
@@ -1,7 +1,7 @@
1
1
  - title = concept.label || concept.uri
2
2
  - set_page_title "Concept #{title}"
3
3
  - page_kind 'concept scheme'
4
- - bodyclass 'concept'
4
+ - set_pmd_page_class 'concept'
5
5
 
6
6
  - additional_formats_for_resource(concept.uri)
7
7
 
@@ -15,4 +15,4 @@
15
15
  =label("Concept Scheme")
16
16
  %p= link_to "#{concept.concept_scheme.label || concept.concept_scheme.uri}", resource_path_from_uri(concept.concept_scheme.uri)
17
17
 
18
- = render 'publish_my_data/stripes/resource_data', resource:concept
18
+ = render 'publish_my_data/stripes/resource_data', resource:concept
@@ -1,7 +1,7 @@
1
1
  - highlight_in_menu "catalogue"
2
2
  - set_page_title "Catalogue"
3
3
  - page_kind 'page of datasets'
4
- - bodyclass 'datasets'
4
+ - set_pmd_page_class 'datasets'
5
5
 
6
6
  - format_options = {only_path:false, page: @pagination_params.page, per_page: @pagination_params.per_page}
7
7
  - additional_format('N-triples', url_for(format_options.merge(format: 'nt')))
@@ -2,7 +2,7 @@
2
2
  - set_page_title "Dataset: #{dataset.title}"
3
3
  - page_description dataset.comment
4
4
  - page_kind 'dataset metadata'
5
- - bodyclass 'dataset'
5
+ - set_pmd_page_class 'dataset'
6
6
 
7
7
  - additional_formats_for_resource(dataset.uri)
8
8
  - format_options = {only_path:false, uri:dataset.uri}
@@ -20,4 +20,3 @@
20
20
  = render 'publish_my_data/stripes/datacube', dataset:dataset
21
21
  = render 'publish_my_data/stripes/dataset_sample_data', dataset:dataset
22
22
  = render 'publish_my_data/stripes/linked_data', resource:dataset, resource_class_name:"dataset"
23
- = render 'publish_my_data/stripes/dataset_download', dataset:dataset
@@ -1,5 +1,5 @@
1
1
  - highlight_in_menu "documentation"
2
2
  - set_page_title "Developer documentation"
3
- - bodyclass 'docs'
3
+ - set_pmd_page_class 'docs'
4
4
 
5
5
  = render 'publish_my_data/content/docs_index'
@@ -1,6 +1,6 @@
1
1
  - highlight_in_menu "about pmd"
2
2
  - set_page_title "About PublishMyData"
3
- - bodyclass 'docs'
3
+ - set_pmd_page_class 'docs'
4
4
 
5
5
  %header
6
6
  = fullwidth do
@@ -1,6 +1,6 @@
1
1
  - highlight_in_menu "tools"
2
2
  - set_page_title "Tools"
3
- - bodyclass 'tools'
3
+ - set_pmd_page_class 'tools'
4
4
 
5
5
  %header
6
6
  = fullwidth do
@@ -4,7 +4,7 @@
4
4
  - set_page_title "Ontology: #{title}"
5
5
  - highlight_in_menu "vocabularies"
6
6
  - page_kind 'ontology'
7
- - bodyclass 'ontology'
7
+ - set_pmd_page_class 'ontology'
8
8
 
9
9
  - additional_formats_for_resource(ontology.uri)
10
10
 
@@ -2,7 +2,7 @@
2
2
  - set_page_title "Property #{title}"
3
3
  - highlight_in_menu "vocabularies"
4
4
  - page_kind 'ontology property'
5
- - bodyclass 'ontology'
5
+ - set_pmd_page_class 'ontology'
6
6
 
7
7
  - additional_formats_for_resource(property.uri)
8
8
 
@@ -3,7 +3,7 @@
3
3
  - rdf_type_label = PublishMyData::RdfType.find(@type_filter).label rescue nil
4
4
  - highlight_in_menu "catalogue"
5
5
  - page_kind 'page of resources'
6
- - bodyclass ''
6
+ - set_pmd_page_class ''
7
7
 
8
8
  - format_options = {only_path:false, page: @pagination_params.page, per_page: @pagination_params.per_page}
9
9
  - additional_format('N-triples', url_for(format_options.merge(format: 'nt')))
@@ -8,7 +8,7 @@
8
8
  - highlight_in_menu "browse"
9
9
  - set_page_title("Resource: #{title}")
10
10
  - page_kind 'resource'
11
- - bodyclass 'resource'
11
+ - set_pmd_page_class 'resource'
12
12
 
13
13
  - additional_formats_for_resource(resource.uri)
14
14
 
@@ -1,7 +1,7 @@
1
1
  - highlight_in_menu "search"
2
2
  - set_page_title "Search for datasets"
3
3
  - page_kind 'list of datasets'
4
- - bodyclass 'datasets'
4
+ - set_pmd_page_class 'datasets'
5
5
 
6
6
  %section.coloured
7
7
  = fullwidth do
@@ -4,8 +4,6 @@
4
4
  - if dataset.comment.present?
5
5
  = label "Abstract"
6
6
  %p= auto_link(dataset.comment.to_s)
7
- - if dataset.description.present?
8
- = render partial: 'publish_my_data/shared/description', locals:{container:dataset}
9
7
  - if dataset.publisher.present?
10
8
  = label "Publisher"
11
9
  %p= resource_uri_or_label(dataset, dataset.publisher)
@@ -15,6 +13,10 @@
15
13
  - if dataset.contact_email.present?
16
14
  = label "Contact"
17
15
  %p= auto_link dataset.contact_email.to_s.gsub('mailto:','')
16
+ - if dataset.description.present?
17
+ =label "Description"
18
+ :markdown
19
+ #{dataset.description.to_s}
18
20
  .pmd_box_sidebar
19
21
  - if dataset.issued.present?
20
22
  =label "Issued"
@@ -27,4 +29,4 @@
27
29
  %p= link_to dataset.theme_obj.label, theme_path(dataset.theme_obj.slug)
28
30
  /
29
31
  =label "Tags"
30
- %p= dataset.tags.join(', ')
32
+ %p= dataset.tags.join(', ')
@@ -1,24 +1,41 @@
1
1
  %section
2
2
  = fullwidth do
3
- = section_title("Using this linked data")
4
- = label "What is this?"
5
- %p
6
- = raw "This is a linked data <strong><em>#{resource_class_name}</em></strong>."
7
- - if resource_class_name == "dataset"
8
- :markdown
9
- Data in this site is organised into datasets, which contain RDF triples about a particular topic. RDF triples in datasets are updated atomically, and share some metadata.
3
+ = section_title("Linked Data", true)
4
+ - case resource_class_name
5
+ - when "dataset"
6
+ %p
7
+ This is a linked data dataset containing
8
+ %strong
9
+ - if (resource.size)
10
+ = number_to_human(resource.size).downcase
11
+ RDF triples about the topic, which can be queried using our <a href="/docs#ways-to-access-data">APIs</a> or <a href="/sparql">SPARQL endpoint</a>.
12
+ %p{style:"margin-bottom:24px;"}
13
+ RDF triples in datasets are updated atomically, and share descriptive metadata.
14
+ - when "ontology"
15
+ %p
16
+ An <strong><em>ontology</em></strong> is a set of <strong><em>classes</em></strong> and <strong><em>properties</em></strong> about a certain topic area. These can be used for resources' types and properties (predicates) respectively.</p>
17
+ - when 'concept scheme'
18
+ %p
19
+ A <strong><em>concept scheme</em></strong> is a collection of <strong><em>concepts</em></strong> about a topic. A Concept scheme can act as a list of possible values for a certain property of a resource (i.e. possible objects for RDF triples).</p>
10
20
 
11
- - if resource_class_name == "ontology"
12
- :markdown
13
- An <strong><em>ontology</em></strong> is a set of <strong><em>classes</em></strong> and <strong><em>properties</em></strong> about a certain topic area. These can be used for resources' types and properties (predicates) respectively.</p>
14
-
15
- - if resource_class_name == "concept scheme"
16
- :markdown
17
- A <strong><em>concept scheme</em></strong> is a collection of <strong><em>concepts</em></strong> about a topic. A Concept scheme can act as a list of possible values for a certain property of a resource (i.e. possible objects for RDF triples).</p>
18
-
19
- -if resource.data_graph_uri
20
- = label "Named Graph"
21
- = content_tag :kbd, resource.data_graph_uri, class:'click_to_select', style:"font-size:1em; margin-bottom:12px; display:block;"
21
+ - if resource_class_name == "dataset" # TODO: downloads for ontologies
22
+ = row do
23
+ .pmd_box_half
24
+ %h4 Named Graph
25
+ - if resource.data_graph_uri
26
+ %p
27
+ Resources in this dataset are stored a named graph. This graph can be used in SPARQL queries to restrict results to this dataset."
28
+ = content_tag :kbd, resource.data_graph_uri, class:'click_to_select', style:"font-size:1em; margin-bottom:12px; display:block;"
29
+ %p
30
+ For a live example of how to use this,
31
+ = link_to_sparql_tool_with_graph(resource.data_graph_uri)
32
+ \.
33
+ - else
34
+ %p
35
+ No named graph is available.
36
+ .pmd_box_half
37
+ %h4 Download
22
38
  %p
23
- = "Resources in this #{resource_class_name} are stored a named graph. Use this in SPARQL queries to restrict results to this #{resource_class_name}."
24
- = link_to_sparql_tool_with_graph(resource.data_graph_uri)
39
+ The complete dataset is also available for download:
40
+ = link_to resource.data_dump.to_s, class:"btn icon-box-add type-a" do
41
+ <span>N-Triples<small>(#{resource.size || "all"} triples)</small></span>
@@ -1,7 +1,7 @@
1
1
  - highlight_in_menu "browse"
2
2
  - set_page_title "Theme: #{@theme.label || @theme.uri}"
3
3
  - page_kind 'themed list of datasets'
4
- - bodyclass 'theme'
4
+ - set_pmd_page_class 'theme'
5
5
 
6
6
  %header
7
7
  = fullwidth do
@@ -1,7 +1,7 @@
1
1
  - highlight_in_menu "vocabularies"
2
2
  - set_page_title "Vocabularies"
3
3
  - page_kind 'list of vocabularies'
4
- - bodyclass 'vocabualaries'
4
+ - set_pmd_page_class 'vocabualaries'
5
5
 
6
6
  %header
7
7
  = fullwidth do
@@ -1,3 +1,3 @@
1
1
  module PublishMyData
2
- VERSION = "1.3.3"
2
+ VERSION = "1.3.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: publish_my_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2014-03-05 00:00:00.000000000 Z
19
+ date: 2014-03-06 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails
@@ -429,17 +429,14 @@ files:
429
429
  - app/views/publish_my_data/searches/index.html.haml
430
430
  - app/views/publish_my_data/shared/_browser_warning.html.haml
431
431
  - app/views/publish_my_data/shared/_deprecation_notice.html.haml
432
- - app/views/publish_my_data/shared/_description.html.haml
433
432
  - app/views/publish_my_data/shared/_google_analytics.html.haml
434
433
  - app/views/publish_my_data/shared/_head.html.haml
435
- - app/views/publish_my_data/shared/_logo.html.haml
436
434
  - app/views/publish_my_data/shared/_meta_title.html.haml
437
435
  - app/views/publish_my_data/shared/_subnav_box.html.haml
438
436
  - app/views/publish_my_data/sparql/endpoint.html.haml
439
437
  - app/views/publish_my_data/stripes/_changelog.html.haml
440
438
  - app/views/publish_my_data/stripes/_datacube.html.haml
441
439
  - app/views/publish_my_data/stripes/_dataset_data_model.html.haml
442
- - app/views/publish_my_data/stripes/_dataset_download.html.haml
443
440
  - app/views/publish_my_data/stripes/_dataset_list.html.haml
444
441
  - app/views/publish_my_data/stripes/_dataset_metadata.html.haml
445
442
  - app/views/publish_my_data/stripes/_dataset_sample_data.html.haml
@@ -544,7 +541,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
544
541
  version: '0'
545
542
  segments:
546
543
  - 0
547
- hash: 189099090149331383
544
+ hash: 3112474249407785778
548
545
  required_rubygems_version: !ruby/object:Gem::Requirement
549
546
  none: false
550
547
  requirements:
@@ -1,15 +0,0 @@
1
- -# set locals:{container:} as either a dataset, concept scheme or ontology
2
-
3
- =label "Description"
4
- %a#read-more(href="#"){style:"display:none;"} [show long description]
5
- .description
6
- :markdown
7
- #{container.description.to_s}
8
- :javascript
9
- $("a#read-more").show();
10
- $(".description").hide();
11
- $("a#read-more").click(function(e) {
12
- e.preventDefault();
13
- $(".description").show();
14
- $("a#read-more").hide();
15
- });
@@ -1 +0,0 @@
1
- %h1 Your logo here.
@@ -1,7 +0,0 @@
1
- %section
2
- = fullwidth do
3
- = section_title("Download the data")
4
- %p
5
- A dump of the complete dataset is available for download as
6
- = link_to dataset.data_dump.to_s, class:"btn icon-box-add type-a" do
7
- <span>N-Triples<small>(#{dataset.size || "all"} triples)</small></span>