本文整理匯總了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();
}