本文整理汇总了Java中de.fuberlin.wiwiss.d2rq.ResourceDescriber类的典型用法代码示例。如果您正苦于以下问题:Java ResourceDescriber类的具体用法?Java ResourceDescriber怎么用?Java ResourceDescriber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceDescriber类属于de.fuberlin.wiwiss.d2rq包,在下文中一共展示了ResourceDescriber类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import de.fuberlin.wiwiss.d2rq.ResourceDescriber; //导入依赖的package包/类
public void start() {
startupError = true;
if (config.isLocalMappingFile()) {
this.dataset = new AutoReloadableDataset(loader,
config.getLocalMappingFilename(),
config.getAutoReloadMapping());
} else {
this.dataset = new AutoReloadableDataset(loader, null, false);
}
if (loader.getMapping().configuration().getUseAllOptimizations()) {
log.info("Fast mode (all optimizations)");
} else {
log.info("Safe mode (launch using --fast to use all optimizations)");
}
// Set up a custom DescribeHandler that calls out to
// {@link ResourceDescriber}
DescribeHandlerRegistry.get().clear();
DescribeHandlerRegistry.get().add(new DescribeHandlerFactory() {
public DescribeHandler create() {
return new DescribeHandler() {
private BulkUpdateHandler adder;
public void start(Model accumulateResultModel,
Context qContext) {
adder = accumulateResultModel.getGraph()
.getBulkUpdateHandler();
}
public void describe(Resource resource) {
log.info("DESCRIBE <" + resource + ">");
boolean outgoingTriplesOnly = isVocabularyResource(resource)
&& !getConfig().getVocabularyIncludeInstances();
adder.add(new ResourceDescriber(getMapping(), resource
.asNode(), outgoingTriplesOnly,
Relation.NO_LIMIT,
Math.round(config.getSPARQLTimeout())).description());
}
public void finish() {
}
};
}
});
Registry.add(RDFServer.ServiceRegistryName,
createJosekiServiceRegistry());
if (config.getSPARQLTimeout() > 0) {
ARQ.getContext().set(ARQ.queryTimeout, config.getSPARQLTimeout() * 1000);
}
startupError = false;
}