RedlandDave Beckett |
||||
|
|
Hosted by
Dreamhost since 2005. Redland BindingsLanguagesDemonstrationsData |
Redland librdf Language Bindings - Perl InterfaceInstalling the Redland Perl interfaceThis is built if --with-perl is given to the configure line, or --with-perl=perl5.8 to use a particular perl version/program. The standard 'make' at the top level will build it. You can also compile the perl interface by hand as follows: cd perl make # optional make check To install it system wide do this as root (or maybe via sudo make install): root# make install The Redland Perl interface is mature has been tested with the following versions (5.6.0 is the likely minimum; 5.005 is too old). 5.8.3 on Solaris/Sparc Testing the Redland Perl interfaceIf you did the optional install above, run the perl example program with: perl ./example.pl 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
Adding statement (new Statement(n, n, n)) to model
Adding statement (n,n,n) to model
Parsing URI (file) ../data/dc.rdf
Parsing added 3 statements
Printing all statements
Statement: {[http://example.org/foo], [http://example.org/foo], [http://example.org/foo]}
Statement: {[http://example.org/foo], [http://example.org/foo], [http://example.org/foo]}
Statement: {[http://www.dajobe.org/], [http://purl.org/dc/elements/1.1/title], "Dave Beckett's Home Page"}
Statement: {[http://www.dajobe.org/], [http://purl.org/dc/elements/1.1/creator], "Dave Beckett"}
Statement: {[http://www.dajobe.org/], [http://purl.org/dc/elements/1.1/creator], "Dave Beckett"}
Statement: {[http://www.dajobe.org/], [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://www.dajobe.org/], [http://purl.org/dc/elements/1.1/creator], "Dave Beckett"}
Subject: [http://www.dajobe.org/]
Predicate: [http://purl.org/dc/elements/1.1/creator]
Object: Dave Beckett
Matching Statement: {[http://www.dajobe.org/], [http://purl.org/dc/elements/1.1/creator], "Dave Beckett"}
Subject: [http://www.dajobe.org/]
Predicate: [http://purl.org/dc/elements/1.1/creator]
Object: Dave Beckett
Searching model for targets of subject http://www.dajobe.org/ predicate http://purl.org/dc/elements/1.1/creator
Matching Node: Dave Beckett
Matching Node: Dave Beckett
Querying for dc:titles:
result 1: {
a=[http://www.dajobe.org/]
c=Dave Beckett's Home Page
}
Writing model to test-out.rdf as rdf/xml
Done
Using the Redland Perl APIRead the Redland Perl POD documentation for full details of the classes and methods provided along with examples of use. The Perl API is an object-based API reflecting the same structure of the Redland objects with simple mappings between them:
Perl API Reference DocumentationEither use any of the RDF::Redland:: module links above or start at the main RDF::Redland module and follow the references from there. |
Copyright (C) 2000-2007