Redleaf::GraphQueryResult

A result from a SPARQL query that returns a graph.

Subversion Id

 $Id$

Authors

Copyright © 2008-2009, Michael Granger All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Constants

SVNRev

SVN Revision

SVNId

SVN Id

Public Instance Methods

each( ) click to toggle source

Iterate over the result’s graph, yielding a Redleaf::Statement to the block for each resulting statement.

    # File lib/redleaf/queryresult/graph.rb, line 37
37:     def each( &block ) # :yields: statement
38:         return self.graph.each( &block )
39:     end
graph → graph click to toggle source

Return the Redleaf::Graph formed by taking each query solution in the solution sequence, substituting for the variables in the graph template, and combining the triples into a single RDF graph by set union.

static VALUE
rleaf_redleaf_graphqueryresult_graph( VALUE self ) 
length → fixnum click to toggle source

Return the number of statements in the result graph.

static VALUE
rleaf_redleaf_graphqueryresult_length( VALUE self ) 
to_json() click to toggle source

Overloaded, as the JSON spec only has special formats for the binding and boolean results types. This returns the result graph serialized as JSON instead.

    # File lib/redleaf/queryresult/graph.rb, line 44
44:     def to_json
45:         return self.graph.to_json
46:     end
to_xml() click to toggle source

Overloaded to return the result’s graph as RDF/XML.

    # File lib/redleaf/queryresult/graph.rb, line 50
50:     def to_xml
51:         return self.graph.to_rdfxml_abbrev
52:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.