/** Return as a triple when the path is a simple, 1-link, else return null */ public Triple asTriple() { if ( triple != null ) return triple ; if ( path instanceof P_Link ) triple = new Triple(subject, ((P_Link)path).getNode(), object) ; return triple ; }
public TriplePath(Node s, Path path, Node o) { this.subject = s ; this.object = o ; if ( path instanceof P_Link ) { this.predicate = ((P_Link)path).getNode() ; triple = new Triple(subject, this.predicate , o) ; } else this.predicate = null ; this.path = path ; }
public void visit(P_Link pathNode) { output(pathNode.getNode()) ; }
public TriplePath(Node s, Path path, Node o) { this.subject = s ; this.object = o ; if ( path instanceof P_Link ) { this.predicate = ((P_Link)path).getNode() ; triple = new Triple(subject, this.predicate , o) ; } else this.predicate = null ; this.path = path ; }
/** Return as a triple when the path is a simple, 1-link, else return null */ public Triple asTriple() { if ( triple != null ) return triple ; if ( path instanceof P_Link ) triple = new Triple(subject, ((P_Link)path).getNode(), object) ; return triple ; }
@Override public void visit(P_Link pathNode) { output(pathNode.getNode()) ; }
@Override public void visit(P_Link pathNode) { output(pathNode.getNode()) ; }
public void visit(P_Link pathNode) { output(pathNode.getNode()) ; }
public void visit(P_Link pathNode) { Iterator<Node> nodes = doOne(pathNode.getNode()) ; fill(nodes) ; }
public void visit(P_Link pathNode) { Iterator<Node> nodes = doOne(pathNode.getNode()) ; fill(nodes) ; }
@Override public void visit(P_Link pathNode) { Iterator<Node> nodes = engine.doOne(graph, node, pathNode.getNode()) ; fill(nodes) ; }
@Override public void visit(P_Link p) { try { List<Rule> rules = new LinkedList<Rule>(); Predicate newpred = new Predicate(idpPredicateGen.createNewVariable(), 2); if (p.getNode().isVariable() || p.getNode().isBlank()) { throw new UnsupportedOperationException("Unsupported property path expression: "+p); } assert p.getNode().isURI() : p.getNode(); VariableExpr x = new VariableExpr("X"); VariableExpr y = new VariableExpr("Y"); ConstantExpr propURI = new ConstantExpr(new URI(p.getNode().getURI())); rules.add(new Rule(new AtomicFormula(newpred, x, y), ruleid++, new AtomicFormula(triplePredicate, x, propURI, y))); result = rules; resultMainPredicate = newpred; } catch (URISyntaxException e) { throw new RuntimeException(e); } }
@Override public void visit(P_Link pathNode) { Op op = new OpTriple(new Triple(subject, pathNode.getNode(), object)) ; result = op ; }
@Override public void visit(P_Link p) { Triple t = new Triple(subject, p.getNode(), object); ElementTriplesBlock e = new ElementTriplesBlock(); e.addTriple(t); result = e; }
Node pred = ((P_Link)path).getNode() ; Triple t = new Triple(startNode, pred, endNode) ; x.add(new TriplePath(t)) ;
Node pred = ((P_Link)path).getNode() ; Triple t = new Triple(startNode, pred, endNode) ; x.add(new TriplePath(t)) ;