RDF::Core::NodeFactory - produces literals and resources, generates labels for anonymous resources
require RDF::Core::NodeFactory; my $factory = new RDF::Core::NodeFactory(BaseURI=>'http://www.foo.org/'); my $resource = $factory->newResource('http://www.foo.org/pages'); #get the same uri: my $absolutizedResource = $factory->newResource('/pages'); #anonymous resource my $generatedResource = $factory->newResource;
NodeFactory generates RDF graph nodes - literals and resources. The resources' URIs are expanded against base uri (BaseURI option) to their absolute forms using URI module. NodeFactory can generate unique 'anonymous' resources.
new(%options)
Available options are:
BaseURI
When NodeFactory generates a resource from relative URI, BaseURI is used to obtain absolute URI. BaseURI must be absolute. Default value is 'uri:'.
GenPrefix, GenCounter
Is used to generate bNode label (an anonymous resource). Default values are '_:a' for GenPrefix and 0 for GenCounter. Resulting label is concatenation of GenPrefix and GenCounter.
getOptions
setOptions(\%options)
newLiteral($value)
newResource($namespace, $localValue)
newResource($uri)
newResource
This package is subject to the MPL (or the GPL alternatively).
Ginger Alliance, rdf@gingerall.cz
URI, RDF::Core::Resource, RDF::Core::Literal
To install RDF::Core, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RDF::Core
CPAN shell
perl -MCPAN -e shell install RDF::Core
For more information on module installation, please visit the detailed CPAN module installation guide.