Parent

Redleaf::Statement

An RDF statement class. A statement is a node-arc-node triple (subject —predicate—> object). The subject can be either a URI or a blank node, the predicate is always a URI, and the object can be a URI, a blank node, or a literal.

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 Class Methods

new() → statement new( subject, predicate, object ) → statement click to toggle source

Create a new Redleaf::Statement object. If the optional subject (a URI or nil), predicate (a URI), and object (a URI, nil, or any immediate Ruby object) are given, the statement will be initialized with them.

static VALUE 
rleaf_redleaf_statement_initialize( int argc, VALUE *argv, VALUE self ) 

Public Instance Methods

<=>( other ) click to toggle source

Comparable interface

    # File lib/redleaf/statement.rb, line 47
47:     def <=>( other )
48:         return 0 unless other
49:         return ( self.subject.to_s <=> other.subject.to_s ).nonzero? ||
50:                ( self.predicate.to_s <=> other.predicate.to_s ).nonzero? ||
51:                ( self.object.to_s <=> other.object.to_s )
52:     end
==(p1) click to toggle source

Alias for #eql?

statement === other_statement → true or false statement === [node, node, node] → true or false click to toggle source

Case equality: Returns true if the receiver matches other_statement (or the statement created from the Array of nodes), where some parts of the receiving statement - subject, predicate or object - can be empty (nil). Empty parts match against any value, parts with values must match exactly.

static VALUE 
rleaf_redleaf_statement_threequal_op( VALUE self, VALUE other ) 
clear → nil click to toggle source

Clear all nodes from the statement.

static VALUE 
rleaf_redleaf_statement_clear( VALUE self ) 
complete? → true or false click to toggle source

Check if statement is a complete and legal RDF triple. Checks that all subject, predicate, object fields are present and they have the allowed node types.

static VALUE 
rleaf_redleaf_statement_complete_p( VALUE self ) 
eql?( other_statement ) → true or false click to toggle source

Returns true if the receiver is equal to other_statement.

static VALUE 
rleaf_redleaf_statement_eql_p( VALUE self, VALUE other ) 
Also aliased as: ==
hash() click to toggle source

Generates a Fixnum hash value for the statement, made up of the hash of its components.

    # File lib/redleaf/statement.rb, line 41
41:     def hash
42:         return [ self.subject, self.predicate, self.object ].hash
43:     end
marshal_dump => string click to toggle source

(Marshal API) Serialize the object to a String.

static VALUE 
rleaf_redleaf_statement_marshal_dump( VALUE self ) 
marshal_load( data ) click to toggle source

(Marshal API) Deserialize the object state in data back into the receiver.

static VALUE 
rleaf_redleaf_statement_marshal_load( VALUE self, VALUE data ) 
object → object click to toggle source

Return the object (node) of the statement.

static VALUE 
rleaf_redleaf_statement_object( VALUE self ) 
object= object click to toggle source

Set the object (node) of the statement.

static VALUE 
rleaf_redleaf_statement_object_eq( VALUE self, VALUE new_object ) 
predicate → URI or nil click to toggle source

Return the predicate (node) of the statement.

static VALUE 
rleaf_redleaf_statement_predicate( VALUE self ) 
predicate= uri_or_nil click to toggle source

Set the predicate (node) of the statement.

static VALUE 
rleaf_redleaf_statement_predicate_eq( VALUE self, VALUE new_predicate ) 
subject → URI, Symbol, or nil click to toggle source

Return the subject (node) of the statement.

static VALUE 
rleaf_redleaf_statement_subject( VALUE self ) 
subject= uri_symbol_or_nil click to toggle source

Set the subject (node) of the statement.

static VALUE 
rleaf_redleaf_statement_subject_eq( VALUE self, VALUE new_subject ) 
to_s → string click to toggle source

Format the librdf_statement as a string.

static VALUE 
rleaf_redleaf_statement_to_s( VALUE self ) 

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.