本文整理汇总了Java中com.hp.hpl.jena.tdb.TDB.sync方法的典型用法代码示例。如果您正苦于以下问题:Java TDB.sync方法的具体用法?Java TDB.sync怎么用?Java TDB.sync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hp.hpl.jena.tdb.TDB
的用法示例。
在下文中一共展示了TDB.sync方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sync
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
@Override
public void sync() throws DBException {
if (connection != null) {
connection.flush();
}
TDB.sync(dataset);
}
示例2: addModel
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
public void addModel(Model m, String name) {
if (name == null) {
logger.info("cannot add the model because the given name is null.");
return;
}
Model namedModel = this.dataset.getNamedModel(name);
namedModel.removeAll();
namedModel.add(m.listStatements());
namedModel.setNsPrefixes(m.getNsPrefixMap());
namedModel.commit();
TDB.sync(this.dataset);
}
示例3: closeTdbDS
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
protected void closeTdbDS() {
if (getTdbDS(false) != null) {
while (tdbDS.isInTransaction()) {
logger.debug("Waiting for TDB Repo transaction to complete before closing");
// thread.sleep(100);
}
logger.debug("Closing TDB Repo, setting Dataset " + tdbDS + " to null");
TDB.sync(tdbDS);
tdbDS.close();
TDB.closedown();
setTdbDS(null);
}
}
示例4: sync
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
public boolean sync() {
if (ds != null) {
TDB.sync(ds);
return true;
}
return false;
}
示例5: close
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
public boolean close() {
if (ds != null) {
TDB.sync(ds);
ds.close();
ds = null;
return true;
}
return false;
}
示例6: setTdbFolder
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
public void setTdbFolder(String _tdbFolder) {
if (ds != null) {
// we have an open TDB Dataset
if (getTdbFolder() != null && !_tdbFolder.equals(getTdbFolder())) {
// the TDB location has changed
TDB.sync(ds);
ds.close();
ds = TDBFactory.createDataset( _tdbFolder );
}
}
else if (getFormat().equals(IConfigurationManager.JENA_TDB)){
ds = TDBFactory.createDataset( _tdbFolder );
}
tdbFolder = _tdbFolder;
}
示例7: setTdbFolder
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
public void setTdbFolder(String _tdbFolder) {
if (ds != null) {
// we have an open TDB Dataset
if (getTdbFolder() != null && !_tdbFolder.equals(getTdbFolder())) {
// the TDB location has changed
TDB.sync(ds);
ds.close();
ds = TDBFactory.createDataset( _tdbFolder );
}
}
else if (getFormat().equals(JENA_TDB)){
ds = TDBFactory.createDataset( _tdbFolder );
}
tdbFolder = _tdbFolder;
}
示例8: updateDataset
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
private void updateDataset(String updateString, HttpServletRequest request, HttpServletResponse response)
throws IOException {
Config config = new Config(request);
Dataset tdbstore = TDBFactory.createDataset(config.getTripleStoreDir());
UpdateRequest update = UpdateFactory.create(updateString);
UpdateAction.execute(update, tdbstore);
out.print("Updated");
TDB.sync(tdbstore);
}
示例9: getModel
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
/**
* Call this method to get a model by its public URI and if necessary read it using the specified ModelReader
*/
public Model getModel( String uri, ModelReader loadIfAbsent ) {
boolean addToTDB = addMissingModelToTDB;
Model m = null;
if (uri.equals(IConfigurationManager.ServicesConfigurationURI)) {
// this is a special case--it is always left as an OWL file in RDF/XML format
addToTDB = false;
}
else if (getFormat().equals(IConfigurationManager.JENA_TDB)) {
// try TDB first
m = getModel(uri);
}
if (m == null && loadIfAbsent != null) {
String altUrl = configurationManager.getJenaDocumentMgr().doAltURLMapping(uri);
if (altUrl != null && altUrl.endsWith(".TDB/")) {
try {
SadlUtils su = new SadlUtils();
Dataset tmpds = TDBFactory.createDataset(su.fileUrlToFileName(altUrl));
tmpds.begin(ReadWrite.READ);
m = tmpds.getDefaultModel();
tmpds.end();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else {
m = ModelFactory.createDefaultModel();
loadIfAbsent.readModel( m, altUrl != null ? altUrl : uri );
if (addToTDB && ds != null && getFormat().equals(IConfigurationManager.JENA_TDB)) {
ds.begin(ReadWrite.WRITE);
ds.addNamedModel( uri, m );
ds.commit();
ds.end();
TDB.sync(ds);
}
}
loadUserDefinedDataTypes(uri, altUrl);
}
return m;
}
示例10: getModel
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
/**
* Call this method to get a model by its public URI and if necessary read it using the specified ModelReader
*/
public Model getModel( String uri, ModelReader loadIfAbsent ) {
boolean addToTDB = addMissingModelToTDB;
Model m = null;
if (uri.equals(IConfigurationManager.ServicesConfigurationURI)) {
// this is a special case--it is always left as an OWL file in RDF/XML format
addToTDB = false;
}
else if (getFormat().equals(IConfigurationManager.JENA_TDB)) {
// try TDB first
m = getModel(uri);
}
if (m == null && loadIfAbsent != null) {
String altUrl = configurationManager.getJenaDocumentMgr().doAltURLMapping(uri);
if (altUrl != null && altUrl.endsWith(".TDB/")) {
try {
SadlUtils su = new SadlUtils();
Dataset tmpds = TDBFactory.createDataset(su.fileUrlToFileName(altUrl));
tmpds.begin(ReadWrite.READ);
m = tmpds.getDefaultModel();
tmpds.end();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else {
m = ModelFactory.createDefaultModel();
loadIfAbsent.readModel( m, altUrl != null ? altUrl : uri );
if (addToTDB && ds != null && getFormat().equals(IConfigurationManager.JENA_TDB)) {
ds.begin(ReadWrite.WRITE);
ds.addNamedModel( uri, m );
ds.commit();
ds.end();
TDB.sync(ds);
}
}
}
return m;
}
示例11: getModel
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
/**
* Call this method to get a model by its public URI and if necessary read it using the specified ModelReader
*/
public Model getModel( String uri, ModelReader loadIfAbsent ) {
boolean addToTDB = addMissingModelToTDB;
Model m = null;
if (uri.equals(ServicesConfigurationURI)) {
// this is a special case--it is always left as an OWL file in RDF/XML format
addToTDB = false;
}
else if (getFormat().equals(JENA_TDB)) {
// try TDB first
m = getModel(uri);
}
if (m == null && loadIfAbsent != null) {
String altUrl = modelSpec.getDocumentManager().doAltURLMapping(uri);
if (altUrl != null && altUrl.endsWith(".TDB/")) {
try {
SadlUtils su = new SadlUtils();
Dataset tmpds = TDBFactory.createDataset(su.fileUrlToFileName(altUrl));
tmpds.begin(ReadWrite.READ);
m = tmpds.getDefaultModel();
tmpds.end();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else {
m = ModelFactory.createDefaultModel();
loadIfAbsent.readModel( m, altUrl != null ? altUrl : uri );
if (addToTDB && ds != null && getFormat().equals(JENA_TDB)) {
ds.begin(ReadWrite.WRITE);
ds.addNamedModel( uri, m );
ds.commit();
ds.end();
TDB.sync(ds);
}
}
loadUserDefinedDataTypes(uri, altUrl);
}
return m;
}
示例12: QualityReport
import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
public QualityReport(){
TDB.sync(dataset);
dataset.begin(ReadWrite.WRITE);
// System.out.println("Dataset :" + EnvironmentProperties.getInstance().getBaseURI() + " TDB File :" + TDB_DIRECTORY);
//dataset.getDefaultModel().removeAll(); // since this TDB is meant to be temporary, then we will remove all statements
}