org.openrdf.sail.rdbms
Class RdbmsValueFactory

java.lang.Object
  extended by org.openrdf.model.impl.ValueFactoryBase
      extended by org.openrdf.sail.rdbms.RdbmsValueFactory
All Implemented Interfaces:
ValueFactory

public class RdbmsValueFactory
extends ValueFactoryBase

Provides basic value creation both for traditional values as well as values with an internal id. RdbmsValues behaviour similar to the default Value implementation with the addition that they also include an internal id and a version associated with that id. The internal ids should not be accessed directly, but rather either through this class or the corresponding manager class.

Author:
James Leigh

Field Summary
static String NIL_LABEL
          Deprecated. 
 
Constructor Summary
RdbmsValueFactory()
           
 
Method Summary
 RdbmsLiteral asRdbmsLiteral(Literal literal)
           
 RdbmsResource[] asRdbmsResource(Resource... contexts)
           
 RdbmsResource asRdbmsResource(Resource node)
           
 RdbmsStatement asRdbmsStatement(Statement stmt)
           
 RdbmsURI asRdbmsURI(URI uri)
           
 RdbmsValue asRdbmsValue(Value value)
           
 RdbmsBNode createBNode(String nodeID)
          Creates a new blank node with the given node identifier.
 RdbmsLiteral createLiteral(String label)
          Creates a new literal with the supplied label.
 RdbmsLiteral createLiteral(String label, String language)
          Creates a new literal with the supplied label and language attribute.
 RdbmsLiteral createLiteral(String label, URI datatype)
          Creates a new literal with the supplied label and datatype.
 RdbmsStatement createStatement(Resource subject, URI predicate, Value object)
          Creates a new statement with the supplied subject, predicate and object.
 RdbmsStatement createStatement(Resource subject, URI predicate, Value object, Resource context)
          Creates a new statement with the supplied subject, predicate and object and associated context.
 RdbmsURI createURI(String uri)
          Creates a new URI from the supplied string-representation.
 RdbmsURI createURI(String namespace, String localName)
          Creates a new URI from the supplied namespace and local name.
 void flush()
           
 Lock getIdReadLock()
           
 Lock getIdWriteLock()
           
 Number getInternalId(Value r)
           
 Number getPredicateId(RdbmsURI predicate)
           
 RdbmsLiteral getRdbmsLiteral(Number num, String label, String language, String datatype)
           
 RdbmsResource getRdbmsResource(Number num, String stringValue)
           
 void setBNodeManager(BNodeManager bnodes)
           
 void setDelegate(ValueFactory vf)
           
 void setIdSequence(IdSequence ids)
           
 void setLiteralManager(LiteralManager literals)
           
 void setPredicateManager(PredicateManager predicates)
           
 void setURIManager(UriManager uris)
           
 Lock tryIdWriteLock()
           
 
Methods inherited from class org.openrdf.model.impl.ValueFactoryBase
createBNode, createFPLiteral, createIntegerLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createNumericLiteral, initBNodeParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NIL_LABEL

@Deprecated
public static final String NIL_LABEL
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

RdbmsValueFactory

public RdbmsValueFactory()
Method Detail

setIdSequence

public void setIdSequence(IdSequence ids)

setBNodeManager

public void setBNodeManager(BNodeManager bnodes)

setURIManager

public void setURIManager(UriManager uris)

setLiteralManager

public void setLiteralManager(LiteralManager literals)

setPredicateManager

public void setPredicateManager(PredicateManager predicates)

setDelegate

public void setDelegate(ValueFactory vf)

flush

public void flush()
           throws RdbmsException
Throws:
RdbmsException

createBNode

public RdbmsBNode createBNode(String nodeID)
Description copied from interface: ValueFactory
Creates a new blank node with the given node identifier.

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

createLiteral

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

Parameters:
label - The literal's label.

createLiteral

public RdbmsLiteral createLiteral(String label,
                                  String language)
Description copied from interface: ValueFactory
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

public RdbmsLiteral createLiteral(String label,
                                  URI datatype)
Description copied from interface: ValueFactory
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.

createStatement

public RdbmsStatement createStatement(Resource subject,
                                      URI predicate,
                                      Value object)
Description copied from interface: ValueFactory
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

public RdbmsStatement createStatement(Resource subject,
                                      URI predicate,
                                      Value object,
                                      Resource context)
Description copied from interface: ValueFactory
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.

createURI

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

Parameters:
uri - A string-representation of a URI.
Returns:
An object representing the URI.

createURI

public RdbmsURI createURI(String namespace,
                          String localName)
Description copied from interface: ValueFactory
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.

getRdbmsResource

public RdbmsResource getRdbmsResource(Number num,
                                      String stringValue)

getRdbmsLiteral

public RdbmsLiteral getRdbmsLiteral(Number num,
                                    String label,
                                    String language,
                                    String datatype)

asRdbmsResource

public RdbmsResource asRdbmsResource(Resource node)

asRdbmsURI

public RdbmsURI asRdbmsURI(URI uri)

asRdbmsValue

public RdbmsValue asRdbmsValue(Value value)

asRdbmsLiteral

public RdbmsLiteral asRdbmsLiteral(Literal literal)

asRdbmsResource

public RdbmsResource[] asRdbmsResource(Resource... contexts)

asRdbmsStatement

public RdbmsStatement asRdbmsStatement(Statement stmt)

getInternalId

public Number getInternalId(Value r)
                     throws RdbmsException
Throws:
RdbmsException

getPredicateId

public Number getPredicateId(RdbmsURI predicate)
                      throws RdbmsException
Throws:
RdbmsException

getIdReadLock

public Lock getIdReadLock()
                   throws InterruptedException
Throws:
InterruptedException

tryIdWriteLock

public Lock tryIdWriteLock()

getIdWriteLock

public Lock getIdWriteLock()
                    throws InterruptedException
Throws:
InterruptedException


Copyright © 2001-2008 Aduna. All Rights Reserved.