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