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

This class provides query language support for RDF models either via an adaptor class or direct by persistant storage.

Methods

Public Class methods

You shouldn’t use this. Used internally for cleanup.

[Source]

# File rdf/redland/query.rb, line 30
    def Query.create_finalizer(query)
      proc{|id| "Finalizer on #{id}"
        $log_final.info "closing query"
        Redland::librdf_free_query(query)
      }
    end

Constructor - create a new Query object query - the query string language - the name of the query language uri - the URI identifying the query language

[Source]

# File rdf/redland/query.rb, line 15
    def initialize(query,language=nil,uri=nil)
      @query = query
      @language = language
      @uri = uri
      @query = Redland.librdf_new_query($world.world,language,uri,query)
      return nil if not @query
      ObjectSpace.define_finalizer(self,Query.create_finalizer(@query))
    end

Public Instance methods

Execute a query on a model

[Source]

# File rdf/redland/query.rb, line 25
    def execute(model)
      return RDF::Redland::librdf_query_run_as_bindings(@query,model.model)
    end

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

Copyright 2004-2005 Dave Beckett, Institute for Learning and Research Technology, University of Bristol