- page_title "Dataset: #{dataset.title}" - page_description dataset.description - content_for :crumbs do %ol.breadcrumb %li= link_to_home %li= link_to 'Datasets', datasets_path %li.active Dataset - if dataset.deprecated? = render partial: 'publish_my_data/shared/deprecation_notice', locals: {resource: dataset} %article#dataset %header %h3 Dataset %h1= dataset.title %h3 URI %h2.click-to-select= dataset.uri %section.metadata .primary - if dataset.comment.present? %h3 Description %p= auto_link dataset.comment.to_s - if dataset.publisher.present? %h3 Publisher %p= resource_uri_or_label(dataset, dataset.publisher) - if dataset.license.present? %h3 Licence %p= resource_uri_or_label(dataset, dataset.license) - if dataset.contact_email.present? %h3 Contact %p= auto_link dataset.contact_email.to_s.gsub('mailto:','') - if dataset.description.present? %h3 Further Information .js-only #further-information.truncated :markdown #{dataset.description.to_s} .fade-out %p %a#read-more(href="#") Read more %noscript :markdown #{dataset.description.to_s} :css .js-only { display: none; } :javascript $("a#read-more").click(function(e) { e.preventDefault(); $("#further-information").removeClass("truncated"); $("#further-information .fade-out").hide(); $("a#read-more").closest('p').hide(); }); .secondary - if dataset.issued.present? %h3 Issued %p= formatted_date(dataset.issued.to_s) - if dataset.modified.present? %h3 Modified %p= formatted_date(dataset.modified.to_s) - if dataset.tags.try(:any?) %h3 Tags %p= dataset.tags.join(', ') %ul.tab-links - if dataset.is_cube? %li.active %a(href="#grid-view" data-toggle="tab") Grid view %li %a(href="#example-data" data-toggle="tab") Example Data - else %li.active %a(href="#example-data" data-toggle="tab") Example Data %li %a(href="#linked-data" data-toggle="tab") Linked Data & SPARQL .tab-content - if dataset.is_cube? %section#grid-view.active = render 'publish_my_data/data_cube/grid', dataset: dataset %section#example-data(class="#{ 'active' unless dataset.is_cube? }") .primary %header %h3 Example resources from this dataset #example-data-container %p = image_tag 'publish_my_data/small-spinner.gif', alt: 'busy' %em Loading… :javascript $.get('#{ publish_my_data.example_resources_path(dataset) }'); %section#vocabularies.sticky.secondary %header %h3 Supporting Data :markdown **Mouse-over the boxes below** to reveal which terms in the example are from these Ontologies and Concept Schemes. %ul - dataset.ontologies.each_with_index do |ontology, index| = content_tag(:li, id: "ontology_#{index}") do = link_to resource_path_from_uri(ontology.uri) do %span.ontology-label Ontology %span.name.hardwrap= (ontology.label || ontology.uri) - dataset.concept_schemes.each_with_index do |concept_scheme, index| = content_tag(:li, id: "concept_scheme_#{index}") do = link_to resource_path_from_uri(concept_scheme.uri) do %span.concept-scheme-label Concept Scheme %span.name.hardwrap= (concept_scheme.label || concept_scheme.uri) %aside %p %i.icon-circled-help An %em ontology is a set of %em classes and %em properties about a certain topic area. These are used for a resource's types and predicates respectively. %p %i.icon-circled-help A %em concept scheme is a collection of %em concepts about a topic. Concepts act as a list of possible values for a certain property (i.e. predicate) of a resource. :javascript $('#vocabularies ul li').mouseover(function(el) { var ontology_id = el.currentTarget.id; $('.'+ontology_id).addClass('highlight'); $('#example-data table').addClass('lowlight'); }).mouseout(function(el) { var ontology_id = el.currentTarget.id; $('.'+ontology_id).removeClass('highlight'); $('#example-data table').removeClass('lowlight'); }); - #TODO: partialize the sparql section up a bit? (it's also used by ConceptSchemes and Ontols) - resource_class_name = "dataset" - resource = dataset %section#linked-data .primary %h3 SPARQL :markdown The data contained in this #{resource_class_name} is stored in a named graph, which can be used in SPARQL queries to restrict results to this #{resource_class_name}. = content_tag :code, resource.data_graph_uri, class: 'namedgraph click-to-select' - if resource.data_dump.present? %h3 Download %p = link_to resource.data_dump.to_s do %i.icon-download Complete dump of all triples in this #{resource_class_name}. (zipped n-triples file) %h3 Linked Data Resources %p Browse the resources in this dataset by type: %table.resources-summary %thead %tr %th= pluralize dataset.types.length, 'type' %tbody - dataset.types.each do |type| %tr %td %h3= resource_uri_or_label(type, type.uri) %h4.click-to-select= type.uri %section= type.comment %section = link_to "View all #{pluralize(dataset.type_count(type.uri), 'resource')} of this type", list_resources_path(dataset: dataset.slug, type_uri: type.uri) .secondary %a.button(href="/sparql") Run a SPARQL Query %h3 API Docs %p Full details of how to programatically access the data in this site can be found in the #{ link_to 'Developer Documentation', publish_my_data.developer_docs_path }. %footer.alternative-formats :markdown This **dataset** is available as: %ul %li HTML %li= link_to("JSON", show_resource_path(:uri => dataset.uri, format: 'json')) %li= link_to("RDF/XML", show_resource_path(:uri => dataset.uri, format: 'rdf')) %li= link_to("Turtle", show_resource_path(:uri => dataset.uri, format: 'ttl')) %li= link_to("N-triples", show_resource_path(:uri => dataset.uri, format: 'nt'))