本文整理汇总了Java中org.eclipse.rdf4j.sail.Sail类的典型用法代码示例。如果您正苦于以下问题:Java Sail类的具体用法?Java Sail怎么用?Java Sail使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Sail类属于org.eclipse.rdf4j.sail包,在下文中一共展示了Sail类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSail
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
@Override
public Sail getSail(SailImplConfig config) throws SailConfigException {
if (!SAIL_TYPE.equals(config.getType())) {
throw new SailConfigException("Invalid Sail type: " + config.getType());
}
if (!(config instanceof FedXSailConfig)) {
throw new SailConfigException("FedXSail config expected, was " + config.getClass().getCanonicalName());
}
FedXSailConfig fedXSailConfig = (FedXSailConfig)config;
String fedxConfig = fedXSailConfig.getFedxConfig();
if (fedxConfig==null)
throw new SailConfigException("FedX Sail Configuration must not be null");
try {
return FedXFactory.initializeFederation(fedxConfig, new DefaultEndpointListProvider(Collections.<String>emptyList())).getSail();
} catch (FedXException e) {
throw new SailConfigException(e);
}
}
开发者ID:dice-group,项目名称:CostFed,代码行数:24,代码来源:FedXSailFactory.java
示例2: testGetSail
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
@Test
public void testGetSail() throws Exception {
HBaseSailConfig hbsc = new HBaseSailConfig();
hbsc.setCreate(false);
hbsc.setPush(false);
hbsc.setSplitBits(3);
hbsc.setEvaluationTimeout(480);
hbsc.setTablespace("testtable");
hbsc.setElasticIndexURL("http://whatever/index");
Sail sail = new HBaseSailFactory().getSail(hbsc);
assertTrue(sail instanceof HBaseSail);
HBaseSail hbs = (HBaseSail)sail;
assertFalse(hbs.create);
assertFalse(hbs.pushStrategy);
assertEquals(3, hbs.splitBits);
assertEquals("testtable", hbs.tableName);
assertEquals(480, hbs.evaluationTimeout);
assertEquals("http://whatever/index", hbs.elasticIndexURL);
}
开发者ID:Merck,项目名称:Halyard,代码行数:20,代码来源:HBaseSailFactoryTest.java
示例3: GraphSail
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
public GraphSail(final Graph graph, final Function<String, GraphIndex> indexFactory, final boolean readOnly) {
this.dataStore = new DataStore(graph, readOnly, indexFactory, new DataStore.SailChangedHelper() {
@Override
public void notifyOfChanges(boolean statementsAdded, boolean statementsRemoved) {
if (statementsAdded || statementsRemoved) {
SailChangedEvent event = new SailChangedEvent() {
@Override
public Sail getSail() {
return GraphSail.this;
}
@Override
public boolean statementsAdded() {
return statementsAdded;
}
@Override
public boolean statementsRemoved() {
return statementsRemoved;
}
};
notifySailChanged(event);
}
}
});
this.sailStore = new GraphSailStore(dataStore);
}
开发者ID:joshsh,项目名称:graphsail,代码行数:28,代码来源:GraphSail.java
示例4: createSail
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
@Override
protected Sail createSail() throws Exception {
GraphWrapper wrapper = createGraphWrapper();
GraphSail sail = new GraphSail(wrapper.getGraph(), wrapper.getIndexFactory());
sail.enforceUniqueStatements(uniqueStatements);
return sail;
}
开发者ID:joshsh,项目名称:graphsail,代码行数:8,代码来源:GraphSailTest.java
示例5: getSail
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
@Override
public Sail getSail(SailImplConfig config) throws SailConfigException {
if (!SAIL_TYPE.equals(config.getType())) {
throw new SailConfigException("Invalid Sail type: " + config.getType());
}
if (config instanceof HBaseSailConfig) {
HBaseSailConfig hconfig = (HBaseSailConfig) config;
//instantiate the sail
HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null);
return sail;
} else {
throw new SailConfigException("Invalid configuration: " + config);
}
}
开发者ID:Merck,项目名称:Halyard,代码行数:15,代码来源:HBaseSailFactory.java
示例6: repository
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
@Bean(name="repository", initMethod = "initialize",
destroyMethod = "shutDown")
public Repository repository(final Environment env)
throws RepositoryException, IOException, RDFParseException {
// For tets we use only in memory
Sail store = new MemoryStore();
return new SailRepository(store);
}
开发者ID:DTL-FAIRData,项目名称:FAIRDataPoint,代码行数:9,代码来源:RestApiTestContext.java
示例7: createGraph
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
@Override
public RDF4JGraph createGraph() {
final Sail sail = new MemoryStore();
final Repository repository = new SailRepository(sail);
repository.initialize();
return rdf4jFactory.asGraph(repository);
}
开发者ID:apache,项目名称:commons-rdf,代码行数:8,代码来源:MemoryGraphTest.java
示例8: createRepository
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
public void createRepository() throws IOException {
final Sail sail = new NativeStore(tempDir.newFolder());
repository = new SailRepository(sail);
repository.initialize();
}
开发者ID:apache,项目名称:commons-rdf,代码行数:6,代码来源:NativeStoreGraphTest.java
示例9: getSail
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
public Sail getSail(SailImplConfig sailImplConfig) throws SailConfigException {
return new VOIDInferencer();
}
开发者ID:semagrow,项目名称:semagrow,代码行数:4,代码来源:VOIDInferencerFactory.java
示例10: getSail
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
public Sail getSail(SailImplConfig sailImplConfig) throws SailConfigException {
return new SEVODInferencer();
}
开发者ID:semagrow,项目名称:semagrow,代码行数:4,代码来源:SEVODInferencerFactory.java
示例11: createDataset
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
/**
* {@inheritDoc}
* <p>
* <strong>Note:</strong> Some operations on the {@link RDF4JDataset}
* requires the use of try-with-resources to close underlying
* {@link RepositoryConnection}s, including {@link RDF4JDataset#iterate()},
* {@link RDF4JDataset#stream()} and {@link RDF4JDataset#getGraphNames()}.
*
*/
@Override
public RDF4JDataset createDataset() {
final Sail sail = new MemoryStore();
final Repository repository = new SailRepository(sail);
return rdf4j.createRepositoryDatasetImpl(repository, true, false);
}
开发者ID:apache,项目名称:commons-rdf,代码行数:16,代码来源:RDF4J.java
示例12: getSail
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
public Sail getSail(SailImplConfig sailImplConfig) throws SailConfigException {
assert sailImplConfig instanceof SemagrowSailConfig;
SemagrowSail sail = new SemagrowSail();
try {
SemagrowSailConfig config = (SemagrowSailConfig) sailImplConfig;
Repository metadata = createMetadataRepository(config.getMetadataConfig());
initializeMetadata( metadata, config.getInitialFiles() );
sail.setMetadataRepository(metadata);
SourceSelector selector =
(config.hasSelectorConfig()) ?
getSourceSelector(config.getSourceSelectorConfig()) :
getSourceSelector(metadata, config, config.getSourceSelectorConfig());
sail.setSourceSelector(selector);
CardinalityEstimatorResolver cardEstimator = getCardinalityEstimatorResolver(metadata, config);
CostEstimatorResolver costEstimator = new SimpleCostEstimatorResolver(cardEstimator);
sail.setCostEstimatorResolver(costEstimator);
sail.setCardinalityEstimatorResolver(cardEstimator);
sail.setBatchSize(config.getExecutorBatchSize());
return sail;
} catch (Exception e) {
throw new SailConfigException(e);
}
}
开发者ID:semagrow,项目名称:semagrow,代码行数:38,代码来源:SemagrowSailFactory.java
示例13: createSail
import org.eclipse.rdf4j.sail.Sail; //导入依赖的package包/类
protected abstract Sail createSail() throws Exception;
开发者ID:joshsh,项目名称:graphsail,代码行数:2,代码来源:SailTest.java
注:本文中的org.eclipse.rdf4j.sail.Sail类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论