NAME

ODO::Statement - Encapsulation of an RDF triple for graphs

SYNOPSIS

 use ODO::Node;
 use ODO::Statement;

 my $s = ODO::Node::Resource->new('urn:lsid:testuri.org:ns:object:');
 my $p = ODO::Node::Resource->new('http://testuri.org/predicate');
 my $o = ODO::Node::Literal->new('literal');

 my $statement_1 = ODO::Statement->new($s, $p, $o);

 # or

 my $statement_2 = ODO::Statement->new(s=> $s, p=> $p, o=> $o);

 # and then..

 if($statement_1->equals($statement_2)) {
        print "\$statement_1 == \$statement_2\n";
 }      
 else {
        print "The statements are not equal\n";
 }

DESCRIPTION

A simple container that encapsulates a single RDF statement. This object also provides tests for equality.

METHODS

new( s=> $subject, p=> $predicate, o=> $object)
new( $s, $p, $o )

Creates a new ODO::Statement object with the specified subject ($s), predicate ($p), object ($o) The subject, predicate, object must be any combination of ODO::Node::Resource, ODO::Node::Literal, ODO::Node::Variable, ODO::Node::Blank (more generically, anything that conforms to ODO::Node).

s( [ $subject ] )

Get or set the subject of this statement.

p( [ $predicate ] )

Get or set the predicate of this statement.

o( [ $object ] )

Get or set the object of this statement

equal( $statement )

Determines whether or not the statement is the same as the statement passed as the parameter.

strict_equal( $statement )

Tests whether or not $self and $statement are the same statement, ODO::Node nodes _MUST_ match in this method.

hash( )

Generates a hash signature of this statement for comparison purposes internally and wherever the application developer feels appropriate.

NAME

ODO::Statement::Virtual - Encapsulation of an virtual RDF triple pattern.

SYNOPSIS use ODO::Node; use ODO::Statement::Virtual;

 my $s = ODO::Node::Resource->new('urn:lsid:testuri.org:ns:object:');
 my $p = ODO::Node::Resource->new('http://testuri.org/predicate');
 my $o = ODO::Node::Literal->new('literal');

 my $virtual_1 = ODO::Statement::Virtual->new($s, $p, $o);

 my $virtual_2 = ODO::Statement::Virtual->new(s=> $s, p=> $p, o=> $o);

 if($statement_1->equals($statement_2)) {
        print "\$statement_1 == \$statement_2\n";
 }
 else {
        print "The statements are not equal\n";
 }

DESCRIPTION

These objects are used in the presences of a reasoner to create statements that have been inferred in order to differentiate them from statements that are actually 'in' the graph.

SEE ALSO

ODO::Node, ODO::Graph, ODO::Query::Simple, ODO::Statement::Group

COPYRIGHT

Copyright (c) 2004-2006 IBM Corporation.

All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html