org.openrdf.model
Interface ValueFactory

All Known Implementing Classes:
AllegroGraph

public interface ValueFactory

A Factory for creating resources, bNodes and literals. The created object should all properly implement the equals(java.lang.Object) method.


Method Summary
 BNode createBNode()
          Creates a new bNode.
 BNode createBNode(java.lang.String nodeId)
          creates a new bNode with the given node identifier.
 Literal createLiteral(java.lang.String value)
          Creates a new literal with the supplied value.
 Literal createLiteral(java.lang.String value, java.lang.String language)
          Creates a new literal with the supplied value and language attribute.
 Literal createLiteral(java.lang.String value, URI datatype)
          Creates a new literal with the supplied value and datatype.
 Statement createStatement(Resource subject, URI predicate, Value object)
          Creates a new statement with the supplied subject, predicate and object.
 URI createURI(java.lang.String uri)
          Creates a new URI from the supplied string-representation.
 URI createURI(java.lang.String namespace, java.lang.String localName)
          Creates a new URI that will get the supplied namespace and local name.
 

Method Detail

createURI

public URI createURI(java.lang.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

public URI createURI(java.lang.String namespace,
                     java.lang.String localName)
Creates a new URI that will get the supplied namespace and local name.

Parameters:
namespace - A namespace.
localName - A legal local name. A legal local name adheres to the definition of an NCName as specified at http://www.w3.org/TR/REC-xml-names/#NT-NCName.
Throws:
java.lang.IllegalArgumentException - If the supplied namespace and localname do not resolve to a legal (absolute) URI.

createBNode

public BNode createBNode()
Creates a new bNode.

Returns:
An object representing the bNode.

createBNode

public BNode createBNode(java.lang.String nodeId)
creates a new bNode with the given node identifier.

Parameters:
nodeId - the bnode identifier
Returns:
an object representing the bnode.

createLiteral

public Literal createLiteral(java.lang.String value)
Creates a new literal with the supplied value.

Parameters:
value - The literal's value.

createLiteral

public Literal createLiteral(java.lang.String value,
                             java.lang.String language)
Creates a new literal with the supplied value and language attribute.

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

createLiteral

public Literal createLiteral(java.lang.String value,
                             URI datatype)
Creates a new literal with the supplied value and datatype.

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

createStatement

public 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.