本文整理了Java中org.eclipse.rdf4j.query.algebra.Extension.getArg()
方法的一些代码示例,展示了Extension.getArg()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Extension.getArg()
方法的具体详情如下:
包路径:org.eclipse.rdf4j.query.algebra.Extension
类名称:Extension
方法名:getArg
暂无
代码示例来源:origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-spin
@Override
public void meet(Extension node)
throws RDFHandlerException
{
node.getArg().visit(this);
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-queryalgebra-evaluation
@Override
public void meet(Extension node) {
if (node.getArg().getBindingNames().containsAll(filterVars)) {
node.getArg().visit(this);
}
else {
relocate(filter, node);
}
}
代码示例来源:origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-queryalgebra-evaluation
@Override
public void meet(Extension node) {
if (node.getArg().getBindingNames().containsAll(filterVars)) {
node.getArg().visit(this);
}
else {
relocate(filter, node);
}
}
代码示例来源:origin: Merck/Halyard
}, extension.getArg(), bindings);
代码示例来源:origin: apache/incubator-rya
@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);
}
}
}
代码示例来源:origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-spin
@Override
public void meet(Extension node)
throws RDFHandlerException
{
if (inlineBindings != null && inlineBindings.extension == node) {
// this is the first Extension node and has already been handled
// by meetExtension()
// to produce inline bindings in SELECT so we can skip it here
node.getArg().visit(this);
}
else {
// any further Extension nodes produce BIND() clauses
node.getArg().visit(this);
for (ExtensionElem elem : node.getElements()) {
elem.visit(this);
}
}
}
代码示例来源:origin: apache/incubator-rya
@Override
public void meet(final MultiProjection node) throws TopologyBuilderException {
final String id = PROJECTION_PREFIX + UUID.randomUUID();
final Optional<Side> side = getSide(node);
final MultiProjectionProcessorSupplier supplier = new MultiProjectionProcessorSupplier(
MultiProjectionEvaluator.make(node, bNodeIdFactory),
result -> getResult(side, result));
// If the arg is an Extension, then this node's grandchild is the next processing node.
TupleExpr downstreamNode = node.getArg();
if (downstreamNode instanceof Extension) {
downstreamNode = ((Extension) downstreamNode).getArg();
}
entries.add(new ProcessorEntry(node, id, side, supplier, Lists.newArrayList(downstreamNode)));
idMap.put(node, id);
super.meet(node);
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-queryalgebra-evaluation
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Extension extension,
BindingSet bindings)
throws QueryEvaluationException
{
CloseableIteration<BindingSet, QueryEvaluationException> result;
try {
result = this.evaluate(extension.getArg(), bindings);
}
catch (ValueExprEvaluationException e) {
// a type error in an extension argument should be silently ignored
// and
// result in zero bindings.
result = new EmptyIteration<BindingSet, QueryEvaluationException>();
}
result = new ExtensionIterator(extension, result, this);
return result;
}
代码示例来源:origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-queryalgebra-evaluation
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Extension extension,
BindingSet bindings)
throws QueryEvaluationException
{
CloseableIteration<BindingSet, QueryEvaluationException> result;
try {
result = this.evaluate(extension.getArg(), bindings);
}
catch (ValueExprEvaluationException e) {
// a type error in an extension argument should be silently ignored
// and
// result in zero bindings.
result = new EmptyIteration<BindingSet, QueryEvaluationException>();
}
result = new ExtensionIterator(extension, result, this);
return result;
}
代码示例来源:origin: apache/incubator-rya
@Override
public void meet(final Projection node) throws TopologyBuilderException {
final String id = PROJECTION_PREFIX + UUID.randomUUID();
final Optional<Side> side = getSide(node);
// If the arg is an Extension, there are rebindings that need to be
// ignored since they do not have a processor node.
TupleExpr downstreamNode = node.getArg();
if (downstreamNode instanceof Extension) {
downstreamNode = ((Extension) downstreamNode).getArg();
}
final ProjectionProcessorSupplier supplier = new ProjectionProcessorSupplier(
ProjectionEvaluator.make(node),
result -> getResult(side, result));
entries.add(new ProcessorEntry(node, id, side, supplier, Lists.newArrayList(downstreamNode)));
idMap.put(node, id);
super.meet(node);
}
代码示例来源:origin: apache/incubator-rya
@Override
public void meet(Extension node) {
Set<String> argBindings = node.getArg().getBindingNames();
if (typeRequirement != null) {
node.getElements().removeIf(elem -> {
if (varName.equals(elem.getName())) {
ValueExpr expr = elem.getExpr();
if (expr == null) {
return true;
}
else if (expr instanceof Var) {
String fromName = ((Var) expr).getName();
if (getVarValue((Var) expr) == null && !argBindings.contains(fromName)) {
return true;
}
}
}
return false;
});
meetUnaryTupleOperator(node);
}
}
@Override
代码示例来源:origin: apache/incubator-rya
if(extension.getArg() instanceof Group) {
child = extension;
} else {
child = extension.getArg();
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-sail-lucene-api
@Override
public void updateQueryModelNodes(boolean hasResult) {
QueryModelNode replacementNode = hasResult ? new SingletonSet() : new EmptySet();
geoStatement.replaceWith(replacementNode);
if (hasResult) {
filter.replaceWith(filter.getArg());
}
else {
filter.replaceWith(new EmptySet());
}
if (functionParent instanceof ExtensionElem) {
Extension extension = (Extension)functionParent.getParentNode();
List<ExtensionElem> elements = extension.getElements();
if (elements.size() > 1) {
elements.remove(functionParent);
}
else {
extension.replaceWith(extension.getArg());
}
}
}
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-sail-lucene-api
@Override
public void updateQueryModelNodes(boolean hasResult) {
QueryModelNode replacementNode = hasResult ? new SingletonSet() : new EmptySet();
geoStatement.replaceWith(replacementNode);
if (hasResult) {
filter.replaceWith(filter.getArg());
}
else {
filter.replaceWith(new EmptySet());
}
QueryModelNode functionParent = distanceFunction.getParentNode();
if (functionParent instanceof ExtensionElem) {
Extension extension = (Extension)functionParent.getParentNode();
List<ExtensionElem> elements = extension.getElements();
if (elements.size() > 1) {
elements.remove(functionParent);
}
else {
extension.replaceWith(extension.getArg());
}
}
}
代码示例来源:origin: apache/incubator-rya
final TupleExpr arg = node.getArg();
if(arg instanceof Group) {
final Group group = (Group) arg;
代码示例来源:origin: ontop/ontop
TranslationResult sub = translate(extension.getArg());
final Stream<ExtensionElem> nontrivialBindings = extension.getElements().stream()
代码示例来源:origin: apache/incubator-rya
@Test
public void testUnsupportedExtension() throws Exception {
StatementPattern sp = new StatementPattern(new Var("x"), constant(TAKES), new Var("c"));
List<ExtensionElem> elements = Arrays.asList(new ExtensionElem(new Var("x"), "renamed"),
new ExtensionElem(new Not(new ValueConstant(VF.createLiteral(true))), "notTrue"),
new ExtensionElem(new ValueConstant(TAKES), "constant"));
Extension extensionNode = new Extension(sp, elements);
QueryRoot queryTree = new QueryRoot(extensionNode);
SparqlToPipelineTransformVisitor visitor = new SparqlToPipelineTransformVisitor(collection);
queryTree.visit(visitor);
Assert.assertTrue(queryTree.getArg() instanceof Extension);
Assert.assertEquals(elements, ((Extension) queryTree.getArg()).getElements());
TupleExpr innerQuery = ((Extension) queryTree.getArg()).getArg();
Assert.assertTrue(innerQuery instanceof AggregationPipelineQueryNode);
AggregationPipelineQueryNode pipelineNode = (AggregationPipelineQueryNode) innerQuery;
Assert.assertEquals(Sets.newHashSet("x", "c"), pipelineNode.getAssuredBindingNames());
}
}
内容来源于网络,如有侵权,请联系作者删除!