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, RDF/JSON, TriG, N-Triples, and N-Quads). * RDF::Trine::Serializer, a set of native RDF serializers for RDF/XML, Turtle, RDF/JSON, N-Triples, Canonical N-Triples, and N-Quads. * 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: * Algorithm::Combinatorics * Data::UUID * DBI * DBIx::Connector * DBD::SQLite * Digest::MD5 * Error * HTTP::Negotiate * JSON * LWP::UserAgent * List::Util * List::MoreUtils * Log::Log4perl * Math::BigInt * Scalar::Util * Set::Scalar * Text::CSV * Text::Table * Time::HiRes * Unicode::Escape * Unicode::String * URI * XML::CommonNS * XML::Namespace * XML::SAX * XML::LibXML * 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 1.004 (2013-03-02) * API CHANGES Changed RT:spog:* keys to be a hash with node ID data for each quad position in Redis store. * ENHANCEMENTS Treat data passed into parsers as characters (github pull request #82 from Tony Cook). Improve the error message when trying to parse an empty RDF/XML string (Kjetil Kjernsmo). Added get_graphs as an alias for get_contexts in RDF::Trine::Model and RDF:Trine::Model::Dataset. * OTHER Test to see if DBD::Pg is installed in test suite (github pull request #78 from Kjetil Kjernsmo). Added turtle command line tools turtle_parse.pl, turtle_benchmark.pl, and turtle_tokenize.pl. Version 1.003 (2012-12-22) * BUG FIXES Fixes to code that depended on hash key ordering. Fixed test of error conditions in RDF::Trine::Parser->parse_url_into_model. Fixed bug in RDF::Trine::Parser::RDFXML that caused fatal errors on malformed input instead of throwing RDF::Trine::Error exceptions. Fixed RDF::Trine::Parser::Turtle::Lexer->check_for_bom to handle zero-length input. * NEW FEATURES Added prefix_for and abbreviate methods to RDF::Trine::NamespaceMap (patch from Dorian Taylor) * OTHER Require Scalar::Util 1.24. Re-added RDF::Trine::Parser::Turtle->parse_node method. Version 1.002 (2012-10-20) * OTHER Require Scalar::Util version 1.23. Version 1.001 (2012-10-05) * BUG FIXES Fixed bareword bug in RDF::Trine::Parser when UUID::Tiny is not available. * ENHANCEMENTS Replaced old Turtle and TriG parsers with new streaming implementations. Added RDF::Trine::Node::Literal->canonicalize method. Updated RDF::Trine::Parser::Redland to construct a new parser object on each parse (avoiding a bug in redland). Applied partial patch to "fix interaction with HTML::Data::Parser" (from Dorian Taylor; commit 9b713b23b6). * OTHER Added Moose and MooseX::ArrayRef to prerequisites list. Updated code style to work with Perl::Critic core policies. Added POD to RDF::Trine and RDF::Trine::Store::DBI (based on patch from Evan Carew). Updated required version of perl to 5.10. Silenced undefined warnings in RDF::Trine::Parser::Turtle::Lexer. Silenced warning of cartesian joins in RDF::Trine::Store::Hexastore. Version 1.000 (2012-06-29) * API CHANGES Removed RDF::Trine methods count, add_extra_result_data, extra_result_data. Removed support for extra data serialized in SPARQL/XML result format link tags. Made Literal and Resource node constructors throw exception when passed undef lexical value. * BUG FIXES Fixed parsing of backslash escapes in Turtle quoted literals (from Toby Inkster via github pull request #63). Rolled back attempted optimization of bulk ops calls (which broke the code). Fixed etag bug in RDF::Trine::Store::Memory. * NEW FEATURES Added RDF::Trine::Model->add_iterator method. * OTHER Fixed miscellaneous typos (from Evan Carew). Updated bug reporting details in BUGS POD section. Updated documentation in several classes. Removed redundant documentation in RDF::Trine::Parser. Added Redland test for UTF8 (from Kjetil Kjernsmo). Added two tests for concat graph iterators (from Kjetil Kjernsmo). Fix usage of materialized iterators in t/iterator-graph.t (from Kjetil Kjernsmo). Document the extends option to negotiate in the serializer (from KjetilK). Document RDFTRINE_NO_REDLAND (from KjetilK). Version 0.140 (2012-05-08) * API CHANGES Removed default get_pattern implementation in RDF::Trine::Store. * BUG FIXES Added missing import of looks_like_number function in RDF::Trine::Node::Literal. * ENHANCEMENTS Added RDF::Trine::Pattern->sort_for_join_variables method to prevent unnecessary cartesian joins. Added optional content_cb callback argument to RDF::Trine::Parser->parse_url_into_model. Version 0.139 (2012-04-11) * API CHANGES Made server a required configuration key in RDF::Trine::Store::Redis. * BUG FIXES Fixed interaction of peek() and finished() in RDF::Trine::Iterator. Fixed use of iterator finished method in RDF::Trine::Iterator::Bindings->as_json. Fixed use of iterator finished method in RDF::Trine::Store::Hexastore->get_pattern. Fixed bug when RDF::Trine::Iterator->finished is called before an (empty) iterator is used. Fixed fallback parsing bug in RDF::Trine::Parser->parse_url_into_model. Fixed PostgreSQL capitalization bug (patch from https://rt.cpan.org/Ticket/Display.html?id=71890 applied by Kjetil Kjernsmo). * NEW FEATURES Added RDF::Trine::Serializer::NQuads->statement_as_string method. * ENHANCEMENTS Added 'scoped_namespaces' constructor argument to RDF::Trine::Serializer::RDFXML to serialize only necessary namespace declarations. (github issue 33). Initialize Log4perl only if it isn't initialized already (pull request 57 from kba). * OTHER Fixed expected result count in Test::RDF::Trine::Store->get_pattern_tests. Simplified code in t/store-hexastore-pattern.t. Added tests for RDF::Trine::Iterator->peek. Adding some get_pattern tests to the Store tests (Kjetil Kjernsmo). Replaced references to RDFQUERY_NO_REDLAND environment variable with proper RDFTRINE_NO_REDLAND. Allow suppressing RDF::Redland use if the RDFQUERY_NO_REDLAND environment variable is set. Removed erroneous copies of RDF::Trine::Store::DBI::Pg->init method. Add pg tests (Kjetil Kjernsmo). Version 0.138 (2012-01-25) * BUG FIXES Fixed error-handling syntax bug in RDF::Trine::Parser->parse_url_into_model. * NEW FEATURES Make Hexastore support etag. * ENHANCEMENTS Croak rather than die in some places and use logdie in one place. * OTHER Fix documentation typos from fschlich@zedat.fu-berlin.de. Improved performance of Redis store with use of variadic functions. Added store tests for literals including utf-8 handling and languages. Version 0.137 (2011-12-20) * API CHANGES Trying to instantiate a resource node with the Nil IRI results in the Nil node object. * BUG FIXES Fixed unicode escaping issues in RDF::Trine::Serializer::Turtle (bugreport from nichtich <4EB7B9BE.8000205@gbv.de>). Fixed RDF::Trine::Parser::Turtle to properly unescape percent-encoded URIs. Fixed RDF::Trine::Statement->from_redland to properly unescape percent-encoded URIs. Only set parser metadata if RDF::RDFa::Parser is available (github issue 32 from nichtich). Added PostgreSQL-specific init method to handle case sensitivity of table names (RT#71890 from John Nicholas Whitley). * NEW FEATURES Implement RDF::Trine::Store::Hexastore->nuke (KjetilK). Added initial code for a Redis-based store. Added serialize_node method to RDF::Trine::Serializer::NTriples and RDF::Trine::Serializer::Turtle. Added parse_node method to RDF::Trine::Parser::NTriples. * ENHANCEMENTS Create a fallback-implementation of remove_statements in Store.pm (KjetilK). Updated RDF::Trine::Graph to use Algorithm::Combinatorics for memory/speed improvements (instead of Math::Combinatorics). * OTHER Support triple-only stores in the test suite (patches from KjetilK). Added missing POD to RDF::Trine::Store::DBI::Pg and RDF::Trine::Store::Redis. Check the Perl version when running Tiny::UUID (KjetilK). RDF::Trine::Parser now attempts to use Data::UUID before UUID::Tiny in bnode ID generation (based on test failures). Version 0.136 (2011-10-19) * API CHANGES Removed RDF::Trine::Iterator::SAXHandler->rate method and dropped dependency on Time::HiRes. Consolidated bnode prefix handling in parser classes, adding support for UUID::Tiny. * BUG FIXES Fixed escaping of URIs in rdf:about attributes (patch from SADI Framework). Return an empty string instead of undef in RDF::Trine::Iterator->format_node_xml. Fixed RDF::Trine::Store::SPARQL->count_statements handling of variables. Fixed turtle serializer to check if numerics are in canonical form. Fixed mysql schema to quote index names that might contain reserved characters. Fix RDF::Trine::Model->get_statements to throw an error when called with arguments that aren't either undef or node objects. Fixed titlecase of table reference in RDF::Trine::Store::DBI::mysql->init. Fixed bug in use of UUID::Tiny::UUID_V1 bareword in RDF::Trine::Parser->new_bnode_prefix. * NEW FEATURES Initial support for using Dydra as a store. Added RDF::Trine::Parser::Turtle->parse_node method. Added RDF::Trine::Node::Literal->is_canonical_lexical_form. Made RDF::Trine::Serializer::NTriples->statement_as_string a public method. RDF::Trine::Parser->parse_url_into_model now fill properly fall back on guesswork when media-type parsing fails. Moved as_hashref functionality from RDF::Trine::Model to RDF::Trine::Iterator::Graph. Added TSV serializer. * ENHANCEMENTS Allow empty namespace prefix in RDF::Trine::NamespaceMap (patch from Jakob Voss). Added text/html media type, and added use of Module::Load::Conditional in RDF::Trine::Parser::RDFa. Added support of SPARQL endpoints with URL parameters like Virtuoso's 'http://example.org:8890/sparql?default-graph-uri=...' (patch from Jakob Voss). Updated RDF::Trine::Store::DBI to use DBIx::Connector. * OTHER Added option to sleep after each store update in Test::RDF::Trine::Store. Fixed code in RDF::Trine::Store::SPARQL that was causing a warning when a variable name was redefined. Updated RDF::Trine::Store::DBI::mysql->_add_node to return the node hash value. Stop RDF::Trine::Store::DBI->add_statement from unnecessarily hashing nodes multiple times (patch from tobyink). Moved redland store tests to developer xt directory. Updated t/serializer-turtle.t to be more accepting of stores returning data in varying orders. Removed 'or die' conditional from store tests. Changed test endpoint from kasei.us to myrdf.us. Added simple store tests for bulk_ops in Test::RDF::Trine::Store. Removed heavy dependency on DBI store in test cases. Require RDF::Redland 1.0.7.1 in xt/store-redland.t. Add missing use of RDF::Trine::Statement::Quad. Conditionally load DBI store, and return Memory store from temporary_store(). Removed dependency on Unicode::Escape. Made XML::LibXML an optional dependency (RDF/XML parser will not perform c14n if it is not installed) Updated RDF::Trine::Store::Memory to use Digest::SHA instead of Digest::MD5. Removed depedency on List::MoreUtils. Added POD for Test::RDF::Trine::Store->update_sleep. Added POD for RDF::Trine::Serializer::NTriples->statement_as_string. Removed depedency on Unicode::String and List::MoreUtils. Removed unnecessary use statements. Version 0.135 (2011-04-30) * API CHANGES Globally changed 'base' to 'base_uri' in Trine code and API. Changed name of redland rdfa parser to 'librdfa' and removed associated media type and file extensions (due to librdfa bugs). * BUG FIXES Fixed bug in RDF::Trine::Store::DBI::mysql that was causing init() to remove existing data. * NEW FEATURES Added RDF::Trine::Store::DBI->nuke method for removing store data. Added RDF::Trine::Model->remove_list method (patch from tobyink). Added RDF::Trine::Iterator->seen_count method. Added RDF::Trine::Model->get_sparql delegation method. * ENHANCEMENTS Updated RDF::Trine::Parser->parse_url_into_model to be better at guessing media types for file: URIs. Updated RDF::Trine::Parser::Redland to allow the $base argument to be a URI object. Updated RDF::Trine::Parser->parse_url_into_model to not catch and hide exceptions thrown from calls to parse_into_model. Updated bin/srx2csv to handle unbound variables in results. Added support for 'storeclass' key in RDF::Trine::Store->new_with_config. Added supports method to RDF::Trine::Model, RDF::Trine::Model::Dataset, and RDF::Trine::Store classes. RDF::Trine::Store->new_with_string now attempts to load store classes before using them. Renamed RDF::Trine::Store::SPARQL->_get_iterator to get_sparql. * OTHER Added SQL file for creating the mysql backend database. Remove the meaningless "All rights reserved" copyright text. Style changes to RDF::Trine::Iterator::Bindings->print_xml. Updated required version of XML::SAX to 0.96. Updated store tests (KjetilK). Removed Digest::SHA1 from list of prereq modules. Version 0.134 (2011-03-29) * API CHANGES Deprecated RDF::Trine::Iterator->count. * BUG FIXES Fixed bug in RDF::Trine::Iterator::SAXHandler on data with empty results. Fixed canonicalization bug in RDF::Trine::Node::Literal for xsd:decimals with no decimal point. * NEW FEATURES Added srx2csv and srx2table scripts. Added API for stream parsing of srx results to RDF::Trine::Iterator::SAXHandler. Added RDF::Trine::Model->get_sequence method for accessing rdf:Seq structures. Added 'value' method to RDF::Trine::Node subclasses for accessing the primary scalar value of a node. Added RDF::Trine::Graph->error method to explain failures in RDF::Trine::Graph->equal. Updated RDF::Trine::Graph to support: subgraph testing, access to injection map, delegation to RDF::Trine::Model (patch from tobyink). * ENHANCEMENTS Fixed RDF::Trine::Node::Resource->qname handling of unicode IRIs. Fixed RDF::Trine::Parser::NTriples->parse_file to accept filenames just like the superclass implementation. Fixed RDF::Trine::Parser->parse_file to open files as utf8. Fixed RDF::Trine::Parser->parse_url_into_model to pass through 'canonicalize' argument to actual parser method call. Allow 'canonicalize' argument to RDF::Trine::Iterator->from_json method. * OTHER Made diagnostic messages less noisy in t/store-hexastore-storable.t. Silenced an uninitialized warning in RDF::Trine::Parser::NTriples. Removed use of XML::SAX in RDF::Trine::Serializer subclasses. Added turtle parser test for file with BOM. Updated RDF::Trine::Store::DBI and RDF::Trine::Store::DBI::mysql to use DBI placeholders. Version 0.133 (2011-02-07) * BUG FIXES Fixed bug in Turtle parser that wouldn't allow a Unicode BOM in the input. Fixed bug in turtle serialization of blank nodes used in graph cycles (reported by tobyink). Fixed bug in RDF::Trine::Serializer::RDFXML that wasn't escaping XML entities in IRIs and bnode labels (github issue 3 from nichtich). Updated RDF::Trine::Store::Hexastore to use equal() method instead of op<==> for testing node equality. Updated t/parser-rdfjson.t to test bnode equality using identifier strings, not with op<==>. Fixed RDF/XML xmlns serialization bug when used with RDF::Trine::NamespaceMap objects. * NEW FEATURES Added RDF::Trine::NamespaceMap class. Added support to populate RDF::Trine::NamespaceMap objects during RDF parsing. Added RDF::Trine::Model get_list and add_list methods for managing rdf:List structures. Added support for parsing SPARQL JSON Results format in RDF::Trine::Iterator->from_json. RDF::Trine::Parser subclasses now allow parse_file_into_model and parse_file being called as class methods. Added 'restrict' and 'extend' options to RDF::Trine::Serializer->negotiate to allow more control over content negotiation. Added the ability to restrict the nodes returned from the RDF::Trine::Model->objects method by node type or by literal language/datatype. * ENHANCEMENTS Updated RDF::Trine::Store::SPARQL to allow bulk-update operations. Added string overloading to RDF::Trine::Node subclasses. Added text/rdf+n3 as a media type for RDF::Trine::Serializer::Turtle. * OTHER Updated conneg code setting default q-values in RDF::Trine::Serializer. Updated RDF::Trine::Iterator::Graph->print_xml to set utf8 binmode on the output filehandle. Changed required version of Module::Load::Conditional to 0.38 (based on version in debian). Version 0.132 (2010-12-23) * Added conditional loading of Redland parsers and stores when available using Module::Load::Conditional. * Added auto-initialization of DBI stores during object construction. * Added RDF::Trine::Store->new method to delegate to existing constructors. * Moved slow turtle parser tests into developer tests directory xt/. Version 0.131 (2010-12-07) * Fixed SPARQL XML Results serialization to omit unbound variables and properly declare literal languages and datatypes. * Copied implementations of is_numeric_type() and numeric_value() from RDF::Query::Node::Literal to RDF::Trine::Node::Literal. * Updated documentation to explicitly discuss inherited methods due to subclassing (RT 63153 comment from Ivan Shmakov). * Updated POD for RDF::Trine::Iterator subclasses (RT 63153 comment from Ivan Shmakov). * Fixed RDF::Trine::Parser->guess_parser_by_filename to get RDF/XML parser class from parser_by_media_type() instead of being hardcoded. * Fixed RDF::Trine::Serializer::Turtle::_node_concise_string to allow call as class method. * Added RDF::Trine::Parser::Redland subclasses to allow calling new() with no 'name' argument. * Added file extensions to parser registry for RDF::Trine::Parser::Redland. * Added RDF::Trine::Model->as_graphviz method. * Added checks to avoid undefined warnings in RDF::Trine::Serializer::NTriples::Canonical (suggestion from KjetilK). * Set :utf8 mode on string-backed filehandles in RDF::Trine::Serializer::Turtle. * Attempt at patching utf8 turtle/trig parsing bug submitted by KjetilK. * Updated required version of Test::More to 0.88 (bugreport from @danbri). Version 0.130 (2010-10-18) * Fixed bug in RDF::Trine::Node::Literal->is_valid_lexical_form check for xsd:double. * Updated RDF::Trine::Iterator::Bindings->as_string to use concise turtle syntax. * Added RDF::Trine::Parser methods media_type(), media_types(), parser_by_media_type(), and guess_parser_by_filename(). Version 0.129 (2010-10-04) * Updated Makefile.PL and RDF::Trine to require perl v5.8.3. * Fixed bug in promotion of temporary models from memory-backed to a SQLite-backed store. * Fixed RDF::Trine::Store::DBI->new to bless into backend-specific classes when passed a database handle (bug report from tobyink). * Updated RDF::Trine::Node::Literal to produce more accurate canonical lexical forms for xsd types. * Added RDF::Trine::Node::Literal->is_valid_lexical_form method. * Added support for special union-graph 'tag:gwilliams@cpan.org,2010-01-01:RT:ALL'. * Added exportable constants for UNION_GRAPH and NIL_GRAPH in RDF::Trine. Version 0.128 (2010-09-28) * Added .owl as a recognized RDF/XML file extension for the fallback parser guessing code. * Fixed bug in RDF::Trine::Store::SPARQL preventing access to the default graph. * Added new_with_config method to allow interactive configuration via rqsh.pl. * Updated RDF::Trine::Store::DBI->init to (partially) work if called for a new model (but the database has already been initialized). * Fixed call to RDF::Trine::Parser->parse_into_model in bin/rdf_store_add_file.pl. * Fixed call to RDF::Trine::Parser->parse_url_into_model in RDF::Trine::Store::Memory. * Removed RDF::Redland dependency in bin/rdf_store_add_file.pl. * Added introspective _config_meta method to RDF::Trine::Store subclasses to allow interactive configuration. * Added RDF::Trine::Store->class_by_name class method. * Added etag method to RDF::Trine::Model and RDF::Trine::Store::Memory to allow for HTTP caching. * Updated RDF::Trine::Node::Literal->canonicalize_literal_value coercion of xsd:decimal values. * Added optional flag to RDF::Trine::Node::Literal->new to attempt to canonicalize recognized XSD values. * Updated RDF::Trine::Exporter::CSV to accept a graph iterator (for serializing s,p,o as CSV). * Added RDF::Trine::Store::DBI->clear_restrictions method (suggestion and partial patch from tobyink). * Updated RDF::Trine::Store::Redland to improve efficiency (based on suggestions from Dorian Taylor). * Added native redland parser class and tests (patch from Dorian Taylor). * Added RDF::Trine::Iterator->each method (requested by tobyink). * Made code updates to improve performance based on profiling. * Updated to use URI 1.52 to allow direct usage of IRIs without unicode workarounds. * Added content-sniffing to fallback parser guessing code for RDF/XML and Turtle. * Lowered required version of redland in RDF::Trine::Parser::Redland to 1.0.7.1. * Added RDF::Trine::Serializer->serializer_names method for listing available serializers. * Added as_string method to RDF::Trine::Iterator::Boolean and RDF::Trine::Iterator::Graph. Version 0.127 (2010-08-30) * Removed redundant prerequisite for XML::LibXML::SAX from Makefile.PL. * RDF::Trine::Model->bounded_description now catches and ignores UnimplementedError exceptions. * Added heuristics support for TriG, RDF/JSON, and N-Quads to RDF::Trine::Parser->parse_url_into_model. * Added ability to specify the base URI for serializing RDF/XML and Turtle (patch from KjetilK). Version 0.126 (2010-08-16) * Fixed N-Triples serialization escaping bug for strings whose only escapable character is '\'. * Fixed typo in handling of RDF::Trine::Node::Formula extension. * RDF::Trine::Model->new will now return a temporary model when called with no arguments. * Updated get_pattern methods in Model and Store classes to return VariableBindings objects. * Updated DBI backend to allow no-op adding of the nil node. * Updated SPARQL backend to use SPARQL 1.1 Update and Aggregate operations. * Updated Memory and Hexastore backends to support 'graph' key in _new_with_config(). * Improved error messages in N-Triples and N-Quads parsers. * Fixed column naming bug in RDF::Trine::Store::DBI->get_contexts. * Added begin_bulk_ops() and end_bulk_ops() hint methods to RDF::Trine::Model. * Updated RDF::Trine::Parser to call begin_bulk_ops() and end_bulk_ops() on model object. * Updated DBI backend to use transactions when bulk_ops hints are used. * Added '==' and 'eq' overloading to RDF::Trine::Graph class. * Updated RDF::Trine::Model->bounded_description to traverse backwards links across blank nodes. Version 0.125 (2010-07-29) * Fixed hash collision bug in RDF::Trine::Store::DBI handling of literals with values '' and '0'. * Added RDF::Trine::VariableBindings class (ported from RDF::Query). * Iterators constructed from SPARQL XML Results format now return variable bindings objects. * Turtle serialization to strings now only declares prefixes that are used in the data. * Added media types and URIs for N-Quads parser and serializer. * Added RDF::Trine::Statement->rdf_compatible method (patch from tobyink). * Changed RDF::Trine::Model node methods (subjects, predicates, objects) to use quad semantics and accept a graph parameter. * Add documentation for new_with_object. * Add documentation for the hashref config. * Improved efficiency of counting quad patterns in RDF::Trine::Store::DBI. * Fixed bug in N-Triples serializer (was serializing quads). * Added %format_uris registry for parsers and serializers. * Added RDF::Trine::Model::as_string method. * Require XML::LibXML 1.70. * Removed unused variable in RDF::Trine::Parser::RDFXML. * Added character encoding declaration to RDF::Trine::Iterator::Bindings->print_xml. * Added character encoding declaration to RDF::Trine::Iterator::Boolean->print_xml. Version 0.124 (2010-06-21) * Updated quality value heuristics in RDF::Trine::Serializer::negotiate to prefer turtle if no accept headers are supplied. * Added ability for RDF::Trine::Store::Memory to load RDF files by URI in _new_with_string. * Added default implementation of RDF::Trine::Serializer::serialize_iterator_to_file. * RDF::Trine::Serializer::negotiate now slightly prefers turtle. * Added RDF::Trine::Iterator->count method. * Fixed RDF::Trine::Iterator::Bindings::as_string to respect $max_result_size argument. * RDF::Trine::Iterator::Bindings::as_string now returns unescaped strings. * Added ability to access the number of rows returned from RDF::Trine::Iterator::Bindings::as_string. * Updated RDF::Trine::Parser::parse_url_into_model to fall back on file extension heuristics if the media-type based parse fails. * Updated RDF::Trine::Parser::RDFJSON to throw an error if input isn't valid JSON. * Updated RDF::Trine::Model to throw an error if not passed a store object. * Added RDF::Trine::Model::Dataset for constructing views over a model, and RDF::Trine::Model->dataset_model constructor method. * Fixed bug in handling of quads in RDF::Trine::Model::get_pattern and RDF::Trine::Store::get_pattern. * Updated RDF::Trine::Store::DBI and RDF::Trine::Store::Memory to not return the default (nil) context from get_contexts. * Fixed bug in RDF::Trine::Store::Memory::_get_statements_quad that would infinite loop after removing statements. * RDF::Trine::Store doesn't load RDF::Redland (now only checks if it is already loaded). * Fixed bug in RDF::Trine::Store subclasses registering their class names in %STORE_CLASSES. * Added missing use of Encode to RDF::Trine::Store::Redland. * Made $RDF::Trine::Store::Redland::NIL_TAG globally accessible. * Added bin/rdf_transcode.pl for (streaming) conversion between RDF serialization formats. * Updated POD tests to not use taint mode (and synced between R::T and R::Q). * Changed test data in t/iterator-thaw.t. * Removed RDF::Core as a prerequisite in META.yml. * Added default implementation of RDF::Trine::Serializer::serialize_iterator_to_file. * RDF::Trine::Serializer::negotiate now slightly prefers turtle. Version 0.123 (2010-05-13) * Added turtle utf8 decoding for Turtle parser. * Added RDF::Trine::Serializer::media_types method. * Added RDF::Trine::Store::new_with_object method. * Fixed unicode encoding bug in RDF::Trine::Store::DBI. * RDF::Trine::Serializer::NTriples::Canonical.pm now inherits from RDF::Trine::Serializer::NTriples. * Cleaned up VERSION declarations. * Updated RDF::Trine::Parser::parse_url_into_model to fall back on file extension heuristics if the media-type based parse fails. * Updated RDF::Trine::Parser::RDFJSON to throw an error if input isn't valid JSON. * Added character decoding to RDF::Trine::Parser->parse_url_into_model. Version 0.122 (2010-05-05) * Added RDF::Trine::Model::bounded_description method. * Added initial implementation of a Redland-based storage class. * Fixed SPARQL store tests to align with recent coverage efforts. * Code cleanup and updates to improve test coverage. * Rearranged POD in RDF::Trine::Parser. * Fixed type in RDF::Trine::Node::Literal::_compare. Version 0.121 (2010-04-29) * Fixed URI qname code to disallow ':' in local name. * Added node-centric methods to RDF::Trine::Model: subjects, predicates, objects. * Improved POD for value canonicalization in RDF::Trine::Parser. * Added POD for RDF::Trine::Model::get_contexts. * Added POD details to RDF::Trine::Model::get_statements regarding triple and quad semantics. Version 0.120 (2010-04-20) * Added optional value canonicalization on parsing (xsd integer, decimal, and boolean). * RDF/XML parser now attempts to canonicalize XMLLiterals (doesn't yet canonicalize all XMLLiterals that it shold). * Added RDF::Trine::Node::Blank::_new constructor that doesn't validate bnode name for N-Triples conformance. * Performance improvements to RDF::Trine::Node::_unicode_escape. * Updated Turtle parser to throw error on undeclared namespace prefixes. * Updated Turtle serializer to produce QName literal datatypes. Version 0.119 (2010-04-15) * Fixed bug in NTriples parser handling of language literals (reported by tobyink). * Fixed another bug in turtle serializer that improperly serialized bnode objects 'belonging' to a parent triple (in-edge count of 1). Version 0.118 (2010-03-22) * Added RDF::Trine::Parser::TriG. * Added RDF::Trine::Parser::parse_file_into_model method. * Added RDF::Trine::Serializer::NQuads. * Added RDF::Trine::Serializer::negotiate constructor. * Added RDF::Trine::Serializer::new constructor based on requested serializer name. * Added RDF::Trine::Exporter::CSV for serializing variable bindings. * Added Text::CSV and HTTP::Negotiate to RDF::Trine prereq list. * Fixed exception thrown on unrecognized parser name. * Removed dependency list and added perlrdf link to POD in RDF::Trine and RDF::Query. * Updated RDF::Trine::Serializer::Turtle->new API to take %args instead of \%namespaces. * Updated RDF::Trine::Serializer::RDFXML to take %args and properly accept and serialize xmlns namespaces. * Updated RDF::Trine::Parser::RDFa to use streaming parsing (instead of materializing the graph first). * Updated RDF::Trine::Model::_debug to use quad semantics when getting statement iterator. * Updated t/parser-turtle.t to use File::Glob::bsd_glob for cases where the test directory's path contains whitespace. * Removed redundant parse_into_model methods from RDF::Trine::Parser subclasses. * Renamed examples/create_store.pl to examples/foaf_labels.pl. * Fixed bug in turtle serializer that improperly serialized bnode objects 'belonging' to a parent bnode. Version 0.117 (2010-02-04) * Fixed bug in RDF::Trine::Iterator::Bindings::as_json when using empty iterator. Version 0.116 (2010-01-31) * Fixed bug in RDF::Trine::Serializer::RDFXML when serializing empty models. Version 0.115 (2010-01-30) * Added N-Triples and N-Quads parsers. * Added RDF::Trine::Store::SPARQL::get_pattern implementation. * Changed RDF::Trine::Model::objects_for_predicate_list to return only a single node in scalar context. * Added table alias for COUNT(*) queries in RDF::Trine::Store::DBI (fix for mysql). * Added example of using parse_url_into_model to RDF::Trine::Parser SYNOPSIS. 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-2010 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