Class: Valkyrie::Persistence::Fedora::Persister::OrmConverter::GraphToAttributes::InternalURI
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Fedora::Persister::OrmConverter::GraphToAttributes::InternalURI
- Defined in:
- lib/valkyrie/persistence/fedora/persister/orm_converter.rb
Overview
Casts the value of the RDF literal into an Applicator for URIs referencing Valkyrie Resources
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
-
.handles?(value) ⇒ Boolean
Determines whether or not a Property statement is URI referring internally to a Valkyrie Resource.
Instance Method Summary collapse
-
#result ⇒ Applicator
Casts the value of the URI into an Applicator for Valkyrie::Resource objects.
Methods inherited from ValueMapper
Constructor Details
This class inherits a constructor from Valkyrie::ValueMapper
Class Method Details
.handles?(value) ⇒ Boolean
Determines whether or not a Property statement is URI referring internally to a Valkyrie Resource
430 431 432 |
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 430 def self.handles?(value) value.statement.object.is_a?(RDF::URI) && value.statement.object.to_s.start_with?(value.adapter.connection_prefix) end |
Instance Method Details
#result ⇒ Applicator
Casts the value of the URI into an Applicator for Valkyrie::Resource objects
436 437 438 439 |
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 436 def result value.statement.object = value.adapter.uri_to_id(value.statement.object) calling_mapper.for(Property.new(statement: value.statement, scope: value.scope, adapter: value.adapter)).result end |