Class: Datacite::Mapping::RelatedIdentifier

Inherits:
Object
  • Object
show all
Includes:
XML::Mapping
Defined in:
lib/datacite/mapping/related_identifier.rb

Overview

Globally unique identifier of a related resource.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(relation_type:, value:, identifier_type:, related_metadata_scheme: nil, scheme_uri: nil, scheme_type: nil) ⇒ RelatedIdentifier

Parameters:

  • relation_type (RelationType)

    the relationship of the Datacite::Mapping::Resource to the related resource. Cannot be nil.

  • value (String)

    the identifier value. Cannot be nil.

  • identifier_type (RelatedIdentifierType)

    the type of the related identifier. Cannot be nil.

  • related_metadata_scheme (String, nil) (defaults to: nil)

    the name of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.

  • scheme_uri (URI, nil) (defaults to: nil)

    the URI of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.

  • scheme_type (String, nil) (defaults to: nil)

    the type of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.



176
177
178
179
180
181
182
183
# File 'lib/datacite/mapping/related_identifier.rb', line 176

def initialize(relation_type:, value:, identifier_type:, related_metadata_scheme: nil, scheme_uri: nil, scheme_type: nil) # rubocop:disable Metrics/ParameterLists
  self.relation_type = relation_type
  self.value = value
  self.identifier_type = identifier_type
  self. = 
  self.scheme_uri = scheme_uri
  self.scheme_type = scheme_type
end

Instance Attribute Details

#identifier_typeRelatedIdentifierType

Returns the type of the related identifier. Cannot be nil.

Returns:



212
# File 'lib/datacite/mapping/related_identifier.rb', line 212

typesafe_enum_node :identifier_type, '@relatedIdentifierType', class: RelatedIdentifierType

Returns the name of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.

Returns:

  • (String, nil)

    the name of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.



216
# File 'lib/datacite/mapping/related_identifier.rb', line 216

text_node :related_metadata_scheme, '@relatedMetadataScheme', default_value: nil

#relation_typeRelationType

Returns the relationship of the Datacite::Mapping::Resource to the related resource. Cannot be nil.

Returns:



204
# File 'lib/datacite/mapping/related_identifier.rb', line 204

typesafe_enum_node :relation_type, '@relationType', class: RelationType

#scheme_typeString?

Returns the type of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.

Returns:

  • (String, nil)

    the type of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.



224
# File 'lib/datacite/mapping/related_identifier.rb', line 224

text_node :scheme_type, '@schemeType', default_value: nil

#scheme_uriURI?

Returns the URI of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.

Returns:

  • (URI, nil)

    the URI of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.



220
# File 'lib/datacite/mapping/related_identifier.rb', line 220

uri_node :scheme_uri, '@schemeURI', default_value: nil

#valueString

Returns the identifier value. Cannot be nil.

Returns:

  • (String)

    the identifier value. Cannot be nil.



208
# File 'lib/datacite/mapping/related_identifier.rb', line 208

text_node :value, 'text()'