Class: Valkyrie::Persistence::Fedora::Persister::ModelConverter::NestedInternalValkyrieID
- Inherits:
-
MappedFedoraValue
- Object
- ValueMapper
- MappedFedoraValue
- Valkyrie::Persistence::Fedora::Persister::ModelConverter::NestedInternalValkyrieID
- Defined in:
- lib/valkyrie/persistence/fedora/persister/model_converter.rb
Overview
Class mapping Property objects for Valkyrie IDs using typed RDF literals This generates a custom datatype URI for Valkyrie IDs
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
-
.handles?(value) ⇒ Boolean
Determines whether or not the value is a Property for Valkyrie ID with a hash URI for the RDF graph.
Instance Method Summary collapse
-
#result ⇒ Valkyrie::Persistence::Fedora::Persister::ModelConverter::Property
Converts the RDF literal into the Property For example, a Valkyrie::ID with the value “db67d786-d187-46b8-a44f-a494f0c65ec2” will first be mapped to RDF::Literal “db67d786-d187-46b8-a44f-a494f0c65ec2”^^<example.com/predicate/valkyrie_id>.
Methods inherited from ValueMapper
Constructor Details
This class inherits a constructor from Valkyrie::ValueMapper
Class Method Details
.handles?(value) ⇒ Boolean
Determines whether or not the value is a Property for Valkyrie ID with a hash URI for the RDF graph
354 355 356 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 354 def self.handles?(value) value.is_a?(Property) && value.value.is_a?(Valkyrie::ID) && value.subject.to_s.include?("#") end |
Instance Method Details
#result ⇒ Valkyrie::Persistence::Fedora::Persister::ModelConverter::Property
Converts the RDF literal into the Property For example, a Valkyrie::ID with the value “db67d786-d187-46b8-a44f-a494f0c65ec2”
will first be mapped to RDF::Literal "db67d786-d187-46b8-a44f-a494f0c65ec2"^^<http://example.com/predicate/valkyrie_id>
362 363 364 365 366 367 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 362 def result map_value(converted_value: RDF::Literal.new( value.value, datatype: PermissiveSchema.valkyrie_id )) end |