RedlandSerializer Class Reference
| Inherits from | RedlandWrappedObject : NSObject |
| Declared in | RedlandSerializer.h RedlandSerializer.m |
Overview
A serializer turns a RedlandModel into a serialized format like RDF/XML or NTriples.
Wraps librdf_serializer. It seems you should use a new serializer for every model that you want to serialize because of namespace caching (see issue #18 on redland’s bugtracker: http://bugs.librdf.org/mantis/view.php?id=18))
A category to add convenience methods to the Redland serializer.
RedlandSerializer(Convenience)
Tasks
Other Methods
-
+ serializerWithName:Returns an autoreleased RedlandSerializer initialized using initWithName:.
-
+ serializerWithName:mimeType:typeURI:Convenience method which returns an autoreleased RedlandSerializer initialized using initWithName:mimeType:typeURI:.
-
– initWithName:Initializes a RedlandSerializer with the given name.
-
– initWithName:mimeType:typeURI:Creates and returns a RedlandSerializer identified by either a name, a MIME type, or a type URI.
-
– wrappedSerializerReturns the underlying librdf_serializer of the receiver.
-
– serializeModel:toFileName:withBaseURI:Serializes a model to a file with the specified name.
-
– serializeModel:toFile:withBaseURI:Serializes a model to a C file handle.
-
– serializeModel:toFileHandle:withBaseURI:Serializes a model to the given NSFileHandle.
-
– setPrefix:forNamespaceURI:Sets a namespace/URI prefix mapping.
-
– valueOfFeature:Returns the value of the serializer feature identified by featureURI.
-
– setValue:ofFeature:Sets the serializer feature identified by featureURI to a new value.
NamespaceConvenience Methods
-
– addNamespace:Adds the URI-to-prefix mapping of the specified namespace to the receiver.
Convenience Methods
-
– serializedStringFromModel:withBaseURI:Returns a serialized string representation of a model using the given base URI.
-
– serializedDataFromModel:withBaseURI:Returns a serialized data representation of a model using the given base URI.
Class Methods
serializerWithName:
Returns an autoreleased RedlandSerializer initialized using initWithName:.
+ (id)serializerWithName:(NSString *)factoryNameParameters
- factoryName
The name for the serializer; use one of our Redland…SerializerName constants
Return Value
A new RedlandSerializer instance
Discussion
Returns an autoreleased RedlandSerializer initialized using initWithName:.
Declared In
RedlandSerializer.mserializerWithName:mimeType:typeURI:
Convenience method which returns an autoreleased RedlandSerializer initialized using initWithName:mimeType:typeURI:.
+ (id)serializerWithName:(NSString *)factoryName mimeType:(NSString *)mimeType typeURI:(RedlandURI *)typeURIParameters
- factoryName
The name for the serializer; use one of our Redland…SerializerName constants
- mimeType
The mime-type the serializer should produce
- typeURI
type URI for the type of serialization
Return Value
A new RedlandSerializer instance
Discussion
Convenience method which returns an autoreleased RedlandSerializer initialized using initWithName:mimeType:typeURI:.
Declared In
RedlandSerializer.mInstance Methods
addNamespace:
Adds the URI-to-prefix mapping of the specified namespace to the receiver.
- (void)addNamespace:(RedlandNamespace *)aNamespaceDiscussion
Adds the URI-to-prefix mapping of the specified namespace to the receiver.
Declared In
RedlandNamespace.minitWithName:
Initializes a RedlandSerializer with the given name.
- (id)initWithName:(NSString *)factoryNameParameters
- factoryName
The name for the serializer; use one of our Redland…SerializerName constants
Return Value
A new RedlandSerializer instance
Discussion
Initializes a RedlandSerializer with the given name.
Declared In
RedlandSerializer.minitWithName:mimeType:typeURI:
Creates and returns a RedlandSerializer identified by either a name, a MIME type, or a type URI.
- (id)initWithName:(NSString *)factoryName mimeType:(NSString *)mimeType typeURI:(RedlandURI *)typeURIParameters
- factoryName
The name for the serializer; use one of our Redland…SerializerName constants
- mimeType
The mime-type the serializer should produce
- typeURI
type URI for the type of serialization
Return Value
A new RedlandSerializer instance
Discussion
Creates and returns a RedlandSerializer identified by either a name, a MIME type, or a type URI.
Declared In
RedlandSerializer.mserializeModel:toFile:withBaseURI:
Serializes a model to a C file handle.
- (void)serializeModel:(RedlandModel *)aModel toFile:(FILE *)file withBaseURI:(RedlandURI *)aURIParameters
- aModel
The model (RedlandModel instance) to serialize
- file
the C file handle
- aURI
The base-URI to use as RedlandURI
Discussion
Serializes a model to a C file handle.
Declared In
RedlandSerializer.mserializeModel:toFileHandle:withBaseURI:
Serializes a model to the given NSFileHandle.
- (void)serializeModel:(RedlandModel *)aModel toFileHandle:(NSFileHandle *)fileHandle withBaseURI:(RedlandURI *)aURIParameters
- aModel
The model (RedlandModel instance) to serialize
- fileHandle
the filehandle as NSFileHandle to write to
- aURI
The base-URI to use as RedlandURI
Discussion
Serializes a model to the given NSFileHandle.
Declared In
RedlandSerializer.mserializeModel:toFileName:withBaseURI:
Serializes a model to a file with the specified name.
- (void)serializeModel:(RedlandModel *)aModel toFileName:(NSString *)fileName withBaseURI:(RedlandURI *)aURIParameters
- aModel
The model (RedlandModel instance) to serialize
- fileName
the filename to write to as NSString
- aURI
The base-URI to use as RedlandURI
Discussion
Serializes a model to a file with the specified name.
Declared In
RedlandSerializer.mserializedDataFromModel:withBaseURI:
Returns a serialized data representation of a model using the given base URI.
- (NSData *)serializedDataFromModel:(RedlandModel *)aModel withBaseURI:(RedlandURI *)baseURIParameters
- aModel
The model (RedlandModel instance) to serialize
- baseURI
The base-URI to use as RedlandURI
Return Value
NSData
Discussion
Returns a serialized data representation of a model using the given base URI.
Declared In
RedlandSerializer.mserializedStringFromModel:withBaseURI:
Returns a serialized string representation of a model using the given base URI.
- (NSString *)serializedStringFromModel:(RedlandModel *)aModel withBaseURI:(RedlandURI *)baseURIParameters
- aModel
The model (RedlandModel instance) to serialize
- baseURI
The base-URI to use as RedlandURI
Return Value
An NSString
Discussion
Returns a serialized string representation of a model using the given base URI.
Declared In
RedlandSerializer.msetPrefix:forNamespaceURI:
Sets a namespace/URI prefix mapping.
- (void)setPrefix:(NSString *)aPrefix forNamespaceURI:(RedlandURI *)uriDiscussion
Sets a namespace/URI prefix mapping.
Declared In
RedlandSerializer.msetValue:ofFeature:
Sets the serializer 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 serializer feature identified by featureURI to a new value.
Warning: Raises a RedlandException is no such feature exists.
Declared In
RedlandSerializer.mvalueOfFeature:
Returns the value of the serializer feature identified by featureURI.
- (RedlandNode *)valueOfFeature:(id)featureURIParameters
- featureURI
An NSString or a RedlandURI instance
Discussion
Returns the value of the serializer feature identified by featureURI.
Declared In
RedlandSerializer.m