本文整理汇总了Java中org.openrdf.query.algebra.Extension.getArg方法的典型用法代码示例。如果您正苦于以下问题:Java Extension.getArg方法的具体用法?Java Extension.getArg怎么用?Java Extension.getArg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openrdf.query.algebra.Extension
的用法示例。
在下文中一共展示了Extension.getArg方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: meet
import org.openrdf.query.algebra.Extension; //导入方法依赖的package包/类
@Override
public void meet(final Extension n) {
emit(n.getArg());
if (!(n.getArg() instanceof SingletonSet)) {
newline();
}
boolean first = true;
for (final ExtensionElem e : n.getElements()) {
final ValueExpr expr = e.getExpr();
if (!(expr instanceof Var) || !((Var) expr).getName().equals(e.getName())) {
if (!first) {
newline();
}
emit("BIND (").emit(expr).emit(" AS ?").emit(e.getName()).emit(")");
first = false;
}
}
}
示例2: meet
import org.openrdf.query.algebra.Extension; //导入方法依赖的package包/类
@Override
public void meet(Extension extensionNode) throws Exception {
extensionNode.visitChildren(this);
if (extensionNode.getArg() instanceof AggregationPipelineQueryNode && extensionNode.getParentNode() != null) {
AggregationPipelineQueryNode pipelineNode = (AggregationPipelineQueryNode) extensionNode.getArg();
if (pipelineNode.extend(extensionNode.getElements())) {
extensionNode.replaceWith(pipelineNode);
}
}
}
示例3: meet
import org.openrdf.query.algebra.Extension; //导入方法依赖的package包/类
@Override
public void meet(final Reduced node) {
//create id, initialize ConstructQueryMetadata builder, register ConstructQueryMetadata
//builder with FluoQueryBuilder, and add metadata that we currently have
final String constructId = nodeIds.getOrMakeId(node);
ConstructQueryMetadata.Builder constructBuilder = fluoQueryBuilder.getConstructQueryBuilder().orNull();
if(constructBuilder == null) {
constructBuilder = ConstructQueryMetadata.builder();
constructBuilder.setNodeId(constructId);
fluoQueryBuilder.setConstructQueryMetadata(constructBuilder);
}
//get child node
QueryModelNode child = node.getArg();
Preconditions.checkArgument(child instanceof Projection || child instanceof MultiProjection);
final UnaryTupleOperator unary = (UnaryTupleOperator) child;
//get ProjectionElemList to build ConstructGraph
final List<ProjectionElemList> projections = new ArrayList<>();
if(unary instanceof Projection) {
projections.add(((Projection) unary).getProjectionElemList());
} else {
projections.addAll(((MultiProjection)unary).getProjections());
}
//get ExtensionElems to build ConstructGraph
final QueryModelNode grandChild = unary.getArg();
Preconditions.checkArgument(grandChild instanceof Extension);
final Extension extension = (Extension) grandChild;
final List<ExtensionElem> extensionElems = extension.getElements();
final ConstructGraph graph = getConstructGraph(projections, extensionElems);
constructBuilder.setConstructGraph(graph);
//set child to the next node we care about in Fluo
//if Extension's arg is a Group node, then it is an Aggregation, so set child to Extension
//otherwise set child to Extension's child (only care about Extensions if they are Aggregations)
if(extension.getArg() instanceof Group) {
child = extension;
} else {
child = extension.getArg();
}
//Set the child node in the ConstructQueryMetadataBuilder
final String childNodeId = nodeIds.getOrMakeId(child);
constructBuilder.setChildNodeId(childNodeId);
// Update the child node's metadata.
final Set<String> childVars = getVars((TupleExpr)child);
final VariableOrder childVarOrder = new VariableOrder(childVars);
setChildMetadata(fluoQueryBuilder, childNodeId, childVarOrder, constructId);
//fast forward visitor to next node we care about
child.visit(this);
}