public class ModelGraph extends Object
Model
and the Clerezza Graph
or
MGraph
. It also provide access to the JenaGraphAdaptor
so that this component can add parsed data to Graph
s created
by calls to SingleTdbDatasetTcProvider.createGraph(UriRef, TripleCollection)
.Constructor and Description |
---|
ModelGraph(java.util.concurrent.locks.ReadWriteLock lock,
com.hp.hpl.jena.rdf.model.Model model,
boolean readWrite)
Constructs and initializes the ModelGraph
|
Modifier and Type | Method and Description |
---|---|
void |
close()
closes this ModelGraph and frees up all Jena TDB related resources.
|
void |
delete()
Removes all triples from the Jena Model and than calls
close()
to free remaining resources. |
Graph |
getGraph()
Getter for the
Graph |
JenaGraphAdaptor |
getJenaAdapter()
The
JenaGraphAdaptor . |
MGraph |
getMGraph()
Getter for the
MGraph |
boolean |
isReadWrite() |
void |
sync()
Synchronize the Jena Model with the field system by calling
TDB.sync(Model) |
public ModelGraph(java.util.concurrent.locks.ReadWriteLock lock, com.hp.hpl.jena.rdf.model.Model model, boolean readWrite)
model
- the Jena ModelreadWrite
- if the Clerezza counterpart should be read- and
write-able or read-only.public JenaGraphAdaptor getJenaAdapter()
JenaGraphAdaptor
. For internal use only! Do not pass
this instance to other components. Use getGraph()
and
getMGraph()
instead!JenaGraphAdaptor
public boolean isReadWrite()
public MGraph getMGraph()
MGraph
MGraph
IllegalStateException
- if this ModelGraph
is NOT
readWrite
public Graph getGraph()
Graph
Graph
IllegalStateException
- if this ModelGraph
is
readWrite
public void close()
public void sync()
TDB.sync(Model)
public void delete()
close()
to free remaining resources. Note that in Jena TDB a named model is
deleted if no more triples with the given context are present within
the Quad
store of the Jena TDB DatasetGraph
.Copyright © 2014 The Apache Software Foundation. All Rights Reserved.