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.



206
207
208
209
210
211
212
213
# File 'lib/datacite/mapping/related_identifier.rb', line 206

def initialize(relation_type:, value:, identifier_type:, related_metadata_scheme: nil, scheme_uri: nil, scheme_type: nil)
  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:



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

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.



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

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:



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

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

#resource_type_generalResourceTypeGeneral

Returns the general resource type.

Returns:



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

typesafe_enum_node :resource_type_general, '@resourceTypeGeneral', class: ResourceTypeGeneral, default_value: nil

#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.



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

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.



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

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

#valueString

Returns the identifier value. Cannot be nil.

Returns:

  • (String)

    the identifier value. Cannot be nil.



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

text_node :value, 'text()'