本文整理汇总了Java中org.openrdf.query.parser.ParsedBooleanQuery类的典型用法代码示例。如果您正苦于以下问题:Java ParsedBooleanQuery类的具体用法?Java ParsedBooleanQuery怎么用?Java ParsedBooleanQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParsedBooleanQuery类属于org.openrdf.query.parser包,在下文中一共展示了ParsedBooleanQuery类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getQueryTask
import org.openrdf.query.parser.ParsedBooleanQuery; //导入依赖的package包/类
public QueryTask getQueryTask(QueryDefinition query,
WriterConfig config, OutputStream out)
throws MalformedQueryException, RepositoryException {
QueryParser parser = new SPARQLParserFactory().getParser();
ParsedQuery parsedQuery = parser.parseQuery(query.getQuery(),
config.getBaseUri());
RepositoryConnection conn = cf.getConnection();
try {
if (parsedQuery instanceof ParsedTupleQuery) {
return new TupleQueryTask(conn, query, config, out);
} else if (parsedQuery instanceof ParsedBooleanQuery) {
return new AskQueryTask(conn, query, config, out);
} else if (parsedQuery instanceof ParsedGraphQuery) {
return new GraphQueryTask(conn, query, config, out);
}
} finally {
// conn.close();
}
throw new MalformedQueryException("Unknown query type: "
+ ParsedQuery.class.getName());
}
开发者ID:erfgoed-en-locatie,项目名称:artsholland-platform,代码行数:22,代码来源:QueryService.java
示例2: prepareQuery
import org.openrdf.query.parser.ParsedBooleanQuery; //导入依赖的package包/类
@Override
public Query prepareQuery(QueryLanguage ql, String query, String baseURI)
throws RepositoryException, MalformedQueryException
{
validateQueryLanguage(ql);
ParsedQuery parsedQuery = QueryParserUtil.parseQuery(QueryLanguage.SPARQL, query, baseURI);
if (parsedQuery instanceof ParsedTupleQuery) {
return prepareTupleQuery(ql, query, baseURI);
}
else if (parsedQuery instanceof ParsedBooleanQuery) {
return prepareBooleanQuery(ql, query, baseURI);
}
else if (parsedQuery instanceof ParsedGraphQuery) {
return prepareGraphQuery(ql, query, baseURI);
}
throw new MalformedQueryException("Unrecognized query type:\n" + query); //$NON-NLS-1$
}
开发者ID:obidea,项目名称:semantika-endpoint,代码行数:19,代码来源:SemantikaRepositoryConnection.java
示例3: getExprQuery
import org.openrdf.query.parser.ParsedBooleanQuery; //导入依赖的package包/类
/**
* Creates a new query based on a tuple expression and original query. The
* new query will have the same type null
* ({@link org.openrdf.query.TupleQuery},
* {@link org.openrdf.query.GraphQuery} or
* {@link org.openrdf.query.BooleanQuery}) as the given original query.
*
* @param orig the original query
* @param expr the expression used for the new query
* @return new query based on expression
*/
protected Query getExprQuery(ParsedQuery orig, TupleExpr expr) {
if (orig instanceof ParsedTupleQuery) {
return new SailTupleExprQuery(
new ParsedTupleQuery(expr), conn);
} else if (orig instanceof ParsedGraphQuery) {
return new SailGraphExprQuery(
new ParsedGraphQuery(expr), conn);
} else {
return new SailBooleanExprQuery(
new ParsedBooleanQuery(expr), conn);
}
}
开发者ID:lszeremeta,项目名称:neo4j-sparql-extension-yars,代码行数:24,代码来源:QueryRewriter.java
示例4: getQueryType
import org.openrdf.query.parser.ParsedBooleanQuery; //导入依赖的package包/类
public QueryType getQueryType(ParsedQuery parsedQuery) {
if (parsedQuery instanceof ParsedTupleQuery) {
return QueryType.SELECT;
} else if (parsedQuery instanceof ParsedBooleanQuery) {
return QueryType.ASK;
} else if (parsedQuery instanceof ParsedGraphQuery) {
return QueryType.CONSTRUCT;
} else {
return null;
}
}
开发者ID:erfgoed-en-locatie,项目名称:artsholland-platform,代码行数:12,代码来源:QueryService.java
示例5: SailBooleanExprQuery
import org.openrdf.query.parser.ParsedBooleanQuery; //导入依赖的package包/类
public SailBooleanExprQuery(ParsedBooleanQuery booleanQuery, SailRepositoryConnection sailConnection) {
super(booleanQuery, sailConnection);
}
开发者ID:lszeremeta,项目名称:neo4j-sparql-extension-yars,代码行数:4,代码来源:SailBooleanExprQuery.java
示例6: isBooleanQuery
import org.openrdf.query.parser.ParsedBooleanQuery; //导入依赖的package包/类
public boolean isBooleanQuery() {
return query instanceof ParsedBooleanQuery;
}
开发者ID:anno4j,项目名称:anno4j,代码行数:4,代码来源:SparqlQuery.java
注:本文中的org.openrdf.query.parser.ParsedBooleanQuery类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论