NAME
RDFStore::NodeFactory - An RDF node factory implementation
SYNOPSIS
use RDFStore::NodeFactory;
my $factory = new RDFStore::NodeFactory();
my $statement = $factory->createStatement(
$factory->createResource("http://pen.com"),
$factory->createResource("http://purl.org/schema/1.0#author"),
$factory->createLiteral("Peter Pan")
);
my $reified_statement = $factory->createReifiedStatement(
$factory->createResource("http://pen.com"),
$factory->createResource("http://purl.org/schema/1.0#author"),
$factory->createLiteral("Lady Oscar")
);
DESCRIPTION
An RDFStore::NodeFactory implementation using RDFStore::RDFNode, RDFStore::Resource and RDFStore::Literal
METHODS
- new
-
This is a class method, the constructor for RDFStore::NodeFactory.
- createResource( LOCALNAME_NAMESPACE [, LOCALNAME ] )
-
Create a new RDFStore::Resource. If the method is called with a single perl scalar as parameter a new RDF Resource is created with the string passed as indentifier (LOCALNAME); a fully qualified RDF resource can be constructed by invoching the constructor with two paramter s where the former is the NAMESPACE and the latter is the LOCALNAME. By RDF definition we assume that LOCALNAME can not be undefined. If LOCALNAME is a perl reference the new Resource is flagged as anonymous-resource or bNode.
bNodes can also be created using the createbNode or createAnonymousResource methods below
- createAnonymousResource( LOCALNAME_NAMESPACE [, LOCALNAME ] )
-
Create a new anonymous RDFStore::Resource like in the createResource method above but the method is setting the RDFStore::Resource(3) internal bNode flag.
- createbNode( LOCALNAME_NAMESPACE [, LOCALNAME ] )
-
Create a new anonymous RDFStore::Resource like in the createResource method above but the method is setting the RDFStore::Resource(3) internal bNode flag.
- createLiteral( LITERAL )
-
Create a new RDFStore::Literal. The only parameter passed is either a plain perl scalar (LITERAL) - see RDFStore::Literal(3)
- createStatement( SUBJECT, PREDICATE, OBJECT )
-
Create a new RDFStore::Statement. SUBJECT and PREDICATE must be two RDFStore::Resource while OBJECT is RDFStore::RDFNode
- createUniqueResource
-
Creates a new RDFStore::Resource with a unique ID using a random seed.
- createOrdinal( INTEGER )
-
Creates a new RDFStore::Resource ordinal property (rdf:li, rdf:_N). The only parameter INTEGER is the scalar number to set the property to.
ABOUT RDF
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)
SEE ALSO
RDFStore::RDFNode(3) RDFStore::Resource(3) RDFStore::Literal(3) RDFStore(3)
AUTHOR
Alberto Reggiori <areggiori@webweaving.org>
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 294:
You forgot a '=back' before '=head1'