Class: RoadForest::MediaType::Handlers::RDFPost

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

Overview

application/x-www-form-urlencoded

Defined Under Namespace

Classes: Reader

Constant Summary

Constants included from RDF::Normalization

RDF::Normalization::Vocabs

Instance Method Summary collapse

Methods inherited from RDFHandler

#child_for_model, #get_output

Methods included from RDF::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_model, #get_output, #parse_for, #render_for, #update_model

Instance Method Details

#local_to_network(base_uri, graph) ⇒ Object



282
283
# File 'lib/roadforest/content-handling/type-handlers/rdfpost.rb', line 282

def local_to_network(base_uri, graph)
end

#network_to_local(base_uri, list) ⇒ Object



285
286
287
288
289
290
291
292
293
# File 'lib/roadforest/content-handling/type-handlers/rdfpost.rb', line 285

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