public static Path pathLink(Node property) { return new P_Link(property) ; }
/** 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 ; }
/** 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 static Path pathLink(Node property) { return new P_Link(property) ; }
@Override public void visit(P_Link pathNode) { output(pathNode.getNode()) ; }
@Override public Path make(ItemList list) { BuilderLib.checkLength(2, 2, list, "path link: wanted 1 argument") ; return new P_Link(list.get(1).getNode()) ; } };
@Override public void visit(P_Link pathNode) { output(pathNode.getNode()) ; }
@Override public Var evaluate(NodeSelector nodeSelector, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) { ReversePropertySelector reversePropertySelector = (ReversePropertySelector) nodeSelector; Var id = Var.alloc(VarIDGenerator.createID()); ElementPathBlock epb = new ElementPathBlock(); epb.addTriple(new TriplePath(var.asNode(), new P_Inverse(new P_Link(NodeFactory.createURI(reversePropertySelector.getProperty().toString()))), id.asNode())); ElementGroup group = new ElementGroup(); group.addElement(epb); elementGroup.addElement(group); return id; } }
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 ; }
triplePath = new TriplePath(var.asNode(), new P_ZeroOrMore1(new P_Link(NodeFactory.createURI(strippedPathExpression))), id.asNode()); } else if (pathExpression.contains("+")) { triplePath = new TriplePath(var.asNode(), new P_OneOrMore1(new P_Link(NodeFactory.createURI(strippedPathExpression))), id.asNode()); } else { throw new IllegalStateException("Only ZeroOrMorePath(*), OneOrMorePath(+) path selectors are currently supported.");
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 ; }
private Path build(Item item) { if (item.isNode() ) { if ( item.getNode().isURI() ) return new P_Link(item.getNode()) ; BuilderLib.broken(item, "Attempt to build path from a plain node") ; } if (item.isSymbol() ) BuilderLib.broken(item, "Attempt to build path from a bare symbol") ; return build(item.getList()) ; }
public void visit(P_Link pathNode) { output(pathNode.getNode()) ; }
private Path build(Item item) { if (item.isNode() ) { if ( item.getNode().isURI() ) return new P_Link(item.getNode()) ; BuilderLib.broken(item, "Attempt to build path from a plain node") ; } if (item.isSymbol() ) BuilderLib.broken(item, "Attempt to build path from a bare symbol") ; return build(item.getList()) ; }
public void visit(P_Link pathNode) { output(pathNode.getNode()) ; }
public static QueryIterator execTriplePath(Binding binding, TriplePath triplePath, ExecutionContext execCxt) { if ( triplePath.isTriple() ) { // Fake it. This happens only for API constructed situations. Path path = new P_Link(triplePath.getPredicate()) ; triplePath = new TriplePath(triplePath.getSubject(), path, triplePath.getObject()) ; } return execTriplePath(binding, triplePath.getSubject(), triplePath.getPath(), triplePath.getObject(), execCxt) ; }
public void visit(P_Link pathNode) { Iterator<Node> nodes = doOne(pathNode.getNode()) ; fill(nodes) ; }
public static QueryIterator execTriplePath(Binding binding, TriplePath triplePath, ExecutionContext execCxt) { if ( triplePath.isTriple() ) { // Fake it. This happens only for API constructed situations. Path path = new P_Link(triplePath.getPredicate()) ; triplePath = new TriplePath(triplePath.getSubject(), path, triplePath.getObject()) ; } return execTriplePath(binding, triplePath.getSubject(), triplePath.getPath(), triplePath.getObject(), execCxt) ; }
@Override public void visit(P_Link pathNode) { Iterator<Node> nodes = engine.doOne(graph, node, pathNode.getNode()) ; fill(nodes) ; }
public TriplePath(Triple triple) { this.subject = triple.getSubject() ; // Canonicalise: A triple and a path with a using P_Link of a URI Node p = triple.getPredicate() ; if ( p.isURI() ) { this.path = new P_Link(triple.getPredicate()) ; this.predicate = p ; } else { this.path = null ; this.predicate = triple.getPredicate() ; } // this.path = null ; // this.predicate = triple.getPredicate() ; this.object = triple.getObject() ; this.triple = triple ; if ( triple.getPredicate() == null ) Log.warn(this, "Triple predicate is null") ; }