|
RDFStore::Resource - An RDF Resource Node implementation |
RDFStore::Resource - An RDF Resource Node implementation
use RDFStore::Resource;
my $resource = new RDFStore::Resource("http://pen.jrc.it/index.html");
my $resource1 = new RDFStore::Resource("http://pen.jrc.it/","index.html");
print $resource->toString." is ";
print "not"
unless $resource->equals($resource1);
print " equal to ".$resource1->toString."\n";
# or from URI object
use URI;
$resource = new RDFStore::Resource("http://www.w3.org/1999/02/22-rdf-syntax-ns#","Description");
$resource1 = new RDFStore::Resource( new URI("http://www.w3.org/1999/02/22-rdf-syntax-ns#Description") );
print $resource->toString." is ";
print "not"
unless $resource->equals($resource1);
print " equal to ".$resource1->toString."\n";
my $resource = new RDFStore::Resource([ a,{ d => 'value'}, [ 1,2,3] ]);
print $resource->toString." is ";
print "not"
unless($resource->isbNode);
print " anonymous\n";
An RDF Resource Node implementation which support the so called anonymous-resources or bNodes (blankNodes)
bNodes can be created either passing a perl reference to the constructor or by using the RDFStore::NodeFactory(3) createbNode() or createAnonymousResource() methods; the latter is actually setting the RDFStore::Resource internal bNode flag.
Storable(3) representation of the label is returned instead. This will allow to distinguish bNodes between normal resources and give them a kind of unique identity. NOTE See RDFStore::Model(3) to see how actually bNodes are being stored and retrieved in RDFStore(3).
RDFStore::RDFNode(3)
http://www.w3.org/TR/rdf-primer/
http://www.w3.org/TR/rdf-mt
http://www.w3.org/TR/rdf-syntax-grammar/
http://www.w3.org/TR/rdf-schema/
http://www.w3.org/TR/1999/REC-rdf-syntax-19990222 (obsolete)
Alberto Reggiori <areggiori@webweaving.org>
|
RDFStore::Resource - An RDF Resource Node implementation |