GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  RDF::CORE::SERIALIZER (3)

.ds Aq ’

NAME

RDF::Core::Serializer - produce XML code for RDF model

CONTENTS

SYNOPSIS



  require RDF::Core::Serializer;

  my %options = (getSubjects => \&getSubjectsHandler,
                 getNamespaces => \&getNamespacesHandler,
                 getStatements => \&getStatementsHandler,
                 countStatements => \&countStatementsHandler,
                 existsStatement => \&existsStatementHandler,
                 BaseURI => http://www.foo.com/,
                );
  my $serializer = new RDF::Core::Serializer(%options);
  $serializer->serialize;



DESCRIPTION

Serializer takes RDF data provided by handlers and generates a XML document. Besides the trivial job of generating one description for one statement the serializer attempts to group statements with common subject into one description and makes referenced descriptions nested into referencing ones. Using baseURI option helps to keep relative resources instead of making them absolute. Blank nodes are preserved where possible, though the new rdf:nodeID attribute production is not implemented yet.

    Interface

o new(%options)

Available options are:
o getSubjects

A reference to a subroutine that provides all distinct subjects in serialized model.

o getNamespaces

A reference to a subroutine that provides all predicates’ namespaces.

o getStatements($subject, $predicate, $object)

A reference to a subroutine that provides all statements conforming given mask.

o existsStatement($subject, $predicate, $object)

A reference to a subroutine that returns true if a statement exists conforming the mask.

o Output

Output can be assigned a filehandle reference (a reference to a typeglob or FileHandle object), or a reference to a scalar variable. If a filehendle is set, serializer assumes it’s open and valid, just prints there and doesn’t close it. If a variable is set, XML is appended to it. Serializer writes to STDOUT with default settings.

o BaseURI

A base URI of a document that is created. If a subject of a statement matches the URI, rdf:about attribute with relative URI is generated.

o InlinePrefix

When rdf:nodeID attribute is assigned to an anonymous resource, it’s generated as InlinePrefix concatenated with unique number. Unique is meant in the scope of the document. Default prefix is ’genid’.

o serialize

Does the job.

    Handlers

<B>getSubjectsB> should return an array of references, each reference pointing to an array of one item ($subject), where $subject is a reference to RDF::Core::Resource. (I.e. $subject = $returnValue->[$someElementOfArray]->[0])

<B>getNamespacesB> should return a hash reference where keys are namespaces and values are namespace prefixes. There must be a rdf namespace present with value ’rdf’

<B>getStatements($subject, B>$predicate<B>, B>$object<B>)B> should return all statements that match given mask. That is the statements’ subject is equal to $subject or $subject is not defined and the same for predicate and subject. Return value is a reference to RDF::Core::Enumerator object.

<B>countStatements($subject, B>$predicate<B>, B>$object<B>)B> should return number of statements that match given mask.

<B>existsStatement($subject, B>$predicate<B>, B>$object<B>)B> should return true if exists statement that matches given mask and false otherwise.

LICENSE

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

AUTHOR

Ginger Alliance, rdf@gingerall.cz

SEE ALSO



 FileHandle, RDF::Core::Model::Serializer, RDF::Core::Enumerator



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 RDF::CORE::SERIALIZER (3) 2006-07-12

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.