public class AGValueFactory
extends org.openrdf.model.impl.ValueFactoryImpl
Modifier and Type | Field and Description |
---|---|
String |
PREFIX_FOR_EXTERNAL_BNODES |
Constructor and Description |
---|
AGValueFactory(AGRepository repository) |
AGValueFactory(AGRepository repository,
AGRepositoryConnection conn) |
Modifier and Type | Method and Description |
---|---|
org.openrdf.model.Resource |
asResource(com.hp.hpl.jena.graph.Node node) |
org.openrdf.model.URI |
asURI(com.hp.hpl.jena.graph.Node node) |
org.openrdf.model.Value |
asValue(com.hp.hpl.jena.graph.Node node)
Creates an OpenRDF Value from a concrete Jena Node.
|
org.openrdf.model.BNode |
createBNode()
Returns a new blank node.
|
org.openrdf.model.BNode |
createBNode(String nodeID)
Returns a new blank node with the given id.
|
org.openrdf.model.URI |
generateURI(String registeredEncodableNamespace)
Returns a unique URI within the specified encodable namespace.
|
org.openrdf.model.URI[] |
generateURIs(String namespace,
int amount)
Returns unique URIs within the specified encodable namespace.
|
String[] |
getBlankNodeIds()
Returns the array of fetched blank node ids
Primarily for testing purposes, not for use in apps.
|
int |
getBlankNodesPerRequest()
Gets the number of blank nodes fetched per request.
|
com.franz.agraph.http.AGHTTPClient |
getHTTPClient() |
AGRepository |
getRepository() |
boolean |
isAGBlankNodeId(String id)
Returns true iff id looks like an AG blank node id.
|
boolean |
isURIForExternalBlankNode(org.openrdf.model.Value v) |
void |
setBlankNodesPerRequest(int amount)
Sets the number of blank nodes to fetch per request.
|
createLiteral, createLiteral, createLiteral, createStatement, createStatement, createURI, createURI, getInstance
public String PREFIX_FOR_EXTERNAL_BNODES
public AGValueFactory(AGRepository repository)
public AGValueFactory(AGRepository repository, AGRepositoryConnection conn)
public AGRepository getRepository()
public com.franz.agraph.http.AGHTTPClient getHTTPClient()
public void setBlankNodesPerRequest(int amount)
This can be used to control the number and frequency of HTTP requests made when automatically obtaining new sets of blank node ids from the server.
Defaults to the value of System property com.franz.agraph.repository.blankNodesPerRequest or to 100 if that property has not been set.
amount
- public int getBlankNodesPerRequest()
public String[] getBlankNodeIds()
public org.openrdf.model.BNode createBNode(String nodeID)
createBNode
in interface org.openrdf.model.ValueFactory
createBNode
in class org.openrdf.model.impl.ValueFactoryImpl
AGHttpRepoClient.setAllowExternalBlankNodeIds(boolean)
,
AGRepositoryConnection.getHttpRepoClient()
public org.openrdf.model.BNode createBNode()
createBNode
in interface org.openrdf.model.ValueFactory
createBNode
in class org.openrdf.model.impl.ValueFactoryBase
AGHttpRepoClient.setAllowExternalBlankNodeIds(boolean)
,
AGRepositoryConnection.getHttpRepoClient()
public org.openrdf.model.Value asValue(com.hp.hpl.jena.graph.Node node)
node
- a concrete Jena node.public boolean isAGBlankNodeId(String id)
id
- the string to be testedpublic boolean isURIForExternalBlankNode(org.openrdf.model.Value v)
public org.openrdf.model.Resource asResource(com.hp.hpl.jena.graph.Node node)
public org.openrdf.model.URI asURI(com.hp.hpl.jena.graph.Node node)
public org.openrdf.model.URI[] generateURIs(String namespace, int amount) throws org.openrdf.repository.RepositoryException
The generated URIs will conform to the format that was specified when the encodable namespace was registered, and are guaranteed to be unique for this namespace generator. Note that this does not prevent other parties from independently using URIs that involve this namespace, however.
If amount cannot be generated, up to amount URIs will be returned, or an exception will be thrown if none are available.
org.openrdf.repository.RepositoryException
AGRepositoryConnection.registerEncodableNamespace(String, String)
,
generateURI(String)
public org.openrdf.model.URI generateURI(String registeredEncodableNamespace) throws org.openrdf.repository.RepositoryException
The generated URI will conform to the format that was specified when the encodable namespace was registered, and is guaranteed to be unique for this namespace generator. Note that this does not prevent other parties from independently using URIs that involve this namespace, however.
org.openrdf.repository.RepositoryException
AGRepositoryConnection.registerEncodableNamespace(String, String)
,
generateURIs(String, int)