本文整理汇总了Java中com.hp.hpl.jena.query.Query.isConstructType方法的典型用法代码示例。如果您正苦于以下问题:Java Query.isConstructType方法的具体用法?Java Query.isConstructType怎么用?Java Query.isConstructType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hp.hpl.jena.query.Query
的用法示例。
在下文中一共展示了Query.isConstructType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sparqlConstruct
import com.hp.hpl.jena.query.Query; //导入方法依赖的package包/类
@Override
public ClosableIterable<Statement> sparqlConstruct(String queryString)
throws ModelRuntimeException {
assertModel();
Query query = QueryFactory.create(queryString);
QueryExecution qexec = QueryExecutionFactory.create(query, this.jenaModel);
if(query.isConstructType()) {
com.hp.hpl.jena.rdf.model.Model m = qexec.execConstruct();
Model resultModel = new ModelImplJena(null, m, Reasoning.none);
resultModel.open();
return resultModel;
} else {
throw new RuntimeException("Cannot handle this type of queries! Please use CONSTRUCT.");
}
}
示例2: queryConstruct
import com.hp.hpl.jena.query.Query; //导入方法依赖的package包/类
@Override
public ClosableIterable<Statement> queryConstruct(String query,
String querylanguage) throws QueryLanguageNotSupportedException,
MalformedQueryException, ModelRuntimeException {
Query jenaQuery = QueryFactory.create(query);
QueryExecution qexec = QueryExecutionFactory.create(jenaQuery,
this.dataset);
if (jenaQuery.isConstructType()) {
com.hp.hpl.jena.rdf.model.Model m = qexec.execConstruct();
Model resultModel = new ModelImplJena(null, m, Reasoning.none);
resultModel.open();
return resultModel;
} else {
throw new RuntimeException(
"Cannot handle this type of query! Please use CONSTRUCT.");
}
}
示例3: sparqlConstruct
import com.hp.hpl.jena.query.Query; //导入方法依赖的package包/类
@Override
public ClosableIterable<Statement> sparqlConstruct(String query)
throws ModelRuntimeException, MalformedQueryException {
Query jenaQuery = QueryFactory.create(query);
QueryExecution qexec = QueryExecutionFactory.create(jenaQuery,
this.dataset);
if (jenaQuery.isConstructType()) {
com.hp.hpl.jena.rdf.model.Model m = qexec.execConstruct();
Model resultModel = new ModelImplJena(null, m, Reasoning.none);
resultModel.open();
return resultModel;
} else {
throw new RuntimeException(
"Cannot handle this type of query! Please use CONSTRUCT.");
}
}
示例4: registerConstructQuery
import com.hp.hpl.jena.query.Query; //导入方法依赖的package包/类
/**
* register the construct-type query with the engine
*
* @param query
* @return
*/
public ContinuousConstruct registerConstructQuery(Query query) {
OpRouter qR = generateRoutingPolicy(query);
if (query.isConstructType()) {
///TODO
ContinuousConstruct rootRouter = (ContinuousConstruct) addRouter(qR,
new ContinuousConstruct(context, query, qR));
return rootRouter;
}
return null;
}