Class: Qa::LinkedData::Mapper::ContextMapperService
- Inherits:
-
Object
- Object
- Qa::LinkedData::Mapper::ContextMapperService
- Defined in:
- app/services/qa/linked_data/mapper/context_mapper_service.rb
Class Method Summary collapse
-
.map_context(graph:, context_map:, subject_uri:) ⇒ <Hash<Symbol><Array<Object>>] mapped context values and information with hash of map key = array of object values for predicates identified in predicate_map.
Extract predicates specified in the predicate_map from the graph and return as a value map for a single subject URI.
Class Method Details
.map_context(graph:, context_map:, subject_uri:) ⇒ <Hash<Symbol><Array<Object>>] mapped context values and information with hash of map key = array of object values for predicates identified in predicate_map.
Extract predicates specified in the predicate_map from the graph and return as a value map for a single subject URI.
21 22 23 24 25 26 27 28 29 |
# File 'app/services/qa/linked_data/mapper/context_mapper_service.rb', line 21 def map_context(graph:, context_map:, subject_uri:) context = [] context_map.properties.each do |property_map| populated_property_map = populate_property_map(context_map, property_map, graph, subject_uri) next if populated_property_map.blank? context << populated_property_map end context end |