RedlandNode Class Reference
Inherits from | RedlandWrappedObject : NSObject |
Conforms to | NSCoding NSCopying |
Declared in | RedlandNode.h RedlandNode.m |
Overview
A RedlandNode represents a single node in an RDF graph.
The different node types are:
- Resource: A node representing a resource which is identified by a URI.
- Blank: A node which represents an anonymous resource. The node is identified by a blank node ID.
- Literal: A node representing a literal value in form of a string.
Defines various convenience methods for RedlandNode objects.
Tasks
Other Methods
-
+ nodeWithLiteral:
The literal string
-
– initWithLiteral:language:type:
Initializes a new RedlandLiteralNode, with either a language or a datatype URI.
-
+ nodeWithLiteral:language:isXML:
The literal string
-
– initWithLiteral:language:isXML:
Initializes a new RedlandLiteralNode containing a literal with an optional language and XML flag.
-
+ nodeWithURIString:
The URI as a string value.
-
– initWithURIString:
Initializes a new RedlandResourceNode representing a resource with the given URI.
-
+ nodeWithURI:
an autoreleased RedlandResourceNode representing a resource with the given URI.
-
– initWithURI:
Initializes a RedlandResourceNode representing a resource with the given URI.
-
+ nodeWithBlankID:
The blank node ID. If nil, a new ID is generated.
-
– initWithBlankID:
Initializes a blank RedlandNode with the specified node ID.
-
– wrappedNode
the underlying librdf_node object of the receiver.
-
– type
Returns the node type of the receiver.
-
– isLiteral
YES if the receiver is a literal node
-
– isResource
YES if the receiver is a resource (i.e. if it has a URI)
-
– isBlank
YES if the receiver is a blank node.
-
– isXML
YES if the receiver is a literal node and contains well-formed XML data.
-
– literalDataType
the literal datatype URI of the receiver (literal nodes only).
-
– literalValue
Hello World
-
– literalLanguage
the XML language of the receiver (literal nodes only).
-
– URIValue
the resource of the receiver as an RedlandURI object (resource nodes only).
-
– blankID
the blank node ID of the receiver (blank nodes only).
-
– ordinalValue
the ordinal value of the reciever (for rdf:li nodes).
-
– isEqualToNode:
The node to compare the receiver to
Other Methods
-
– init
The “init” initializer redirects to “initWithBlankID:” which creates a blank node with a generated id.
Convenience Methods
-
+ typeNode
A node representing the type, i.e. “a” or “rdf:type” or “http://www.w3.org/1999/02/22-rdf-syntax-ns#type”.
-
+ nodeWithURL:
Creates and returns a RedlandNode of type resource with the given URL.
-
+ nodeWithLiteralInt:
Creates and returns a typed literal RedlandNode with the given int value and a datatype URI of http://www.w3.org/2001/XMLSchema#int.
-
+ nodeWithLiteralFloat:
Creates and returns a typed literal RedlandNode with the given float value and a datatype URI of http://www.w3.org/2001/XMLSchema#float.
-
+ nodeWithLiteralDouble:
Creates and returns a typed literal RedlandNode with the given double value and a datatype URI of http://www.w3.org/2001/XMLSchema#double.
-
+ nodeWithLiteralBool:
Creates and returns a typed literal RedlandNode with the given boolean value and a datatype URI of http://www.w3.org/2001/XMLSchema#boolean.
-
+ nodeWithLiteralString:language:
Creates and returns a typed literal RedlandNode with the given string value and a datatype URI of http://www.w3.org/2001/XMLSchema#string.
-
+ nodeWithLiteralDateTime:
Creates and returns a typed literal RedlandNode with the given NSDate value and a datatype URI of http://www.w3.org/2001/XMLSchema#dateTime.
-
+ nodeWithObject:
Creates and returns a RedlandNode by sending
nodeValue
to the given object. -
– intValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#int. (Note: This method should probably allow other integer-compatible datatypes as well…)
-
– floatValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#float.
-
– doubleValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#double.
-
– boolValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#boolean.
-
– stringValue
If you just want the literal value, no matter what datatype, use literalValue.
-
– URIStringValue
the URI of the receiver (which must be a resource node) as a string value.
-
– URLValue
the URI of the receiver (which must be a resource node) as an NSURL.
-
– dateTimeValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#dateTime.
-
– nodeValue
the receiver.
-
+ dateTimeFormatter
NSDateFormatter that can convert dates into ISO date strings and vice versa
Class Methods
dateTimeFormatter
NSDateFormatter that can convert dates into ISO date strings and vice versa
+ (NSDateFormatter *)dateTimeFormatter
Return Value
NSDateFormatter that can convert dates into ISO date strings and vice versa
Declared In
RedlandNode-Convenience.m
nodeWithBlankID:
The blank node ID. If nil, a new ID is generated.
+ (id)nodeWithBlankID:(NSString *)anID
Parameters
- anID
The blank node ID. If nil, a new ID is generated.
Return Value
an autoreleased RedlandNode with the specified node ID.
Declared In
RedlandNode.m
nodeWithLiteral:
The literal string
+ (id)nodeWithLiteral:(NSString *)aString
Parameters
- aString
The literal string
Return Value
a RedlandNode of the literal type with the given string value. No language or datatype are specified.
Declared In
RedlandNode.m
nodeWithLiteral:language:isXML:
The literal string
+ (id)nodeWithLiteral:(NSString *)aString language:(NSString *)aLanguage isXML:(BOOL)xmlFlag
Parameters
- aString
The literal string
- aLanguage
The language of the literal string (will be nil if xmLFlag is YES)
- xmlFlag
If YES, the node is marked as containing well-formed XML data and aLanguage is being ignored
Return Value
a RedlandLiteralNode containing a literal with an an optional language and XML flag.
Declared In
RedlandNode.m
nodeWithLiteralBool:
Creates and returns a typed literal RedlandNode with the given boolean value and a datatype URI of http://www.w3.org/2001/XMLSchema#boolean.
+ (RedlandNode *)nodeWithLiteralBool:(BOOL)aBool
Discussion
Creates and returns a typed literal RedlandNode with the given boolean value and a datatype URI of http://www.w3.org/2001/XMLSchema#boolean.
Declared In
RedlandNode-Convenience.m
nodeWithLiteralDateTime:
Creates and returns a typed literal RedlandNode with the given NSDate value and a datatype URI of http://www.w3.org/2001/XMLSchema#dateTime.
+ (RedlandNode *)nodeWithLiteralDateTime:(NSDate *)aDate
Discussion
Creates and returns a typed literal RedlandNode with the given NSDate value and a datatype URI of http://www.w3.org/2001/XMLSchema#dateTime.
Declared In
RedlandNode-Convenience.m
nodeWithLiteralDouble:
Creates and returns a typed literal RedlandNode with the given double value and a datatype URI of http://www.w3.org/2001/XMLSchema#double.
+ (RedlandNode *)nodeWithLiteralDouble:(double)aDouble
Discussion
Creates and returns a typed literal RedlandNode with the given double value and a datatype URI of http://www.w3.org/2001/XMLSchema#double.
Declared In
RedlandNode-Convenience.m
nodeWithLiteralFloat:
Creates and returns a typed literal RedlandNode with the given float value and a datatype URI of http://www.w3.org/2001/XMLSchema#float.
+ (RedlandNode *)nodeWithLiteralFloat:(float)aFloat
Discussion
Creates and returns a typed literal RedlandNode with the given float value and a datatype URI of http://www.w3.org/2001/XMLSchema#float.
Declared In
RedlandNode-Convenience.m
nodeWithLiteralInt:
Creates and returns a typed literal RedlandNode with the given int value and a datatype URI of http://www.w3.org/2001/XMLSchema#int.
+ (RedlandNode *)nodeWithLiteralInt:(int)anInt
Discussion
Creates and returns a typed literal RedlandNode with the given int value and a datatype URI of http://www.w3.org/2001/XMLSchema#int.
Declared In
RedlandNode-Convenience.m
nodeWithLiteralString:language:
Creates and returns a typed literal RedlandNode with the given string value and a datatype URI of http://www.w3.org/2001/XMLSchema#string.
+ (RedlandNode *)nodeWithLiteralString:(NSString *)aString language:(NSString *)aLanguage
Discussion
Creates and returns a typed literal RedlandNode with the given string value and a datatype URI of http://www.w3.org/2001/XMLSchema#string.
Declared In
RedlandNode-Convenience.m
nodeWithObject:
Creates and returns a RedlandNode by sending nodeValue
to the given object.
+ (RedlandNode *)nodeWithObject:(id)object
Discussion
Creates and returns a RedlandNode by sending nodeValue
to the given object.
Warning: Raises a RedlandException if the object does not respond to the nodeValue
selector.
Declared In
RedlandNode-Convenience.m
nodeWithURI:
an autoreleased RedlandResourceNode representing a resource with the given URI.
+ (id)nodeWithURI:(RedlandURI *)aURI
Parameters
- aURI
The URI as a RedlandURI.
Return Value
an autoreleased RedlandResourceNode representing a resource with the given URI.
Declared In
RedlandNode.m
nodeWithURIString:
The URI as a string value.
+ (id)nodeWithURIString:(NSString *)aString
Parameters
- aString
The URI as a string value.
Return Value
a RedlandResourceNode representing a resource with the given URI.
Declared In
RedlandNode.m
nodeWithURL:
Creates and returns a RedlandNode of type resource with the given URL.
+ (RedlandNode *)nodeWithURL:(NSURL *)aURL
Discussion
Creates and returns a RedlandNode of type resource with the given URL.
Declared In
RedlandNode-Convenience.m
typeNode
A node representing the type, i.e. “a” or “rdf:type” or “http://www.w3.org/1999/02/22-rdf-syntax-ns#type”.
+ (RedlandNode *)typeNode
Discussion
A node representing the type, i.e. “a” or “rdf:type” or “http://www.w3.org/1999/02/22-rdf-syntax-ns#type”.
Declared In
RedlandNode-Convenience.m
Instance Methods
URIStringValue
the URI of the receiver (which must be a resource node) as a string value.
- (NSString *)URIStringValue
Return Value
the URI of the receiver (which must be a resource node) as a string value.
Declared In
RedlandNode-Convenience.m
URIValue
the resource of the receiver as an RedlandURI object (resource nodes only).
- (RedlandURI *)URIValue
Return Value
the resource of the receiver as an RedlandURI object (resource nodes only).
Declared In
RedlandNode.m
URLValue
the URI of the receiver (which must be a resource node) as an NSURL.
- (NSURL *)URLValue
Return Value
the URI of the receiver (which must be a resource node) as an NSURL.
Declared In
RedlandNode-Convenience.m
blankID
the blank node ID of the receiver (blank nodes only).
- (NSString *)blankID
Return Value
the blank node ID of the receiver (blank nodes only).
Declared In
RedlandNode.m
boolValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#boolean.
- (BOOL)boolValue
Return Value
the literal boolean value of the receiver.
Discussion
Warning: Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#boolean.
Declared In
RedlandNode-Convenience.m
dateTimeValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#dateTime.
- (NSDate *)dateTimeValue
Return Value
the literal dateTime value of the receiver.
Discussion
Warning: Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#dateTime.
Declared In
RedlandNode-Convenience.m
doubleValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#double.
- (double)doubleValue
Return Value
the literal double value of the receiver.
Discussion
Warning: Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#double.
Declared In
RedlandNode-Convenience.m
floatValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#float.
- (float)floatValue
Return Value
the literal float value of the receiver.
Discussion
Warning: Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#float.
Declared In
RedlandNode-Convenience.m
init
The “init” initializer redirects to “initWithBlankID:” which creates a blank node with a generated id.
- (id)init
Return Value
A RedlandNode of the blank type
Discussion
The “init” initializer redirects to “initWithBlankID:” which creates a blank node with a generated id.
Declared In
RedlandNode.m
initWithBlankID:
Initializes a blank RedlandNode with the specified node ID.
- (id)initWithBlankID:(NSString *)anID
Parameters
- anID
The blank node ID. If nil, a new ID is generated.
Discussion
Initializes a blank RedlandNode with the specified node ID.
Declared In
RedlandNode.m
initWithLiteral:language:isXML:
Initializes a new RedlandLiteralNode containing a literal with an optional language and XML flag.
- (id)initWithLiteral:(NSString *)aString language:(NSString *)aLanguage isXML:(BOOL)xmlFlag
Parameters
- aString
The literal string
- aLanguage
The language of the literal string (will be nil if xmLFlag is YES)
- xmlFlag
If YES, the node is marked as containing well-formed XML data and aLanguage is being ignored
Discussion
Initializes a new RedlandLiteralNode containing a literal with an optional language and XML flag.
Declared In
RedlandNode.m
initWithLiteral:language:type:
Initializes a new RedlandLiteralNode, with either a language or a datatype URI.
- (id)initWithLiteral:(NSString *)aString language:(NSString *)aLanguage type:(RedlandURI *)typeURI
Parameters
- aString
The literal string
- aLanguage
The language of the literal string (ignored if typeURI is present)
- typeURI
The datatype URI (sets aLanguage to nil if present)
Discussion
Initializes a new RedlandLiteralNode, with either a language or a datatype URI.
Declared In
RedlandNode.m
initWithURI:
Initializes a RedlandResourceNode representing a resource with the given URI.
- (id)initWithURI:(RedlandURI *)aURI
Parameters
- aURI
The URI as a RedlandURI.
Discussion
Initializes a RedlandResourceNode representing a resource with the given URI.
Declared In
RedlandNode.m
initWithURIString:
Initializes a new RedlandResourceNode representing a resource with the given URI.
- (id)initWithURIString:(NSString *)aString
Parameters
- aString
The URI as a string value.
Discussion
Initializes a new RedlandResourceNode representing a resource with the given URI.
Declared In
RedlandNode.m
intValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#int. (Note: This method should probably allow other integer-compatible datatypes as well…)
- (int)intValue
Return Value
the literal integer value of the receiver.
Discussion
Warning: Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#int. (Note: This method should probably allow other integer-compatible datatypes as well…)
Declared In
RedlandNode-Convenience.m
isBlank
YES if the receiver is a blank node.
- (BOOL)isBlank
Return Value
YES if the receiver is a blank node.
Declared In
RedlandNode.m
isEqualToNode:
The node to compare the receiver to
- (BOOL)isEqualToNode:(RedlandNode *)otherNode
Parameters
- otherNode
The node to compare the receiver to
Return Value
YES if the receiver is equal to otherNode.
Declared In
RedlandNode.m
isLiteral
YES if the receiver is a literal node
- (BOOL)isLiteral
Return Value
YES if the receiver is a literal node
Declared In
RedlandNode.m
isResource
YES if the receiver is a resource (i.e. if it has a URI)
- (BOOL)isResource
Return Value
YES if the receiver is a resource (i.e. if it has a URI)
Declared In
RedlandNode.m
isXML
YES if the receiver is a literal node and contains well-formed XML data.
- (BOOL)isXML
Return Value
YES if the receiver is a literal node and contains well-formed XML data.
Declared In
RedlandNode.m
literalDataType
the literal datatype URI of the receiver (literal nodes only).
- (RedlandURI *)literalDataType
Return Value
the literal datatype URI of the receiver (literal nodes only).
Declared In
RedlandNode.m
literalLanguage
the XML language of the receiver (literal nodes only).
- (NSString *)literalLanguage
Return Value
the XML language of the receiver (literal nodes only).
Declared In
RedlandNode.m
literalValue
Hello World
- (NSString *)literalValue
Return Value
the literal value of the receiver (literal nodes only).
Discussion
Hello World
Declared In
RedlandNode.m
nodeValue
the receiver.
- (RedlandNode *)nodeValue
Return Value
the receiver.
Declared In
RedlandNode-Convenience.m
ordinalValue
the ordinal value of the reciever (for rdf:li nodes).
- (int)ordinalValue
Return Value
the ordinal value of the reciever (for rdf:li nodes).
Declared In
RedlandNode.m
stringValue
If you just want the literal value, no matter what datatype, use literalValue.
- (NSString *)stringValue
Return Value
the literal string value of the receiver.
Discussion
If you just want the literal value, no matter what datatype, use literalValue.
Warning: Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#string.
Declared In
RedlandNode-Convenience.m