In order to implement RDF output for Wikibase, we need a low level RDF serialization library that supports at least RDF/XML and n-triples (and hopefully also N3 and/or Turtle). This can be a 3rd party library, or something we write ourselves.
The serialization interface shall be oriented towards streaming operation, that is, it should have methods for outputting a header (with namespace declarations, etc) and a footer as well as RDF statements. For convenient coding, the serialization should support a Turtle-style interface, something like this:
writeStatements( $subject, array( $predicate1 => $value1, $predicate2 => array( $x, $y, $z ), ) );
It should also support typed literals and localized string literals.