NAME

RDF::Core::NodeFactory - produces literals and resources, generates URI for anonymous resources

SYNOPSIS

use RDF::Core::NodeFactory;
my $factory = new RDF::Core::NodeFactory(BaseURI=>'http://www.foo.org/',
                                          GenURI=>'uri://GEN');
my $resource = $factory->newResource('http://www.foo.org/pages');

#get the same uri:
my $absolutizedResource = $factory->newResource('/pages');

#anonymous resource
my $generatedResource = $factory->newResource;

DESCRIPTION

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.

Interface

  • 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:'.

    • GenURI

      When NodeFactory generates a resource from none URI, GenURI is combined with GenPrefix and GenCounter to obtain absolute URI. GenURI must be absolute, too, default value is 'uri:' again.

    • GenPrefix, GenCounter

      Is used with GenURI to generate URI. Default values are ID for GenPrefix and 0 for GenCounter.

  • getOptions

  • setOptions(\%options)

  • newLiteral($value)

  • newResource($namespace, $localValue)

  • newResource($uri)

  • newResource

LICENSE

This package is subject to the MPL (or the GPL alternatively).

AUTHOR

Ginger Alliance, rdf@gingerall.cz

SEE ALSO

URI, RDF::Core::Resource, RDF::Core::Literal