[redland-dev] Re: Raptor Parser Serializer Query

Dave Beckett dave.beckett at bristol.ac.uk
Mon Jul 25 14:04:51 BST 2005


On Thu, 2005-07-21 at 22:51 -0400, Vinay Solanki wrote:
> Dear Dave,
> 
>  Thank you, your raptor parser is working excellent, well i have
> implemented statement_handlers, error_handlers and warning_handlers.
> 
> 1) But I don't know for what is the STRICT MODE used for parser?.

It enables strict conformance to the rdf/xml spec.  The default is lax
and allows a bunch of things without error, but maybe with warning -
such as daml:Collection parseType (instead of Collection), rdf:bagID and
some others.

> 2) Even though I set the FEATURE - RAPTOR_FEATURE_ALLOW_BAGID - it is
> giving warning when serialzing the rdf:BagID element?

It probably does.  rdf;bagID is obsolete.

> 3) Serializer: Parser generates set of triples in string or URI form. What
> kind of input should i give to Serializer-- from a file or triples.

Triples.  rdfdump.c shows you how. The manual
http://librdf.org/raptor/libraptor.html
says:

int raptor_serialize_statement(raptor_serializer* rdf_serializer, const
raptor_statement *statement)

Serialize a single statement using
the serializer.


> 4) raptor_serialize_start_to_file_handle() - how does this work, it writes
> the RDF syntax form to stdout or also to a file. what is the base_uri i
> should give as the input for serialization?

it writes the syntax being serialized to a C FILE* handle.  See
rdfdump.c for an example.

It's the URI to use when calculating how to write relative URIs in the
output.  If you give a base URI, the output URIs may be relative to it.
Only some syntaxes allow this (e.g. rdf/xml).  Some don't (e.g
ntriples).

Dave




More information about the redland-dev mailing list