本文整理汇总了Java中com.hp.hpl.jena.graph.query.BindingQueryPlan类的典型用法代码示例。如果您正苦于以下问题:Java BindingQueryPlan类的具体用法?Java BindingQueryPlan怎么用?Java BindingQueryPlan使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BindingQueryPlan类属于com.hp.hpl.jena.graph.query包,在下文中一共展示了BindingQueryPlan类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: prepareBindings
import com.hp.hpl.jena.graph.query.BindingQueryPlan; //导入依赖的package包/类
public BindingQueryPlan prepareBindings(GraphQuery q, Node[] variables) {
this.variables = variables;
this.indexes = new HashMap<Node,Integer>();
for (int i = 0; i < variables.length; i++) {
indexes.put(variables[i], new Integer(i));
}
BasicPattern pattern = new BasicPattern();
for (Triple t: q.getPattern()) {
pattern.add(t);
}
Plan plan = QueryEngineD2RQ.getFactory().create(new OpBGP(pattern), dataset, null, null);
final ExtendedIterator<Domain> queryIterator = new Map1Iterator<Binding,Domain>(new BindingToDomain(), plan.iterator());
return new BindingQueryPlan() {
public ExtendedIterator<Domain> executeBindings() {
return queryIterator;
}
};
}
开发者ID:d2rq,项目名称:r2rml-kit,代码行数:19,代码来源:D2RQQueryHandler.java
示例2: prepareBindings
import com.hp.hpl.jena.graph.query.BindingQueryPlan; //导入依赖的package包/类
public BindingQueryPlan prepareBindings(Query q, Node[] variables) {
this.variables = variables;
this.indexes = new HashMap<Node,Integer>();
for (int i = 0; i < variables.length; i++) {
indexes.put(variables[i], new Integer(i));
}
BasicPattern pattern = new BasicPattern();
for (Triple t: q.getPattern()) {
pattern.add(t);
}
Plan plan = QueryEngineD2RQ.getFactory().create(new OpBGP(pattern), dataset, null, null);
final ExtendedIterator<Domain> queryIterator = new Map1Iterator<Binding,Domain>(new BindingToDomain(), plan.iterator());
return new BindingQueryPlan() {
public ExtendedIterator<Domain> executeBindings() {
return queryIterator;
}
};
}
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:19,代码来源:D2RQQueryHandler.java
示例3: prepareBindings
import com.hp.hpl.jena.graph.query.BindingQueryPlan; //导入依赖的package包/类
/**
* <p>Method that prepares the bindings for a query plan</p>
* @param q - the input query
* @param variables - the variables in the given query
* @return a binding query plan
*
* @see de.fuberlin.wiwiss.d2rq.D2RQQueryHandler#prepareBindings(Query, Node[])
*/
@SuppressWarnings("unchecked")
public BindingQueryPlan prepareBindings(Query q, Node[] variables)
{
this.variables = variables;
this.indexes = new HashMap();
for (int i = 0; i < variables.length; i++) { indexes.put(variables[i], new Integer(i)); }
BasicPattern pattern = new BasicPattern();
Iterator it = q.getPattern().iterator();
while (it.hasNext())
{
Triple t = (Triple) it.next();
pattern.add(t);
}
Plan plan = QueryEngineD2RQ.getFactory().create(new OpBGP(pattern), dataset, null, null);
final ExtendedIterator queryIterator = new Map1Iterator(new BindingToDomain(), plan.iterator());
return new BindingQueryPlan()
{
public ExtendedIterator executeBindings() { return queryIterator; }
};
}
开发者ID:vaibhavkhadilkar,项目名称:D2RQ-Update,代码行数:29,代码来源:D2RQRWQueryHandler.java
示例4: graphBaseFind
import com.hp.hpl.jena.graph.query.BindingQueryPlan; //导入依赖的package包/类
@Override
protected ExtendedIterator graphBaseFind(TripleMatch m) {
int length = 0;
Node s = m.getMatchSubject();
Node p = m.getMatchPredicate();
Node o = m.getMatchObject();
if (s == null || s.equals(Node.ANY)) {
s = Node.createVariable("s");
length++;
}
if (p == null || p.equals(Node.ANY)) {
p = Node.createVariable("p");
length++;
}
if (o == null || o.equals(Node.ANY)) {
o = Node.createVariable("o");
length++;
}
// Check not already a variable.
Node[] variables = new Node[length];
int i = 0;
if (s.isVariable()) variables[i++] = s;
if (p.isVariable()) variables[i++] = p;
if (o.isVariable()) variables[i++] = o;
Triple t = new Triple(s,p,o) ;
com.hp.hpl.jena.graph.query.Query graphQuery = new com.hp.hpl.jena.graph.query.Query();
graphQuery.addMatch(t);
BindingQueryPlan plan = queryHandler().prepareBindings(graphQuery, variables);
ExtendedIterator iter = plan.executeBindings(); // Of domains
return new AnswerBindingIterator(iter, variables, t);
}
开发者ID:quoll,项目名称:mulgara,代码行数:37,代码来源:GraphMulgara.java
示例5: queryFor
import com.hp.hpl.jena.graph.query.BindingQueryPlan; //导入依赖的package包/类
/**
* <p>
* Answer the iterator over the resources from the graph that satisfy the given
* query, followed by the answers to the alternative queries (if specified). A
* typical scenario is that the main query gets resources of a given class (say,
* <code>rdfs:Class</code>), while the altQueries query for aliases for that
* type (such as <code>daml:Class</code>).
* </p>
*
* @param query A query to run against the model
* @param altQueries An optional list of subsidiary queries to chain on to the first
* @return ExtendedIterator An iterator over the (assumed single) results of
* executing the queries.
*/
public <T extends RDFNode> ExtendedIterator<T> queryFor( BindingQueryPlan query, List<BindingQueryPlan> altQueries, Class<T> asKey );
开发者ID:jacekkopecky,项目名称:parkjam,代码行数:16,代码来源:OntModel.java
注:本文中的com.hp.hpl.jena.graph.query.BindingQueryPlan类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论