Class: LinkedResearchMetadata::Transformer::Base

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

Overview

Base transformer

Direct Known Subclasses

Dataset, Organisation, Person, Project

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Base

Returns a new instance of Base.

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.

  • :granularity (Fixnum)

    Expand associated resource URIs with varying amounts of metadata.



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/linked_research_metadata/transformer/base.rb', line 15

def initialize(config)
  @config = config
  @config[:granularity] = 0 if !@config[:granularity]
  raise 'Minting URI missing' if @config[:minting_uri].empty?
  @graph = RDF::Graph.new
  @identifiers = {
      dataset: Set.new,
      organisation: Set.new,
      person: Set.new,
      project: Set.new,
      publication: Set.new
  }
end

Instance Method Details

#identifiersHash{Symbol => Set<String>}

Pure UUIDs available after transformation for :dataset, :organisation, :person, :project, :publication.

Returns:

  • (Hash{Symbol => Set<String>})


33
34
35
# File 'lib/linked_research_metadata/transformer/base.rb', line 33

def identifiers
  @identifiers
end