当前位置: 首页>>代码示例>>Java>>正文


Java Extension.getArg方法代码示例

本文整理汇总了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;
        }
    }
}
 
开发者ID:dkmfbk,项目名称:knowledgestore,代码行数:19,代码来源:SPARQLRenderer.java

示例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);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:11,代码来源:SparqlToPipelineTransformVisitor.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:56,代码来源:SparqlFluoQueryBuilder.java


注:本文中的org.openrdf.query.algebra.Extension.getArg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。