RedlandParser Class Reference
| 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
-
+ parserWithName:Returns an autoreleased RedlandParser of the given type.
-
+ parserWithName:mimeType:syntaxURI:Returns an autoreleased RedlandParser initialized using initWithName:mimeType:syntaxURI:.
-
– initWithName:Initializes a new RedlandParser of the given type.
-
– initWithName:mimeType:syntaxURI:The designated initializer.
-
– wrappedParserReturns the underlying librdf_parser object of the receiver.
-
– parseData:intoModel:withBaseURI:Tries to parse data into a model using the given base URI.
-
– parseData:asStreamWithBaseURI:Tries to parse data using the given base URI and returns a RedlandStream of statements.
-
– parseString:intoModel:withBaseURI:Tries to parse the specified string into aModel using baseURI as the base URI.
-
– parseString:asStreamWithBaseURI:Tries to parse the specified string using baseURI as the base URI and returns a RedlandStream of statements.
-
– valueOfFeature:Returns the value of the parser feature identified by featureURI.
-
– setValue:ofFeature:Sets the parser feature identified by featureURI to a new value.
Class Methods
parserWithName:
Returns an autoreleased RedlandParser of the given type.
+ (RedlandParser *)parserWithName:(NSString *)aNameParameters
- 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.mparserWithName:mimeType:syntaxURI:
Returns an autoreleased RedlandParser initialized using initWithName:mimeType:syntaxURI:.
+ (RedlandParser *)parserWithName:(NSString *)aName mimeType:(NSString *)mimeType syntaxURI:(RedlandURI *)uriParameters
- 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.mInstance Methods
initWithName:
Initializes a new RedlandParser of the given type.
- (id)initWithName:(NSString *)aNameParameters
- 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.minitWithName:mimeType:syntaxURI:
The designated initializer.
- (id)initWithName:(NSString *)aName mimeType:(NSString *)mimeType syntaxURI:(RedlandURI *)uriParameters
- 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.mparseData:asStreamWithBaseURI:
Tries to parse data using the given base URI and returns a RedlandStream of statements.
- (RedlandStream *)parseData:(NSData *)data asStreamWithBaseURI:(RedlandURI *)baseURIParameters
- 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.mparseData:intoModel:withBaseURI:
Tries to parse data into a model using the given base URI.
- (void)parseData:(NSData *)data intoModel:(RedlandModel *)aModel withBaseURI:(RedlandURI *)baseURIParameters
- 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.mparseString: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 *)uriParameters
- 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.mparseString: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 *)uriParameters
- 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.msetValue:ofFeature:
Sets the parser feature identified by featureURI to a new value.
- (void)setValue:(RedlandNode *)featureValue ofFeature:(id)featureURIParameters
- 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.mvalueOfFeature:
Returns the value of the parser feature identified by featureURI.
- (RedlandNode *)valueOfFeature:(id)featureURIParameters
- featureURI
An NSString or a RedlandURI instance
Discussion
Returns the value of the parser feature identified by featureURI.
Declared In
RedlandParser.m