org.openrdf.model
Interface ValueFactory

All Known Implementing Classes:
MemValueFactory, RdbmsValueFactory, ValueFactoryBase, ValueFactoryImpl, ValueStore

public interface ValueFactory

A factory for creating URIs, blank nodes, literals and statements.

Author:
Arjohn Kampman

Method Summary
 BNode createBNode()
          Creates a new bNode.
 BNode createBNode(String nodeID)
          Creates a new blank node with the given node identifier.
 Literal createLiteral(boolean value)
          Creates a new xsd:boolean-typed literal representing the specified value.
 Literal createLiteral(byte value)
          Creates a new xsd:byte-typed literal representing the specified value.
 Literal createLiteral(double value)
          Creates a new xsd:double-typed literal representing the specified value.
 Literal createLiteral(float value)
          Creates a new xsd:float-typed literal representing the specified value.
 Literal createLiteral(int value)
          Creates a new xsd:int-typed literal representing the specified value.
 Literal createLiteral(long value)
          Creates a new xsd:long-typed literal representing the specified value.
 Literal createLiteral(short value)
          Creates a new xsd:short-typed literal representing the specified value.
 Literal createLiteral(String label)
          Creates a new literal with the supplied label.
 Literal createLiteral(String label, String language)
          Creates a new literal with the supplied label and language attribute.
 Literal createLiteral(String label, URI datatype)
          Creates a new literal with the supplied label and datatype.
 Literal createLiteral(XMLGregorianCalendar calendar)
          Creates a new literal representing the specified calendar that is typed using the appropriate XML Schema date/time datatype.
 Statement createStatement(Resource subject, URI predicate, Value object)
          Creates a new statement with the supplied subject, predicate and object.
 Statement createStatement(Resource subject, URI predicate, Value object, Resource context)
          Creates a new statement with the supplied subject, predicate and object and associated context.
 URI createURI(String uri)
          Creates a new URI from the supplied string-representation.
 URI createURI(String namespace, String localName)
          Creates a new URI from the supplied namespace and local name.
 

Method Detail

createURI

URI createURI(String uri)
Creates a new URI from the supplied string-representation.

Parameters:
uri - A string-representation of a URI.
Returns:
An object representing the URI.
Throws:
IlllegalArgumentException - If the supplied string does not resolve to a legal (absolute) URI.

createURI

URI createURI(String namespace,
              String localName)
Creates a new URI from the supplied namespace and local name. Calling this method is funtionally equivalent to calling createURI(namespace+localName), but allows the ValueFactory to reuse supplied namespace and local name strings whenever possible. Note that the values returned by URI.getNamespace() and URI.getLocalName() are not necessarily the same as the values that are supplied to this method.

Parameters:
namespace - The URI's namespace.
localName - The URI's local name.
Throws:
IllegalArgumentException - If the supplied namespace and localname do not resolve to a legal (absolute) URI.

createBNode

BNode createBNode()
Creates a new bNode.

Returns:
An object representing the bNode.

createBNode

BNode createBNode(String nodeID)
Creates a new blank node with the given node identifier.

Parameters:
nodeID - The blank node identifier.
Returns:
An object representing the blank node.

createLiteral

Literal createLiteral(String label)
Creates a new literal with the supplied label.

Parameters:
label - The literal's label.

createLiteral

Literal createLiteral(String label,
                      String language)
Creates a new literal with the supplied label and language attribute.

Parameters:
label - The literal's label.
language - The literal's language attribute, or null if the literal doesn't have a language.

createLiteral

Literal createLiteral(String label,
                      URI datatype)
Creates a new literal with the supplied label and datatype.

Parameters:
label - The literal's label.
datatype - The literal's datatype, or null if the literal doesn't have a datatype.

createLiteral

Literal createLiteral(boolean value)
Creates a new xsd:boolean-typed literal representing the specified value.

Parameters:
value - The value for the literal.
Returns:
An xsd:boolean-typed literal for the specified value.

createLiteral

Literal createLiteral(byte value)
Creates a new xsd:byte-typed literal representing the specified value.

Parameters:
value - The value for the literal.
Returns:
An xsd:byte-typed literal for the specified value.

createLiteral

Literal createLiteral(short value)
Creates a new xsd:short-typed literal representing the specified value.

Parameters:
value - The value for the literal.
Returns:
An xsd:short-typed literal for the specified value.

createLiteral

Literal createLiteral(int value)
Creates a new xsd:int-typed literal representing the specified value.

Parameters:
value - The value for the literal.
Returns:
An xsd:int-typed literal for the specified value.

createLiteral

Literal createLiteral(long value)
Creates a new xsd:long-typed literal representing the specified value.

Parameters:
value - The value for the literal.
Returns:
An xsd:long-typed literal for the specified value.

createLiteral

Literal createLiteral(float value)
Creates a new xsd:float-typed literal representing the specified value.

Parameters:
value - The value for the literal.
Returns:
An xsd:float-typed literal for the specified value.

createLiteral

Literal createLiteral(double value)
Creates a new xsd:double-typed literal representing the specified value.

Parameters:
value - The value for the literal.
Returns:
An xsd:double-typed literal for the specified value.

createLiteral

Literal createLiteral(XMLGregorianCalendar calendar)
Creates a new literal representing the specified calendar that is typed using the appropriate XML Schema date/time datatype.

Parameters:
calendar - The value for the literal.
Returns:
An typed literal for the specified calendar.

createStatement

Statement createStatement(Resource subject,
                          URI predicate,
                          Value object)
Creates a new statement with the supplied subject, predicate and object.

Parameters:
subject - The statement's subject.
predicate - The statement's predicate.
object - The statement's object.
Returns:
The created statement.

createStatement

Statement createStatement(Resource subject,
                          URI predicate,
                          Value object,
                          Resource context)
Creates a new statement with the supplied subject, predicate and object and associated context.

Parameters:
subject - The statement's subject.
predicate - The statement's predicate.
object - The statement's object.
context - The statement's context.
Returns:
The created statement.


Copyright © 2001-2008 Aduna. All Rights Reserved.