Inherits from RedlandWrappedObject : NSObject
Declared in RedlandParser.h
RedlandParser.m

Overview

This class parses various RDF serializations (RDF/XML, NTriples, Turtle) into either a RedlandStream or directly into a RedlandModel, wraps librdf_parser.

Tasks

Class Methods

parserWithName:

Returns an autoreleased RedlandParser of the given type.

+ (RedlandParser *)parserWithName:(NSString *)aName

Parameters

aName

The name of the parser to use; use one of the constants

Return Value

A new RedlandParser instance

Discussion

Returns an autoreleased RedlandParser of the given type.

Declared In

RedlandParser.m

parserWithName:mimeType:syntaxURI:

Returns an autoreleased RedlandParser initialized using initWithName:mimeType:syntaxURI:.

+ (RedlandParser *)parserWithName:(NSString *)aName mimeType:(NSString *)mimeType syntaxURI:(RedlandURI *)uri

Parameters

aName

The name of the parser to use; use one of the constants

mimeType

The mime-type the parser should produce

uri

The syntax-URI the parser should use; see our constants

Return Value

A new RedlandParser instance

Discussion

Returns an autoreleased RedlandParser initialized using initWithName:mimeType:syntaxURI:.

Declared In

RedlandParser.m

Instance Methods

initWithName:

Initializes a new RedlandParser of the given type.

- (id)initWithName:(NSString *)aName

Parameters

aName

The name of the parser to use; use one of the constants

Return Value

A new RedlandParser instance

Discussion

Initializes a new RedlandParser of the given type.

Declared In

RedlandParser.m

initWithName:mimeType:syntaxURI:

The designated initializer.

- (id)initWithName:(NSString *)aName mimeType:(NSString *)mimeType syntaxURI:(RedlandURI *)uri

Parameters

aName

The name of the parser to use; use one of the constants

mimeType

The mime-type the parser should produce

uri

The syntax-URI the parser should use; see our constants

Return Value

A new RedlandParser instance

Discussion

The designated initializer.

Returns a new RedlandParser which can be identified either by name (see the Redland…ParserName constants), mimeType (e.g. “application/rdf+xml”), or by syntaxURI. Defaults to a RDF+XML parser.

Declared In

RedlandParser.m

parseData:asStreamWithBaseURI:

Tries to parse data using the given base URI and returns a RedlandStream of statements.

- (RedlandStream *)parseData:(NSData *)data asStreamWithBaseURI:(RedlandURI *)baseURI

Parameters

data

The data to parse as NSData

baseURI

The base URI

Discussion

Tries to parse data using the given base URI and returns a RedlandStream of statements.

Warning: Raises a RedlandException if there is a parse error.

Declared In

RedlandParser.m

parseData:intoModel:withBaseURI:

Tries to parse data into a model using the given base URI.

- (void)parseData:(NSData *)data intoModel:(RedlandModel *)aModel withBaseURI:(RedlandURI *)baseURI

Parameters

data

The data to parse as NSData

aModel

The model to parse into; required

baseURI

The base URI

Discussion

Tries to parse data into a model using the given base URI.

Warning: Raises a RedlandException if there is a parse error.

Declared In

RedlandParser.m

parseString:asStreamWithBaseURI:

Tries to parse the specified string using baseURI as the base URI and returns a RedlandStream of statements.

- (RedlandStream *)parseString:(NSString *)aString asStreamWithBaseURI:(RedlandURI *)uri

Parameters

aString

The string to parse

uri

The base URI

Return Value

A RedlandStream instance

Discussion

Tries to parse the specified string using baseURI as the base URI and returns a RedlandStream of statements.

Warning: Raises a RedlandException if there is a parse error.

Declared In

RedlandParser.m

parseString:intoModel:withBaseURI:

Tries to parse the specified string into aModel using baseURI as the base URI.

- (void)parseString:(NSString *)aString intoModel:(RedlandModel *)aModel withBaseURI:(RedlandURI *)uri

Parameters

aString

The string to parse

aModel

The model to parse into; required

uri

The base URI

Discussion

Tries to parse the specified string into aModel using baseURI as the base URI.

Warning: Raises a RedlandException if there is a parse error or if “aModel” or “uri” is missing.

Declared In

RedlandParser.m

setValue:ofFeature:

Sets the parser feature identified by featureURI to a new value.

- (void)setValue:(RedlandNode *)featureValue ofFeature:(id)featureURI

Parameters

featureValue

A RedlandNode representing the new value

featureURI

An NSString or a RedlandURI instance

Discussion

Sets the parser feature identified by featureURI to a new value.

Warning: Raises a RedlandException is no such feature exists.

Declared In

RedlandParser.m

valueOfFeature:

Returns the value of the parser feature identified by featureURI.

- (RedlandNode *)valueOfFeature:(id)featureURI

Parameters

featureURI

An NSString or a RedlandURI instance

Discussion

Returns the value of the parser feature identified by featureURI.

Declared In

RedlandParser.m

wrappedParser

Returns the underlying librdf_parser object of the receiver.

- (librdf_parser *)wrappedParser

Return Value

A librdf_parser struct

Discussion

Returns the underlying librdf_parser object of the receiver.

Declared In

RedlandParser.m