com.bigdata.rdf.model
Interface BigdataValueFactory

All Superinterfaces:
ValueFactory
All Known Implementing Classes:
BigdataValueFactoryImpl, BNodeContextFactory

public interface BigdataValueFactory
extends ValueFactory

Interface strengthens the return types and adds some custom extensions.

Version:
$Id: BigdataValueFactory.java 6036 2012-02-17 14:07:48Z thompsonbry $
Author:
Bryan Thompson
See Also:
BigdataValueFactoryImpl.getInstance(String)

Method Summary
 BigdataBNode asValue(BNode v)
          Strongly typed for BNodes.
 BigdataLiteral asValue(Literal v)
          Strongly typed for Literals.
 BigdataResource asValue(Resource v)
          Strongly typed for Resources.
 BigdataURI asValue(URI v)
          Strongly typed for URIs.
 BigdataValue asValue(Value v)
          Converts a Value into a BigdataValue.
 BigdataBNode createBNode()
           
 BigdataBNode createBNode(String id)
           
 BigdataLiteral createLiteral(boolean arg0)
           
 BigdataLiteral createLiteral(byte arg0)
           
 BigdataLiteral createLiteral(byte arg0, boolean unsigned)
           
 BigdataLiteral createLiteral(double arg0)
           
 BigdataLiteral createLiteral(float arg0)
           
 BigdataLiteral createLiteral(int arg0)
           
 BigdataLiteral createLiteral(int arg0, boolean unsigned)
           
 BigdataLiteral createLiteral(long arg0)
           
 BigdataLiteral createLiteral(long arg0, boolean unsigned)
           
 BigdataLiteral createLiteral(short arg0)
           
 BigdataLiteral createLiteral(short arg0, boolean unsigned)
           
 BigdataLiteral createLiteral(String label)
           
 BigdataLiteral createLiteral(String label, String language)
           
 BigdataLiteral createLiteral(String label, URI datatype)
           
 BigdataLiteral createLiteral(XMLGregorianCalendar arg0)
           
 BigdataStatement createStatement(Resource s, URI p, Value o)
          Create a statement whose StatementEnum is NOT specified.
 BigdataStatement createStatement(Resource s, URI p, Value o, Resource c)
          Create a statement whose StatementEnum is NOT specified.
 BigdataStatement createStatement(Resource s, URI p, Value o, Resource c, StatementEnum type)
          Create a statement (core impl).
 BigdataStatement createStatement(Resource s, URI p, Value o, Resource c, StatementEnum type, boolean userFlag)
          Create a statement (core impl).
 BigdataURI createURI(String uriString)
           
 BigdataURI createURI(String namespace, String localName)
           
 String getNamespace()
          The namespace of the KB instance associated with the value factory.
 BigdataValueSerializer<BigdataValue> getValueSerializer()
          An object that can efficiently (de-)serialize Values using this ValueFactory.
 BigdataValueFactory newBNodeContext()
          Returns a factory that will assign its blank node IDs within a globally unique namespace.
 void remove()
          Remove instance of valueFactory from static cache
 

Method Detail

getNamespace

String getNamespace()
The namespace of the KB instance associated with the value factory.


remove

void remove()
Remove instance of valueFactory from static cache


newBNodeContext

BigdataValueFactory newBNodeContext()
Returns a factory that will assign its blank node IDs within a globally unique namespace. This factory should be used when processing a document as the generated IDs are clustered and make the ordered writes on the lexicon more efficient since all blank nodes for the same document tend to be directed to the same index partition. All BigdataValues are actually created by this factory, it is only the semantics of blank node ID generation that are overridden.

See Also:
BNodeContextFactory

createBNode

BigdataBNode createBNode()
Specified by:
createBNode in interface ValueFactory

createBNode

BigdataBNode createBNode(String id)
Specified by:
createBNode in interface ValueFactory

createLiteral

BigdataLiteral createLiteral(String label)
Specified by:
createLiteral in interface ValueFactory

createLiteral

BigdataLiteral createLiteral(boolean arg0)
Specified by:
createLiteral in interface ValueFactory

createLiteral

BigdataLiteral createLiteral(byte arg0)
Specified by:
createLiteral in interface ValueFactory

createLiteral

BigdataLiteral createLiteral(short arg0)
Specified by:
createLiteral in interface ValueFactory

createLiteral

BigdataLiteral createLiteral(int arg0)
Specified by:
createLiteral in interface ValueFactory

