Class: RoadForest::TypeHandlers::RDFPost

Inherits:
RDFHandler show all
Defined in:
lib/roadforest/type-handlers/rdfpost.rb

Overview

application/x-www-form-urlencoded

Defined Under Namespace

Classes: Reader

Constant Summary

Constants included from Graph::Normalization

Graph::Normalization::Vocabs

Instance Method Summary collapse

Methods inherited from RDFHandler

#child_for_interface, #get_output

Methods included from Graph::Normalization

#expand_curie, #expand_curie_pair, #interned_uri, #literal, #normalize_context, #normalize_property, #normalize_resource, #normalize_statement, #normalize_term, #normalize_tuple, #normalize_uri, #relevant_prefixes_for_graph, #root_url, #uri, #vocabularies_in_graph

Methods inherited from Handler

#add_child_to, #build_response, #child_for_interface, #get_output, #parse_for, #render_for, #update_interface

Instance Method Details

#local_to_network(base_uri, graph) ⇒ Object



287
288
# File 'lib/roadforest/type-handlers/rdfpost.rb', line 287

def local_to_network(base_uri, graph)
end

#network_to_local(base_uri, list) ⇒ Object



290
291
292
293
294
295
296
297
298
# File 'lib/roadforest/type-handlers/rdfpost.rb', line 290

def network_to_local(base_uri, list)
  raise "Invalid base uri: #{base_uri.inspect}" if base_uri.nil?
  graph = ::RDF::Graph.new
  reader = Reader.new(list, :base_uri => base_uri.to_s)
  reader.each_statement do |statement|
    graph.insert(statement)
  end
  graph
end