Parent

Redland::ContextParser

Class for parsing a file

Public Class Methods

new(file) click to toggle source

Create a new ContextParser for a file

# File rdf/redland/parser.rb, line 218
def initialize(file)
  case file
  when String
    file = file.expand_path(file)
    raise RedlandError("File doesn't exist") unless File.file?(file)
    @uri == Uri.new(file)
  when File
  end
  @parser = Redland.librdf_new_parser($world.world,name,mime_type,@uri.uri,@uri.uri)
  raise RedlandError.new("Parser construction failed") if !@parser
  ObjectSpace.define_finalizer(self,Parser.create_finalizer(@parser))
  
end

Public Instance Methods

parse_into_model(model,string,base_uri) click to toggle source

Parse a file into a model (?? confirm - why doesn't it use most of it's args)

# File rdf/redland/parser.rb, line 233
def parse_into_model(model,string,base_uri)
  super(model,@uri,nil,@uri)
end

Go to Redland Home - Language Bindings Home - Ruby API Home

(C) Copyright 2004-2013 Dave Beckett, (C) Copyright 2004-2005 University of Bristol