org.openrdf.model.impl
Class ValueFactoryImpl

java.lang.Object
  extended byorg.openrdf.model.impl.ValueFactoryImpl
All Implemented Interfaces:
ValueFactory

public class ValueFactoryImpl
extends Object
implements ValueFactory

Default implementation of the ValueFactory interface that uses the RDF model classes from this package.


Constructor Summary
ValueFactoryImpl()
          Creates a new ValueFactoryImpl.
ValueFactoryImpl(String documentURI)
          Creates a new ValueFactoryImpl that uses the specified document URI to generate a bNode prefix.
 
Method Summary
 BNode createBNode()
          Creates a new bNode.
 BNode createBNode(String nodeId)
          creates a new bNode with the given node identifier.
 Literal createLiteral(String value)
          Creates a new literal with the supplied value.
 Literal createLiteral(String value, String language)
          Creates a new literal with the supplied value and language attribute.
 Literal createLiteral(String value, String language, String datatype)
           
 Literal createLiteral(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(String uri)
          Creates a new URI from the supplied string-representation.
 URI createURI(String namespace, String localName)
          Creates a new URI that will get the supplied namespace and local name.
 void setDocumentURI(String uri)
          Sets the URI of the document that is currently being parsed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueFactoryImpl

public ValueFactoryImpl()
Creates a new ValueFactoryImpl.


ValueFactoryImpl

public ValueFactoryImpl(String documentURI)
Creates a new ValueFactoryImpl that uses the specified document URI to generate a bNode prefix.

Parameters:
documentURI - A document URI
See Also:
setDocumentURI(java.lang.String)
Method Detail

createURI

public URI createURI(String uri)
Description copied from interface: ValueFactory
Creates a new URI from the supplied string-representation.

Specified by:
createURI in interface ValueFactory
Parameters:
uri - A string-representation of a URI.
Returns:
An object representing the URI.

createURI

public URI createURI(String namespace,
                     String localName)
Description copied from interface: ValueFactory
Creates a new URI that will get the supplied namespace and local name.

Specified by:
createURI in interface ValueFactory
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.

createBNode

public BNode createBNode()
Description copied from interface: ValueFactory
Creates a new bNode.

Specified by:
createBNode in interface ValueFactory
Returns:
An object representing the bNode.

createBNode

public BNode createBNode(String nodeId)
Description copied from interface: ValueFactory
creates a new bNode with the given node identifier.

Specified by:
createBNode in interface ValueFactory
Parameters:
nodeId - the bnode identifier
Returns:
an object representing the bnode.

createLiteral

public Literal createLiteral(String value)
Description copied from interface: ValueFactory
Creates a new literal with the supplied value.

Specified by:
createLiteral in interface ValueFactory
Parameters:
value - The literal's value.

createLiteral

public Literal createLiteral(String value,
                             String language)
Description copied from interface: ValueFactory
Creates a new literal with the supplied value and language attribute.

Specified by:
createLiteral in interface ValueFactory
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(String value,
                             URI datatype)
Description copied from interface: ValueFactory
Creates a new literal with the supplied value and datatype.

Specified by:
createLiteral in interface ValueFactory
Parameters:
value - The literal's value.
datatype - The literal's datatype, or null if the literal doesn't have a datatype.

createLiteral

public Literal createLiteral(String value,
                             String language,
                             String datatype)

createStatement

public Statement createStatement(Resource subject,
                                 URI predicate,
                                 Value object)
Description copied from interface: ValueFactory
Creates a new statement with the supplied subject, predicate and object.

Specified by:
createStatement in interface ValueFactory
Parameters:
subject - The statement's subject.
predicate - The statement's predicate.
object - The statement's object.
Returns:
The created statement.

setDocumentURI

public void setDocumentURI(String uri)
Sets the URI of the document that is currently being parsed. This URI is used to generate a 'unique' bNode prefix based on an MD5 (see RFC 1321) digest of the URI. The result of this digest is practically guaranteed to be unique.



Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.