Class: Qa::LDF::JsonMapper
- Inherits:
-
Object
- Object
- Qa::LDF::JsonMapper
- Defined in:
- lib/qa/ldf/json_mapper.rb
Overview
A customizable mapper from RDF::Graphs to JSON-like hashes for use in Questioning Authority.
@todo: Add configuration
Instance Method Summary collapse
Instance Method Details
#map_resource(uri, graph) ⇒ Hash<Symbol, String>
26 27 28 29 30 31 32 |
# File 'lib/qa/ldf/json_mapper.rb', line 26 def map_resource(uri, graph) labels = graph.query(subject: RDF::URI.intern(uri), predicate: RDF::Vocab::SKOS.prefLabel).objects { id: uri, label: labels.first.to_s } end |