Go to Redland Home - Language Bindings Home - Ruby API Home
Class Redland::ContextParser
In: rdf/redland/parser.rb
Parent: Object

Class for parsing a file

Methods

Public Class methods

Create a new ContextParser for a file

[Source]

# 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 a file into a model (?? confirm - why doesn‘t it use most of it‘s args)

[Source]

# 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-2011 Dave Beckett, (C) Copyright 2004-2005 University of Bristol