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