use of org.apache.jena.dboe.storage.StoragePrefixes in project jena by apache.
the class GraphViewSwitchable_Prefixes method createPrefixMappingX.
// Create prefix map view.
private PrefixMap createPrefixMappingX() {
DatasetGraphTDB dsg = ((DatasetGraphTDB) (getx().get()));
StoragePrefixes storagePrefixes = dsg.getStoragePrefixes();
StoragePrefixMap spm = isDefaultGraph() ? StoragePrefixesView.internal_viewDefaultGraph(storagePrefixes) : StoragePrefixesView.internal_viewGraph(storagePrefixes, getGraphName());
return PrefixesDboeFactory.newPrefixMap(spm);
}
use of org.apache.jena.dboe.storage.StoragePrefixes in project jena by apache.
the class AbstractTestDatasetPrefixesStorage method dsg_prefixes_02.
@Test
public void dsg_prefixes_02() {
StoragePrefixes prefixes = create();
prefixes.add(g1, pref1, "http://example.net/ns#");
String x1 = prefixes.get(g1, pref1);
assertEquals("http://example.net/ns#", x1);
String x2 = prefixes.get(g1, pref1a);
assertEquals("http://example.net/ns#", x2);
}
use of org.apache.jena.dboe.storage.StoragePrefixes in project jena by apache.
the class TDB2StorageBuilder method build.
// public static DatasetGraphTxn build(Location location, StoreParams appParams) {
// StoreParams locParams = StoreParamsCodec.read(location);
// StoreParams dftParams = StoreParams.getDftStoreParams();
// boolean newArea = isNewDatabaseArea(location);
// if ( newArea ) {
// }
// // This can write the chosen parameters if necessary (new database, appParams != null, locParams == null)
// StoreParams params = StoreParamsFactory.decideStoreParams(location, newArea, appParams, locParams, dftParams);
// return create(location, params).build$();
// }
public static DatasetGraphTDB build(Location location, StoreParams appParams) {
StoreParams locParams = StoreParamsCodec.read(location);
StoreParams dftParams = StoreParams.getDftStoreParams();
boolean newArea = isNewDatabaseArea(location);
if (newArea) {
}
// This can write the chosen parameters if necessary (new database, appParams != null, locParams == null)
StoreParams params = StoreParamsFactory.decideStoreParams(location, newArea, appParams, locParams, dftParams);
// Builder pattern for adding components.
TransactionCoordinator txnCoord = buildTransactionCoordinator(location);
TransactionalSystem txnSystem = new TransactionalBase(txnCoord);
TDB2StorageBuilder builder = new TDB2StorageBuilder(txnSystem, location, params, new ComponentIdMgr(UUID.randomUUID()));
StorageTDB storage = builder.buildStorage();
StoragePrefixes prefixes = builder.buildPrefixes();
// Finalize.
builder.components.forEach(txnCoord::add);
builder.listeners.forEach(txnCoord::addListener);
// Freezes the TransactionCoordinator components
txnCoord.start();
ReorderTransformation reorderTranform = chooseReorderTransformation(location);
DatasetGraphTDB dsg = new DatasetGraphTDB(location, params, reorderTranform, storage, prefixes, txnSystem);
// Enable query processing.
QC.setFactory(dsg.getContext(), OpExecutorTDB2.OpExecFactoryTDB);
return dsg;
}
use of org.apache.jena.dboe.storage.StoragePrefixes in project jena by apache.
the class AbstractTestDatasetPrefixesStorage method dsg_prefixes_01.
@Test
public void dsg_prefixes_01() {
StoragePrefixes prefixes = create();
prefixes.add(g1, pref1, "http://example.net/ns#");
}
use of org.apache.jena.dboe.storage.StoragePrefixes in project jena by apache.
the class AbstractTestDatasetPrefixesStorage method dsg_prefixes_11.
// Accessors
@Test
public void dsg_prefixes_11() {
StoragePrefixes prefixes = create();
prefixes.add(g1, pref1, "http://example.net/ns#");
List<Node> x = Iter.toList(prefixes.listGraphNodes());
assertEquals(1, x.size());
List<PrefixEntry> y = Iter.toList(prefixes.get(g1));
assertEquals(1, y.size());
}
Aggregations