use of org.eclipse.rdf4j.query.parser.serql.ast.ASTEdge in project rdf4j by eclipse.
the class AnonymousVarGenerator method visit.
@Override
public Object visit(ASTReifiedStat node, Object data) throws VisitorException {
if (node.jjtGetChild(0) instanceof ASTEdge) {
// subject node is missing
ASTNodeElem nodeElem = createNodeElem();
nodeElem.jjtSetParent(node);
node.jjtInsertChild(nodeElem, 0);
}
if (node.jjtGetNumChildren() <= 2) {
// object node is missing
ASTNodeElem nodeElem = createNodeElem();
nodeElem.jjtSetParent(node);
node.jjtAppendChild(nodeElem);
}
if (node.getID() == null) {
node.setID(createAnonymousVar());
}
return super.visit(node, data);
}
Aggregations