Version 2 (modified by tkappler, 9 years ago)

--

The State of RDF support in Perl

Experimenting

tkappler created a git repository  http://github.com/thomas11/perl-rdf-experiments to experiment with RDF in Perl, see what existing modules can do, etc. Biohackathoners, please fork and contribute!

Existing modules

Also see  http://www.perlrdf.org!

RDF::Query

Generic query interface working with several RDF modules. Powerful but complex. Am working with the author, Greg Williams of RDF::Trine, on some docs/tutorials.

It can talk to a Sparql endpoint via the HTTP Sparql protocol.

RDF::Trine

 RDF::Trine is a complete RDF package written in Perl. It is the only one that has parsers for RDF serializations other than RDF/XML (including JSON), and that has a SPARQL wrapper. It implements the  SPARQL protocol and can thus talk to any SPARQL endpoint.

Last release: 0.117, 2010-02-04.

istkappler in touch with the author, Gregory Williams, and it's a pleasure to work with him. Some patches contributed. Here's some of his advice that I intend to include in some more in-depth, step-by-step writeups.

In general you should be using RDF::Query for retrieving patterns that are more complex than a single triple pattern. get_pattern exists mostly for RDF::Query to use when the underlying store is expected to be able to execute a complex join query more efficiently than the perl implementation (for example, the DBI-based storage backend). It's never been a part of the code that has felt very stable, so I'd suggest always using the RDF::Query interface for situations where get_statements doesn't do as much as you need.

See the trine-*.pl files for code snippets.

RDF::Redland

 RDF::Redland is a wrapper for the [Redland C library]( http://librdf.org/). Looks pretty complete.

I couldn't build it as I have the new version 0.9.17 of librasqal, the query library for Redland, which is API incompatible with its predecessor on which RDF::Redland apparently depends.

Test::RDF

 Test::RDF supports checking for data validity, and comparing two graphs for equivalence. It does not explain the differences when they are not equal, however. Builds on RDF::Redland.

RDF::Core

Another pure Perl RDF framework.  CPAN. Last release: 0.51, 2007-02-19, which probably means that it's not very much used or supported. Use RDF::Trine unless you have a good reason not to.

Notes:

  • A pretty complete RDF package written in Perl, including parser and serializer, model with its own query language, and storage with either Berkeley DB, in-memory, or PostgreSQL as backend.
  • It's unfortunate that it has its own query language, should be SPARQL.
  • RDF/XML serialization and parsing only.
  • Has a Schema module to work with RDFS, didn't try it.
  • Greg Williams of RDF::Trine, the other, more complete and up-to-date RDF framework, tried to contribute to RDF::Core but was "[met with resistance, rejection, or frustratingly long delays]( http://kasei.us/archives/2006/09/23/perl_performance)". Not good.

Onto-Perl

 ONTO-PERL by fellow Biohackathoner Erick Antezana can translate between OBO, OBO-in-OWL, and RDF (among other things).

Wrappers

Future Work

A lot. Add if you think of something.

UniProt? has a very simple RDF reader that only works with UniProt? RDF. It's still useful as it's very easy to use, tkappler is working on packaging it up.