当前位置: 首页>>代码示例>>Java>>正文


Java TDB.sync方法代码示例

本文整理汇总了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);
}
 
开发者ID:ljo,项目名称:exist-sparql,代码行数:8,代码来源:TDBRDFIndex.java

示例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);
}
 
开发者ID:therelaxist,项目名称:spring-usc,代码行数:14,代码来源:Repository.java

示例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);
	}
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:14,代码来源:CsvImporter.java

示例4: sync

import com.hp.hpl.jena.tdb.TDB; //导入方法依赖的package包/类
public boolean sync() {
	if (ds != null) {
		TDB.sync(ds);
		return true;
	}
	return false;
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:8,代码来源:SadlJenaModelGetter.java

示例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;
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:10,代码来源:SadlJenaModelGetter.java

示例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;
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:16,代码来源:SadlJenaModelGetter.java

示例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;
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:16,代码来源:SadlJenaModelGetter.java

示例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);
}
 
开发者ID:IKCAP,项目名称:turbosoft,代码行数:10,代码来源:SparqlEndpoint.java

示例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;
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:45,代码来源:SadlJenaModelGetter.java

示例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;
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:44,代码来源:SadlJenaModelGetter.java

示例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;
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:45,代码来源:SadlJenaModelGetter.java

示例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
	}
 
开发者ID:EIS-Bonn,项目名称:Luzzu,代码行数:10,代码来源:QualityReport.java


注:本文中的com.hp.hpl.jena.tdb.TDB.sync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。