Class LibRDF_Parser

Description

A wrapper around the librdf_parser datatype.

Parsers can be used to particular type of serialized RDF into a LibRDF_Model or to simply convert the serialization into an iteration of LibRDF_Statement objects.

Located in /Parser.php (line 54)


	
			
Method Summary
void __construct ([string $name = NULL], [string $mime_type = NULL], [string $type_uri = NULL])
void __destruct ()
resource getParser ()
LibRDF_StreamIterator parseString (string $string, [string $base_uri = NULL])
LibRDF_StreamIterator parseURI (string $uri, [string $base_uri = NULL])
Methods
Constructor __construct (line 78)

Create a new parser.

Name is the type of parser. Common parsers are "rdfxml", "ntriples" and "turtle". If all arguments are NULL, any available parser for application/rdf+xml will be used.

  • access: public
  • throws: LibRDF_Error If unable to create a new parser
void __construct ([string $name = NULL], [string $mime_type = NULL], [string $type_uri = NULL])
  • string $name: The name of the parser to use
  • string $mime_type: The MIME type of the values to parse
  • string $type_uri: The URI of the RDF syntax to parse
Destructor __destruct (line 99)

Free the parser's resources.

  • access: public
void __destruct ()
getParser (line 115)

Return the underlying parser resource.

This function is intended for other LibRDF classes and shoult not be called.

  • return: The wrapper librdf_parser resource
  • access: public
resource getParser ()
parseString (line 132)

Parse a string and return an iterable object over the statements.

The object returned can be used in PHP foreach statements. It is not rewindable.

  • return: An iterator over the LibRDF_Statements parsed from the string
  • access: public
  • throws: LibRDF_Error If unable to parse the string
LibRDF_StreamIterator parseString (string $string, [string $base_uri = NULL])
  • string $string: The data to parse
  • string $base_uri: The value to use for xml:base abbreviations
parseURI (line 160)

Parse a URI and return an iterable object over the statements.

The object returned can be used in PHP foreach statements. It is not rewindable.

  • return: An iterator over the LibRDF_Statements parsed from $uri
  • access: public
  • throws: LibRDF_Error If unable to parse the URI
LibRDF_StreamIterator parseURI (string $uri, [string $base_uri = NULL])
  • string $uri: The URI to parse
  • string $base_uri: The value to use for the base URI if different from $uri

Documentation generated on Thu, 15 Jun 2006 19:25:13 -0400 by phpDocumentor 1.3.0