rb_cObject
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.
$Id$
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.
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 )
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
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 all nodes from the statement.
static VALUE rleaf_redleaf_statement_clear( VALUE self )
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 )
Returns true if the receiver is equal to other_statement.
static VALUE rleaf_redleaf_statement_eql_p( VALUE self, VALUE other )
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 API) Serialize the object to a String.
static VALUE rleaf_redleaf_statement_marshal_dump( VALUE self )
(Marshal API) Deserialize the object state in data back into the receiver.
static VALUE rleaf_redleaf_statement_marshal_load( VALUE self, VALUE data )
Return the object (node) of the statement.
static VALUE rleaf_redleaf_statement_object( VALUE self )
Set the object (node) of the statement.
static VALUE rleaf_redleaf_statement_object_eq( VALUE self, VALUE new_object )
Return the predicate (node) of the statement.
static VALUE rleaf_redleaf_statement_predicate( VALUE self )
Set the predicate (node) of the statement.
static VALUE rleaf_redleaf_statement_predicate_eq( VALUE self, VALUE new_predicate )
Return the subject (node) of the statement.
static VALUE rleaf_redleaf_statement_subject( VALUE self )
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.