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.
-
– wrappedNodethe underlying librdf_node object of the receiver.
-
– typeReturns the node type of the receiver.
-
– isLiteralYES if the receiver is a literal node
-
– isResourceYES if the receiver is a resource (i.e. if it has a URI)
-
– isBlankYES if the receiver is a blank node.
-
– isXMLYES if the receiver is a literal node and contains well-formed XML data.
-
– literalDataTypethe literal datatype URI of the receiver (literal nodes only).
-
– literalValueHello World
-
– literalLanguagethe XML language of the receiver (literal nodes only).
-
– URIValuethe resource of the receiver as an RedlandURI object (resource nodes only).
-
– blankIDthe blank node ID of the receiver (blank nodes only).
-
– ordinalValuethe ordinal value of the reciever (for rdf:li nodes).
-
– isEqualToNode:The node to compare the receiver to
Other Methods
-
– initThe “init” initializer redirects to “initWithBlankID:” which creates a blank node with a generated id.
Convenience Methods
-
+ typeNodeA 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
nodeValueto the given object. -
– intValueRaises 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…)
-
– floatValueRaises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#float.
-
– doubleValueRaises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#double.
-
– boolValueRaises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#boolean.
-
– stringValueIf you just want the literal value, no matter what datatype, use literalValue.
-
– URIStringValuethe URI of the receiver (which must be a resource node) as a string value.
-
– URLValuethe URI of the receiver (which must be a resource node) as an NSURL.
-
– dateTimeValueRaises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#dateTime.
-
– nodeValuethe receiver.
-
+ dateTimeFormatterNSDateFormatter 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 *)dateTimeFormatterReturn Value
NSDateFormatter that can convert dates into ISO date strings and vice versa
Declared In
RedlandNode-Convenience.mnodeWithBlankID:
The blank node ID. If nil, a new ID is generated.
+ (id)nodeWithBlankID:(NSString *)anIDParameters
- 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.mnodeWithLiteral:
The literal string
+ (id)nodeWithLiteral:(NSString *)aStringParameters
- 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.mnodeWithLiteral:language:isXML:
The literal string
+ (id)nodeWithLiteral:(NSString *)aString language:(NSString *)aLanguage isXML:(BOOL)xmlFlagParameters
- 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.mnodeWithLiteralBool:
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)aBoolDiscussion
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.mnodeWithLiteralDateTime:
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 *)aDateDiscussion
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.mnodeWithLiteralDouble:
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)aDoubleDiscussion
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.mnodeWithLiteralFloat:
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)aFloatDiscussion
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.mnodeWithLiteralInt:
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)anIntDiscussion
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.mnodeWithLiteralString: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 *)aLanguageDiscussion
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.mnodeWithObject:
Creates and returns a RedlandNode by sending nodeValue to the given object.
+ (RedlandNode *)nodeWithObject:(id)objectDiscussion
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.mnodeWithURI:
an autoreleased RedlandResourceNode representing a resource with the given URI.
+ (id)nodeWithURI:(RedlandURI *)aURIParameters
- aURI
The URI as a RedlandURI.
Return Value
an autoreleased RedlandResourceNode representing a resource with the given URI.
Declared In
RedlandNode.mnodeWithURIString:
The URI as a string value.
+ (id)nodeWithURIString:(NSString *)aStringParameters
- aString
The URI as a string value.
Return Value
a RedlandResourceNode representing a resource with the given URI.
Declared In
RedlandNode.mnodeWithURL:
Creates and returns a RedlandNode of type resource with the given URL.
+ (RedlandNode *)nodeWithURL:(NSURL *)aURLDiscussion
Creates and returns a RedlandNode of type resource with the given URL.
Declared In
RedlandNode-Convenience.mtypeNode
A node representing the type, i.e. “a” or “rdf:type” or “http://www.w3.org/1999/02/22-rdf-syntax-ns#type”.
+ (RedlandNode *)typeNodeDiscussion
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.mInstance Methods
URIStringValue
the URI of the receiver (which must be a resource node) as a string value.
- (NSString *)URIStringValueReturn Value
the URI of the receiver (which must be a resource node) as a string value.
Declared In
RedlandNode-Convenience.mURIValue
the resource of the receiver as an RedlandURI object (resource nodes only).
- (RedlandURI *)URIValueReturn Value
the resource of the receiver as an RedlandURI object (resource nodes only).
Declared In
RedlandNode.mURLValue
the URI of the receiver (which must be a resource node) as an NSURL.
- (NSURL *)URLValueReturn Value
the URI of the receiver (which must be a resource node) as an NSURL.
Declared In
RedlandNode-Convenience.mblankID
the blank node ID of the receiver (blank nodes only).
- (NSString *)blankIDReturn Value
the blank node ID of the receiver (blank nodes only).
Declared In
RedlandNode.mboolValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#boolean.
- (BOOL)boolValueReturn 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.mdateTimeValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#dateTime.
- (NSDate *)dateTimeValueReturn 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.mdoubleValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#double.
- (double)doubleValueReturn 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.mfloatValue
Raises a RedlandException if the datatype URI is not http://www.w3.org/2001/XMLSchema#float.
- (float)floatValueReturn 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.minit
The “init” initializer redirects to “initWithBlankID:” which creates a blank node with a generated id.
- (id)initReturn 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.minitWithBlankID:
Initializes a blank RedlandNode with the specified node ID.
- (id)initWithBlankID:(NSString *)anIDParameters
- 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.minitWithLiteral: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)xmlFlagParameters
- 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.minitWithLiteral:language:type:
Initializes a new RedlandLiteralNode, with either a language or a datatype URI.
- (id)initWithLiteral:(NSString *)aString language:(NSString *)aLanguage type:(RedlandURI *)typeURIParameters
- 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.minitWithURI:
Initializes a RedlandResourceNode representing a resource with the given URI.
- (id)initWithURI:(RedlandURI *)aURIParameters
- aURI
The URI as a RedlandURI.
Discussion
Initializes a RedlandResourceNode representing a resource with the given URI.
Declared In
RedlandNode.minitWithURIString:
Initializes a new RedlandResourceNode representing a resource with the given URI.
- (id)initWithURIString:(NSString *)aStringParameters
- aString
The URI as a string value.
Discussion
Initializes a new RedlandResourceNode representing a resource with the given URI.
Declared In
RedlandNode.mintValue
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)intValueReturn 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.misBlank
YES if the receiver is a blank node.
- (BOOL)isBlankReturn Value
YES if the receiver is a blank node.
Declared In
RedlandNode.misEqualToNode:
The node to compare the receiver to
- (BOOL)isEqualToNode:(RedlandNode *)otherNodeParameters
- otherNode
The node to compare the receiver to
Return Value
YES if the receiver is equal to otherNode.
Declared In
RedlandNode.misLiteral
YES if the receiver is a literal node
- (BOOL)isLiteralReturn Value
YES if the receiver is a literal node
Declared In
RedlandNode.misResource
YES if the receiver is a resource (i.e. if it has a URI)
- (BOOL)isResourceReturn Value
YES if the receiver is a resource (i.e. if it has a URI)
Declared In
RedlandNode.misXML
YES if the receiver is a literal node and contains well-formed XML data.
- (BOOL)isXMLReturn Value
YES if the receiver is a literal node and contains well-formed XML data.
Declared In
RedlandNode.mliteralDataType
the literal datatype URI of the receiver (literal nodes only).
- (RedlandURI *)literalDataTypeReturn Value
the literal datatype URI of the receiver (literal nodes only).
Declared In
RedlandNode.mliteralLanguage
the XML language of the receiver (literal nodes only).
- (NSString *)literalLanguageReturn Value
the XML language of the receiver (literal nodes only).
Declared In
RedlandNode.mliteralValue
Hello World
- (NSString *)literalValueReturn Value
the literal value of the receiver (literal nodes only).
Discussion
Hello World
Declared In
RedlandNode.mnodeValue
the receiver.
- (RedlandNode *)nodeValueReturn Value
the receiver.
Declared In
RedlandNode-Convenience.mordinalValue
the ordinal value of the reciever (for rdf:li nodes).
- (int)ordinalValueReturn Value
the ordinal value of the reciever (for rdf:li nodes).
Declared In
RedlandNode.mstringValue
If you just want the literal value, no matter what datatype, use literalValue.
- (NSString *)stringValueReturn 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