createLiteral

BigdataLiteral createLiteral(long arg0)
Specified by:
createLiteral in interface ValueFactory

createLiteral

BigdataLiteral createLiteral(byte arg0,
                             boolean unsigned)

createLiteral

BigdataLiteral createLiteral(short arg0,
                             boolean unsigned)

createLiteral

BigdataLiteral createLiteral(int arg0,
                             boolean unsigned)

createLiteral

BigdataLiteral createLiteral(long arg0,
                             boolean unsigned)

createLiteral

BigdataLiteral createLiteral(float arg0)
Specified by:
createLiteral in interface ValueFactory

createLiteral

BigdataLiteral createLiteral(double arg0)
Specified by:
createLiteral in interface ValueFactory

createLiteral

BigdataLiteral createLiteral(XMLGregorianCalendar arg0)
Specified by:
createLiteral in interface ValueFactory

createLiteral

BigdataLiteral createLiteral(String label,
                             String language)
Specified by:
createLiteral in interface ValueFactory

createLiteral

BigdataLiteral createLiteral(String label,
                             URI datatype)
Specified by:
createLiteral in interface ValueFactory

createURI

BigdataURI createURI(String uriString)
Specified by:
createURI in interface ValueFactory

createURI

BigdataURI createURI(String namespace,
                     String localName)
Specified by:
createURI in interface ValueFactory

createStatement

BigdataStatement createStatement(Resource s,
                                 URI p,
                                 Value o)
Create a statement whose StatementEnum is NOT specified.

Specified by:
createStatement in interface ValueFactory

createStatement

BigdataStatement createStatement(Resource s,
                                 URI p,
                                 Value o,
                                 Resource c)
Create a statement whose StatementEnum is NOT specified.

Specified by:
createStatement in interface ValueFactory

createStatement

BigdataStatement createStatement(Resource s,
                                 URI p,
                                 Value o,
                                 Resource c,
                                 StatementEnum type)
Create a statement (core impl). The s,p,o, and the optional c arguments will be normalized to this BigdataValueFactory using asValue(Value).

Parameters:
s - The subject.
p - The predicate.
o - The object.
c - The context (optional). Note: When non-null and statement identifiers are enabled, then this will be a blank node whose term identifier is the statement identifier.
type - The statement type (optional).

createStatement

BigdataStatement createStatement(Resource s,
                                 URI p,
                                 Value o,
                                 Resource c,
                                 StatementEnum type,
                                 boolean userFlag)
Create a statement (core impl). The s,p,o, and the optional c arguments will be normalized to this BigdataValueFactory using asValue(Value).

Parameters:
s - The subject.
p - The predicate.
o - The object.
c - The context (optional). Note: When non-null and statement identifiers are enabled, then this will be a blank node whose term identifier is the statement identifier.
type - The statement type (optional).
userFlag - The user flag

asValue

BigdataValue asValue(Value v)
Converts a Value into a BigdataValue. If the value is already a BigdataValue and it was allocated by this BigdataValueFactoryImpl then it is returned unchanged. Otherwise a new BigdataValue will be creating using the same data as the given value and the term identifier on the new BigdataValue will be initialized to IRawTripleStore#NULL.

All BigdataValues created by a BigdataValueFactoryImpl internally store a transient reference to the BigdataValueFactoryImpl. This reference is used to decide if a BigdataValue MIGHT have been created by a different lexicon (term identifiers generated by different lexicons CAN NOT be used interchangeably). This has the effect of protecting against incorrect use of the term identifier with a database backed by a different lexicon while allowing reuse of the BigdataValues when possible.

Parameters:
v - The value.
Returns:
A BigdataValue with the same data. If the value is null then null is returned.

asValue

BigdataResource asValue(Resource v)
Strongly typed for Resources.


asValue

BigdataURI asValue(URI v)
Strongly typed for URIs.


asValue

BigdataLiteral asValue(Literal v)
Strongly typed for Literals.


asValue

BigdataBNode asValue(BNode v)
Strongly typed for BNodes.


getValueSerializer

BigdataValueSerializer<BigdataValue> getValueSerializer()
An object that can efficiently (de-)serialize Values using this ValueFactory. When the values are de-serialized they will have a reference to this BigdataValueFactoryImpl. That reference can be used to identify when two BigdataValues MIGHT be from different lexicons.

Returns:


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.