RDF::Sesame::Repository

RDF::Sesame::Repository is a repository on a Sesame server.
Download

RDF::Sesame::Repository Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Michael Hendricks
  • Publisher web site:
  • http://search.cpan.org/~mndrix/Object-eBay-0.0.3/lib/Object/eBay/Boolean.pm

RDF::Sesame::Repository Tags


RDF::Sesame::Repository Description

RDF::Sesame::Repository is a repository on a Sesame server. RDF::Sesame::Repository is a repository on a Sesame server.This class is the workhorse of RDF::Sesame. Adding triples, removing triples and querying the repository are all done through instances of this class. Only SELECT queries are supported at this point, but it should be fairly straightforward to add CONSTRUCT functionality. If you do it, send me a patch.METHODSconstruct ( %opts )Evaluates a construct query and returns the RDF serialization of the resulting RDF graph. A minimal invocation looks something like: my $q = qq( CONSTRUCT {Parent} ex:hasChild {Child} FROM {Child} ex:hasParent {Parent} USING NAMESPACE ex = ); my $rdf = $repo->construct( query => $q, format => 'turtle', );If an error occurs during the construction, an exception is thrown. This is different from some RDF::Sesame methods which return undef.format Required: YesIndicates the RDF serialization format that the Sesame server should return. Acceptable values are 'rdfxml', 'turtle' and 'ntriples'.language Default: SeRQLSpecifies the language in which the construct query is written. This is only included for forwards-compatibility since the only query language supported by Sesame is SeRQL.output Default: undefIndicates where the RDF serialization should be placed. The default value of undef means that the serialization should simply be returned as the value of the construct method.If the value is a filehandle, the serialization is written to that filehandle. The filehandle must already be open for writing. Otherwise, the value is taken to be a filename which is opened for writing (clobbering existing contents) and the serialization is written to the file.query Required : YesThe text of the construct query.extract ( %opts )Extract an RDF representation of all the triples in the repository. The only required option is "format" which specifies the serialization format of the resulting RDF. The minimal method invocation looks like my $rdf = $repo->extract( format => 'turtle' )where $rdf is a reference to a scalar containing the serialization of all the triples in the repository. The streaming results returned by Sesame are handled appropriately so that memory usage in minimized. If the output is sent to a file (see "output"), only one "chunk" is held in memory at a time (subject to caching by your OS). The serialization may also be compressed (or otherwise processed) as it's being streamed from the server (see "compress").Error handling is done differently in this method than in other methods in RDF::Sesame. Namely, if an error occurs, an exception is thrown (rather than returning undef and setting errstr(). Eventually, I'd like all methods to behave this way. Requirements: · Perl


RDF::Sesame::Repository Related Software