= 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 === [http://search.cpan.org/~gwilliams/RDF-Trine-0.117/ 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 [http://www.w3.org/TR/2008/REC-rdf-sparql-protocol-20080115/#query-bindings-http 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 === [http://search.cpan.org/~djbeckett/Redland-1.0.5.4/redland/docs/redland.pod 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 === [http://search.cpan.org/~mndrix/Test-RDF-0.0.3/lib/Test/RDF.pm 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. [http://search.cpan.org/~dpokorny/RDF-Core/ 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 === [http://search.cpan.org/~easr/ONTO-PERL-1.14/ ONTO-PERL] by fellow Biohackathoner Erick Antezana can translate between OBO, OBO-in-OWL, and RDF (among other things). === Wrappers === * [http://search.cpan.org/~mndrix/RDF-Sesame-0.17/lib/RDF/Sesame.pm RDF-Sesame] is a wrapper for the REST API of [Sesame](http://openrdf.org/), to ask [SerQL](http://www.openrdf.org/doc/sesame/users/ch06.html) queries and get the results in tabular form. * [http://search.cpan.org/~ekawas/MOBY-1.12/ MOBY], a BioMoby client, has MOBY::RDF. == 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.