本文整理汇总了Java中com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction类的典型用法代码示例。如果您正苦于以下问题:Java DatasetGraphTransaction类的具体用法?Java DatasetGraphTransaction怎么用?Java DatasetGraphTransaction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DatasetGraphTransaction类属于com.hp.hpl.jena.tdb.transaction包,在下文中一共展示了DatasetGraphTransaction类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bulkload
import com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction; //导入依赖的package包/类
/**
* Load a list of files into a database located in a given directory.
*
* @param dir directory containing the database file.
* @param urls URLs of the files containing the RDF content to be loaded into the database file.
*/
public static void bulkload(String dir, URL[] urls) {
DatasetGraphTransaction dataset = (DatasetGraphTransaction) TDBFactory.createDatasetGraph(dir);
String[] stringURLs = new String[urls.length];
int i=0;
for(URL url : urls) {
stringURLs[i] = url.toString();
i++;
}
TDBLoader.load(dataset.getDatasetGraphToQuery(), Arrays.asList(stringURLs));
}
示例2: createDataSet
import com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction; //导入依赖的package包/类
/**
* create a dataset with a specified location
*
* @param location the specified location string
*/
public void createDataSet(String location) {
this.dataset = ((DatasetGraphTransaction) TDBFactory.createDatasetGraph(location)).getBaseDatasetGraph();
this.arqExCtx = new ExecutionContext(this.dataset.getContext(),
this.dataset.getDefaultGraph(),
this.dataset, OpExecutorTDB1.OpExecFactoryTDB);
}
示例3: dsgToQuery
import com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction; //导入依赖的package包/类
protected DatasetGraphTDB dsgToQuery(DatasetGraph dataset)
{
if (dataset instanceof DatasetGraphTDB) return (DatasetGraphTDB)dataset ;
if (dataset instanceof DatasetGraphTransaction)
return ((DatasetGraphTransaction)dataset).getDatasetGraphToQuery() ;
throw new TDBException("Internal inconsistency: trying to execute query on unrecognized kind of DatasetGraph: "+Lib.className(dataset)) ;
}
示例4: isHandledByTDB
import com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction; //导入依赖的package包/类
private static boolean isHandledByTDB(DatasetGraph dataset)
{
if (dataset instanceof DatasetGraphTDB) return true ;
if (dataset instanceof DatasetGraphTransaction ) return true ;
return false ;
}
示例5: initTDBGraph
import com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction; //导入依赖的package包/类
/**
* init TDB graph with the specified directory
*
* @param directory
*/
public void initTDBGraph(String directory) {
//this.dataset = TDBFactory.createDatasetGraph(directory);
this.dataset = ((DatasetGraphTransaction) TDBFactory.createDatasetGraph(location)).getBaseDatasetGraph();
}