Class: LinkedResearchMetadata::Transformer::Dataset

Inherits:
Base
  • Object
show all
Defined in:
lib/linked_research_metadata/transformer/dataset.rb

Overview

Dataset transformer

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Dataset

Returns a new instance of Dataset.

Parameters:

  • config (Hash)

Options Hash (config):

  • :url (String)

    The URL of the Pure host.

  • :username (String)

    The username of the Pure host account.

  • :password (String)

    The password of the Pure host account.

  • :minting_uri (String)

    The URI at which to mint a resource.



13
14
15
# File 'lib/linked_research_metadata/transformer/dataset.rb', line 13

def initialize(config)
  super
end

Instance Method Details

#transform(uuid:) ⇒ RDF::Graph

Dataset transformation

Parameters:

  • uuid (String)

Returns:

  • (RDF::Graph)


21
22
23
24
25
26
27
28
29
# File 'lib/linked_research_metadata/transformer/dataset.rb', line 21

def transform(uuid:)
  dataset_extractor = Puree::Extractor::Dataset.new @config
  @resource = dataset_extractor.find uuid: uuid
  raise 'No metadata for ' + uuid if !@resource
  dataset_uri = mint_uri uuid, :dataset
  @resource_uri = RDF::URI.new dataset_uri
  build_graph
  @graph
end