RDF::Trine - An RDF Framework for Perl. RDF::Trine provides an RDF framework with an emphasis on extensibility, API stability, and the presence of a test suite. The package consists of several components: * RDF::Trine::Model - RDF model providing access to a triple store. * RDF::Trine::Parser - Native RDF parsers (RDF/XML, RDFa, Turtle, and RDF/JSON). * RDF::Trine::Store::DBI - A triple store for MySQL and SQLite, based on the Redland schema. * RDF::Trine::Iterator - Iterator classes for variable bindings and RDF statements, used by RDF::Trine::Store, RDF::Trine::Model, and RDF::Query. * RDF::Trine::Namespace - A convenience class for easily constructing RDF node objects from URI namespaces. REQUIREMENTS To install RDF::Trine you'll need the following perl modules installed: * Data::UUID * DBI * DBD::SQLite * Digest::MD5 * Error * JSON * LWP::UserAgent * List::Util * Log::Log4perl * Math::BigInt * Math::Combinatorics * Scalar::Util * Text::Table * Time::HiRes * Unicode::Escape * Unicode::String * URI * XML::CommonNS * XML::Namespace * XML::SAX * XML::LibXML::SAX The following additional modules are optional: * DBD::Pg * DBD::Mysql * Test::More * Test::Exception * RDF::RDFa::Parser INSTALLATION To install, run: perl Makefile.PL make make test make install VERSION HISTORY Version 0.114 (2010-01-27) * Added new Turtle serializer. * Updated RDF/XML serializer grouping of same-subject statements for bounded descriptions. * Updated parse_into_model parser methods to be both class and object methods. * Updated Parser parse_* methods to take extra %args with optional 'context' value. * Moved RDF::Trine::Store::Hexastore from alpha/ directory into RDF::Trine package. * Added Storable to list of prereq modules. * Added partial support for rdf:Lists to RDF::Trine::Serializer::Turtle. * Added RDF::Trine::Namespace::uri_value method. * Updated unicode encoding and escaping in ::Node, ::Node::Literal, and ::Store::DBI. * Added variable() shortcut function to RDF::Trine package. * Updated RDF::Trine::Graph to materialize statements when constructed with a graph iterator. * Moved get_pattern logic from ::Store to ::Model. * Updated ::Model::Union to work better with ::Model::get_pattern. * Updated Node and Statement from_sse methods to work with constant string arguments. * Updated code and tests for better coverage. * Removed unused RDF::Trine::Iterator::sfinally function. * Fixed bug in RDF::Trine::Graph::equals. * Added UnimplementedError exception class. Version 0.113 (2009-12-30) * Added RDF::Trine::Parser::RDFa implementation to connect with RDF::RDFa::Parser. * Added ability to pass RDF::Trine::Node::Resource values as the datatype argument to RDF::Trine::Node::Literal::new(). * Special-cased 'xsd' in RDF::Trine::Namespace to return the RDF-version of the namespace URI (with trailing '#'). * Added syntax shortcuts as exportable from RDF::Trine: iri(), blank(), and literal(). * Added RDF::Trine::Serializer base class. * Fixed syntax error in generated RDF/XML in RDF::Trine::Serializer::RDFXML. * Fixed bug in RDF::Trine::Serializer::RDFXML that was dropping triples. * Added RDF::Trine::Parser::parse_url_into_model class method. * Updated parser classes' registration of parser names and media types. * Added RDF::Trine::Model::size method. * Removed ::Parser::Error package. Replaced with use of RDF::Trine::Error. * Convert data to utf8 encoding before hashing in RDF::Trine::Store::DBI::_mysql_hash_pp. * Added RDF::Trine::Model::objects_for_predicate_list method. * Removed RDF::Trine::Serializer::RDFXML::_split_predicate and replaced with call to $pred->qname. * Added RDF::Trine::Node::Resource::qname method to split an IRI into namespace and local parts. * Added RDF::Trine::Serializer::NTriples::Canonical (from tobyink). * Added RDF::Trine::Iterator::Bindings::as_statements to return a graph iterator. * Updated POD for ::Model::get_pattern to mention 'orderby' argument. * Updated ::Model::as_stream to return a graph iterator sorted by (s,p,o). * Updated RDF/XML serializer to merge same-subject rdf:Descriptions. Version 0.112 (2009-12-12) * Skip some failing tests when RDF::Trine::Node::Literal::XML is loaded. * Added RDF/XML serializer. * Added serialize_iterator_to_file and serialize_iterator_to_string methods to NTriples serializer. * Added _serialize_bounded_description method to NTriples serializer. * Added RDF::Trine::Parser::RDFJSON package (patch from tobyink). * Added RDF::Trine::Serializer::RDFJSON package (patch from tobyink). * Added add_hashref and as_hashref methods to RDF::Trine::Model (patch from tobyink). * Added tests for RDF/JSON parsing/serializing (patch from tobyink). * Updated RDF::Trine docs to mention the RDF/XML parser (good catch by tobyink). * Added logging code to RDF::Trine::Store::DBI. * Changed ::Store::DBI::get_statements to skip (with warning) past ill-formed statements with IDs that don't appear in any of the value tables. * Updated RDF::Trine::Serializer::NTriples to call as_ntriples on node objects during serialization. * Added as_ntriples methods to RDF::Trine::Node and subclasses for proper NTriples formatting. * Updated bin/rdf_store_serialize.pl to print in NTriples format. Version 0.111 (2009-07-14) * Added RDF::Trine::Graph for testing graph equality. * Added node_names() method to ::Statement and ::Statement::Quad. * Added RDF::Trine::Statement::has_blanks method. * Fixed bug in RDF::Trine::Namespace to allow subclassing. * Removed dependency on Test::JSON, List::MoreUtils, and XML::Parser. * Added POD to RDF::Trine::Parser. * RDF::Trine::Store::temporary_store now delegates to RDF::Trine::Store::DBI. * Removed unnecessary call to blessed() in RDF::Trine::Statement. * Removed unused RDF::Trine::Promise class. * RDF::Trine now loads RDF::Trine::Store. * Removed TODO labeling of tests in t/model-filter.t. Version 0.110 (2009-03-14) * Added RDF::Trine::Store base class with default implementation of get_pattern(). * Updated bin/rdf_store_add_file.pl to use the RDF::Trine parser, not Redland's parser. * Added POD description to RDF::Trine package. * Updated VERSION variables to 0.109 (forgotten during the last release). * Updated ::Iterator::Bindings::as_string to join lines with empty string (had been returning a list). * Added debug tracing code to ::Store::DBI. * Updated schema in ::Store::DBI::mysql to use utf8 charset and collation, and use a pkey instead of a unique. * RDF::Trine::Store::get_pattern now passes through optional @args (used for order-by). * Fixed bug in ::Store::DBI::remove_statements causing bad SQL when all nodes are undef (remove all triples). * ::Node::Literal::new now calls ::Node::Literal::XML::new if available and applicable. Version 0.109 (2008-11-14) * Removed incremental parsing code from RDF-Trine package. * Added POD to from_sse methods in ::Node and ::Statement. * Added parsing of variables to RDF::Trine::Node::from_sse. * Small changes to ::Iterator and ::Trine::Node::Literal for efficiency. * Whitespace updates to ::Trine::Node. * Added SQLite-specific ::Store::DBI subclass so that indexes are created properly. * Fixed bug in RDF::Trine::Iterator::Bindings::print_xml that dropped every other row. * Updated RDF::Trine::Node::Resource to work with URI objects. * rdf_parse_turtle.pl now warns on any parser error. * RDF::Trine::Node::Resource now escapes unicode in base URIs (now just relative URI part) before calling URI->new_abs. * Turtle parser now makes universal IDs for all blank node (even those with given IDs like _:xyz). * Fixed Unicode unescaping in Turtle parser's handling of string literals. * Turtle parser now doesn't modify the lexical value of numeric typed literals. * Fixed ::Store::DBI handling of Quads in get_statements (had been broken because RDF::Query bypasses it by using get_pattern). * Fixed bug in ::Iterator::Bindings::print_xml that would drop every other result. * Updated VERSION numbers and docs for RDF::Trine for 0.109_01 candidate release. * ::Store::DBI now throws an error if call to DBI->connect doesn't return a database handle. * ::Iterator::Bindings::as_string now returns '' when there are no rows (instead of dying). * Added $IGNORE_CLEANUP to ::Store::DBI to allow preventing DBI cleanup. * ::Store::DBI now throws an error if call to DBI->connect doesn't return a database handle. * ::Iterator::Bindings::as_string now returns '' when there are no rows (instead of dying). * Moved all debugging over to use Log::Log4perl. * Updated prerequisite list (removed Digest::SHA1 and XML::Parser, and added missing modules). Version 0.108 (2008-07-14) * Added NTriples serializer module. * Added POD to RDF::Trine::Promise. * Added XML::Parser to list of required modules. * Added a peek method to ::Iterator to support execution deferment like in ::Algebra::Service. * Added RDF::Trine::Promise for general computation deferment. * Added print_xml method to RDF::Trine::Iterator classes. * Added support for Postgres storage. * Added XML::LibXML::SAX as a prerequisite (because XML::SAX::PurePerl can't handle some RDF/XML that uses unicode). * Replaced RDF::Core-based RDF/XML parser with a new XML::SAX based parser. * Removed now unused redland-based RDF/XML test data. * Removed unused redland fallback code from RDF::Query::Model::RDFTrine. * Removed redland-based RDF/XML parser tests. * Updated Turtle grammar to accept uppercase language tags. * Fixed COLLECTION support in RDF/XML parser. * Fixed RDF/XML parser for nodeID, sequence, reification, and base URI handling. * Fixed POD in NTriples serializer. * Fixed RDF/XML parser to handle nodeID, arbitrary xml attributes, parseType="Literal" serialization, and base URI handling. * Normlized expected NTriples data in W3C RDF/XML test files. * Added unicode escaping to Literal and Resource sse serialization. * Added W3C RDF/XML data and test script. * Fixes to deferring XML serialization for SPARQL bindings. * Fixed bug in delaying XML serialization for identity hints header computation. * Fixed extra data following xml query results. * Fixed strict refs bug in print_xml in iterator classes. * Updated tests that started failing after the previous commit (affecting SQL-compilation). * Allow equality test and disjunction filters in patterns that can be compiled to SQL. * Fix bug in SQL compilation when restricting left-joins to specific node types (based on functions like isIRI). * Added support to the DBI store for filters for equality tests. * Mysql store schema now adds indexes. * Improved use of temporary RDF::Trine stores in RDF::Query tests. * DBI temporary stores now use an in-memory SQLite database. * Fixed bug in RDF::Trine::Store::DBI::mysql (calling _mysql_hash() without qualifying it in the superclass). * Fixed variable ordering bug in UNION to SQL handling by forcing a sorted projection order. * Added support to compile normalized UNION (can only be the top-level node or a child of another UNION) patterns to SQL. * Made SQL more standards compliant. * RDF::Trine::Store::DBI now auto-upgrades to mysql and postgres classes. * Fixed unicode escaping by replacing Unicode::Escape calls to hand-rolled code in RDF::Trine::Node. * RDF/XML parser now accept more than one top-level resource. * RDF/XML parser now accepts URI objects as base uri (not just RDF::Trine::Node::Resource objects). * Added tabular as_string serialization of ::Iterator::Bindings objects. * Added Text::Table as a prerequisite. * Fixed RDF/XML parser handling of strings (versus file handles). * Fixed Turtle parser to properly keep '+' on integer literals. * Fixed bindings_count so it doesn't pull a result from the stream (basing the count on binding_names). * Fixed bindings xml serialization whitespace formatting. * Cleaned up ::Iterator::Bindings::as_string serialization code. * Replaced use of splice() with shift() in ::Iterator::SAXHandler::pull_result. Version 0.107 (2008-04-25) * Added Digest::SHA1 as a requirement for RDF::Trine. * Fixed base URI use in Turtle parser. * Fixed SQLite DSN in example scripts. * Fixed XML whitespace error in iterator-thaw.t Version 0.106 (2008-04-19) * Added a mysql-specific RDF::Trine::Store class (now uses INSERT IGNORE for efficiency). * SQL compiler now doesn't select statement contexts unless called via get_statements (not get_pattern). * RDF::Trine::Iterator::Graph::as_bindings now can be called with no arguments (uses default names). * Moved the nested hash join from ::Iterator to ::Iterator::Bindings. * Added new tests to improve coverage of node and iterator classes. * Added tests for binding iterator cartesian product join. * Pipelined the code for nested loop joins on binding iterators. * Added SPARQL XML Results test for identity hints in element. * Fixed bug in ::Model::StatementFilter to call join_steams in ::Iterator::Bindings. * Fixed bug in ::Iterator::Graph::as_bindings where not all arguments are ::Node::Variable objects. * Updated SPARQL XML Results namespace for boolean iterators. * Replaced XML::Twig code with new XML::SAX parser (allowing streaming parsing). * Moved as_sparql methods from RDF::Trine:: to RDF::Query:: classes. * RDF::Trine::Iterator::smap now allows overriding default construct_args (e.g. binding names). * Fixed RDF::Trine::Model::StatementFilter::get_pattern to project away unused variables (fixing a bug that caused joining to always fail). * Updated example turtle parser to accept URLs as command line arguments. * Turtle parser now removes dashes from the UUIDs used for blank node IDs. * Added support to incrementally thaw an Iterator from an IO::Socket. * Added RDF::Trine::Iterator::SAXHandler::rate method. * Added Time::HiRes as prerequisite to META.yml and Makefile.PL. * Updated all RDF::Trine modules to use consistent VERSION number for 0.106 release. * Added examples directory (and an example script) to the RDF-Trine package. * Removed Bloom::Filtere from the list of prerequisites (functionality has moved to RDF::Query). Version 0.105 (2008-03-19) * Removed use of File::Slurp in parser tests. Version 0.104 (2008-03-14) * Updated SPARQL XML Results namespace declaration in RDF::Trine::Iterator serialization methods. * Added extra_result_data methods to add data to the XML Results header tag. * RDF::Trine::Node::Resource now serializes to QName when passed valid namespace data. * Fixed xml results serialization for style. Version 0.103 (2008-03-10) * Updated to recognize (renamed) RDF::Query::Expression class. Version 0.102 (2008-03-07) * Added length() method to Materialized bindings iterator class. * Removed bloom filter construction from bindings iterator (RDF::Query code now does this itself). * Fixed escaping of backslashes in Literal node serialization. Version 0.101 (2008-03-04) * Added an RDF/XML parser based on RDF::Core::Parser. * Added Bloom filter support for Materialized bindings iterators. * Fixed IRI workaround using the URI module. * Turtle parser now uses Data::UUID for unique names. * Fixed turtle parser bug for Verb testing. * Added RDF::Trine::Statement::Quad::from_redland method. * DBI store now constrains variable node types based on position in a statement. * Added support for BOUND(), ISLITERAL(), ISURI() and ISIRI() functions in DBI store. Version 0.100 (2008-02-18) * Initial public release. COPYRIGHT Copyright (C) 2008 Gregory Williams. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR Gregory Williams