use of org.apache.jena.sdb.store.FeatureSet in project jena by apache.
the class StoreDescAssembler method open.
@Override
public StoreDesc open(Assembler a, Resource root, Mode mode) {
SDBConnectionDesc sdbConnDesc = null;
Resource c = GraphUtils.getResourceValue(root, AssemblerVocab.pConnection);
if (c != null)
sdbConnDesc = (SDBConnectionDesc) a.open(c);
String layoutName = GraphUtils.getStringValue(root, AssemblerVocab.pLayout);
String dbType = chooseDBType(root, sdbConnDesc);
// Features
List<Resource> x = GraphUtils.multiValueResource(root, AssemblerVocab.featureProperty);
FeatureSet fSet = new FeatureSet();
for (Resource r : x) {
String n = GraphUtils.getStringValue(r, AssemblerVocab.featureNameProperty);
String v = GraphUtils.getStringValue(r, AssemblerVocab.featureValueProperty);
Feature f = new Feature(new Feature.Name(n), v);
fSet.addFeature(f);
}
StoreDesc storeDesc = new StoreDesc(layoutName, dbType, fSet);
storeDesc.connDesc = sdbConnDesc;
// MySQL specials
String engineName = GraphUtils.getStringValue(root, AssemblerVocab.pMySQLEngine);
storeDesc.engineType = null;
if (engineName != null)
try {
storeDesc.engineType = MySQLEngineType.convert(engineName);
} catch (SDBException ex) {
}
// SAP specials
String storageType = GraphUtils.getStringValue(root, AssemblerVocab.pStorageType);
if (storageType != null)
try {
storeDesc.storageType = SAPStorageType.convert(storageType);
} catch (SDBException ex) {
}
return storeDesc;
}
Aggregations