Class: Valkyrie::Persistence::Fedora::Persister::OrmConverter::GraphToAttributes::LiteralValue
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Fedora::Persister::OrmConverter::GraphToAttributes::LiteralValue
- Defined in:
- lib/valkyrie/persistence/fedora/persister/orm_converter.rb
Overview
Class for mapping RDF XML literals into Valkyrie Resource attribute values
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
-
.handles?(value) ⇒ Boolean
Determines whether or not a Property statement is an RDF literal typed using XML data types.
Instance Method Summary collapse
-
#result ⇒ Applicator
Casts the value of the RDF literal into an Applicator for XML datatype values.
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 an RDF literal typed using XML data types
365 366 367 |
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 365 def self.handles?(value) value.statement.object.is_a?(RDF::Literal) && value.statement.object.language.blank? && value.statement.object.datatype == RDF::URI("http://www.w3.org/2001/XMLSchema#string") end |
Instance Method Details
#result ⇒ Applicator
Casts the value of the RDF literal into an Applicator for XML datatype values
371 372 373 374 |
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 371 def result value.statement.object = value.statement.object.to_s calling_mapper.for(Property.new(statement: value.statement, scope: value.scope, adapter: value.adapter)).result end |