Redland - RDF Application Framework - Perl Interface

Installing the Redland Perl interface

This is not automatically built or installed at present since this interface may not be required. You can easily build it by hand as follows

  cd perl
  make build-perl
  make test-perl   # optional

To install it system wide (this is optional) do this as root:

  root# make install-perl

The Redland interface has been tested with Perl 5.005, 5.6.0 and 5.6.1.

Testing the Redland Perl interface

If you did the optional install above, run the perl example program with:

  perl ./example.pl  # ./example.pl might work if your perl is in /usr/bin/perl

Otherwise, to run in the source tree do:

  perl -Iblib/arch -Iblib/lib ./example.pl

and the result should be:

  Creating storage

  Creating model

  Creating statement

  Adding statement to model

  Parsing URI (file) dc.rdf
  Parsing added 3 statements

  Printing all statements
  Statement: {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/title], "Dave Beckett's Home Page"}
  Statement: {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/creator], "Dave Beckett"}
  Statement: {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/creator], "Dave Beckett"}
  Statement: {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/description], "The generic home page of Dave Beckett."}

  Searching model for statements matching predicate http://purl.org/dc/elements/1.1/creator
  Matching Statement: {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/creator], "Dave Beckett"}
    Subject: [http://purl.org/net/dajobe/]
    Predicate: [http://purl.org/dc/elements/1.1/creator]
    Object: Dave Beckett
  Matching Statement: {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/creator], "Dave Beckett"}
    Subject: [http://purl.org/net/dajobe/]
    Predicate: [http://purl.org/dc/elements/1.1/creator]
    Object: Dave Beckett

  Writing model to test-out.rdf as rdf/xml

Done

Redland Perl API Introduction

The Perl API is an object-based API reflecting the same structure of the Redland objects with simple mappings between them:

ConceptRedland ClassPerl ClassPurpose
Resource / Literallibrdf_nodeRDF::Redland::Node RDF Model & Syntax nodes
Statement / Triplelibrdf_statementRDF::Redland::Statement RDF Model & Syntax arcs (statements, triples) [isa Resource]
Modellibrdf_modelRDF::Redland::Model Set of Statements usually held in one Storage.
Storagelibrdf_storageRDF::Redland::Storage Storage for Models either persistant or in-memory.
Streamlibrdf_streamRDF::Redland::Stream Providing sequences of Statements from Parsers, queries.
Parserlibrdf_parserRDF::Redland::Parser Syntaxes parsers delivering Stream of Statements or writing to a Model
Serializerlibrdf_serializerRDF::Redland::Serializer Serializes a Model into a syntax such as RDF/XML
Iteratorlibrdf_iteratorRDF::Redland::Iterator Enumerating lists (of Node) from queries.
URIlibrdf_uriRDF::Redland::URI Provides URIs for Resources, Parsers, ...
World RDF::Redland RDF wrapper class handling Redland startup/shutdown
Digestlibrdf_digest  Internal content digest class
Hashlibrdf_hash  Internal key:value maps class
Listlibrdf_list  Internal list class
  RDF::Redland::RSS Perl Module providing RSS 1.0 support.

Perl API Reference Documentation

Either use any of the RDF::Redland:: module links above or start at the main RDF::Redland module and follow the references from there.

Other RDF Perl APIs and applications


Copyright 2000-2002 Dave Beckett, Institute for Learning and Research Technology, University of Bristol