/** * Flatten the {@link QuadData} into a simple {@link ConstructNode}. The * {@link ConstructNode} MAY use variables as well as constants and supports * the context position, so this is really a quads construct template. * * @param template * The {@link ConstructNode} for the template. * * @return The argument. * * TODO Maybe we could just flatten this in UpdateExprBuilder? */ public ConstructNode flatten(final ConstructNode template) { final QuadData quadData = this; final Iterator<StatementPatternNode> itr = BOpUtility.visitAll( quadData, StatementPatternNode.class); while (itr.hasNext()) { final StatementPatternNode sp = (StatementPatternNode) (itr.next() .clone()); template.addChild(sp); } return template; }
/** * Flatten the {@link QuadData} into a simple {@link ConstructNode}. The * {@link ConstructNode} MAY use variables as well as constants and supports * the context position, so this is really a quads construct template. * * @param template * The {@link ConstructNode} for the template. * * @return The argument. * * TODO Maybe we could just flatten this in UpdateExprBuilder? */ public ConstructNode flatten(final ConstructNode template) { final QuadData quadData = this; final Iterator<StatementPatternNode> itr = BOpUtility.visitAll( quadData, StatementPatternNode.class); while (itr.hasNext()) { final StatementPatternNode sp = (StatementPatternNode) (itr.next() .clone()); template.addChild(sp); } return template; }
construct.addChild(new StatementPatternNode(new VarNode("s"), new ConstantNode(makeIV(valueFactory.createURI(RDF.TYPE .toString()))), new VarNode("o"), null/* c */,
construct.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS));
construct.addChild(new StatementPatternNode(new VarNode("s"), new ConstantNode(makeIV(valueFactory.createURI(RDF.TYPE .toString()))), new VarNode("o"), null/* c */,
.clone(); tmp.addChild(sp);
.clone(); tmp.addChild(sp);
construct.addChild(new StatementPatternNode(new VarNode("s"), new ConstantNode(makeIV(valueFactory.createURI(RDF.TYPE .toString()))), new VarNode("o"), null/* c */,
construct.addChild(new StatementPatternNode(new VarNode("s"), new ConstantNode(makeIV(valueFactory.createURI(RDF.TYPE .toString()))), new VarNode("o"), null/* c */,
construct.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS));
constructNode.addChild(new StatementPatternNode(new VarNode("x"), new ConstantNode(rdfType.getIV()), new ConstantNode( foafPerson.getIV()))); expected.setConstruct(constructNode); constructNode.addChild(new StatementPatternNode(new VarNode("x"), new ConstantNode(rdfType.getIV()), new ConstantNode( foafPerson.getIV())));
constructNode.addChild(new StatementPatternNode(new VarNode("x"), new ConstantNode(rdfType.getIV()), new ConstantNode( foafPerson.getIV()))); expected.setConstruct(constructNode); constructNode.addChild(new StatementPatternNode(new VarNode("x"), new ConstantNode(rdfType.getIV()), new ConstantNode( foafPerson.getIV())));
expected.setConstruct(constructNode); constructNode .addChild(new StatementPatternNode(term0, p0a, o0));
expected.setConstruct(constructNode); constructNode .addChild(new StatementPatternNode(term0, p0a, o0));
constructNode.addChild(new StatementPatternNode(new VarNode("x"), new ConstantNode(rdfType.getIV()), new ConstantNode( foafPerson.getIV()))); expected.setConstruct(constructNode); constructNode.addChild(new StatementPatternNode(new VarNode("x"), new ConstantNode(rdfType.getIV()), new ConstantNode( foafPerson.getIV())));