public static NodeImpl createNode(Atom at) { return new NodeImpl(at); }
@Override public boolean equals(Object o) { if (o instanceof Node) { return equals((Node) o); // was same } return false; }
Variable getVariable() { if (edgeVariable != null) { return ((NodeImpl) edgeVariable).getAtom().getVariable(); } return null; }
public boolean equals(Node n) { if (isVariable() || n.isVariable()) { return sameVariable(n); } return getValue().equals(getValue(n)); }
Pipe(Graph g){ graph = g; exec = QueryProcess.create(graph); load = Load.create(graph); exec.setLoader(load); qNode = NodeImpl.createVariable(QNAME); tNode = NodeImpl.createVariable(TNAME); }
boolean sameVariable(Node n){ return isVariable() && n.isVariable() && getLabel().equals(n.getLabel()); }
@Override public boolean isBlank() { // TODO Auto-generated method stub return atom.isBlank() || (isVariable() && atom.getVariable().isBlankNode()); }
@Override public boolean isFuture() { return isConstant() && atom.getConstant().getDatatypeValue().isFuture(); }
public boolean equals(Node n) { if (isVariable() || n.isVariable()) { return sameVariable(n); } return getValue().equals(getValue(n)); }
/** * First param is query other param are variable bindings (variable, value) */ Mapping createMapping(Producer p, IDatatype[] param, int start) { ArrayList<Node> var = new ArrayList<Node>(); ArrayList<Node> val = new ArrayList<Node>(); for (int i = start; i < param.length; i += 2) { var.add(NodeImpl.createVariable(clean(param[i].getLabel()))); val.add(p.getNode(param[i + 1])); } return Mapping.create(var, val); }
boolean sameVariable(Node n){ return isVariable() && n.isVariable() && getLabel().equals(n.getLabel()); }
@Override public boolean isBlank() { // TODO Auto-generated method stub return atom.isBlank() || (isVariable() && atom.getVariable().isBlankNode()); }
@Override public boolean isFuture() { return isConstant() && atom.getConstant().getDatatypeValue().isFuture(); }
@Override public boolean same(Node n) { if (isVariable() || n.isVariable()) { return sameVariable(n); } return getValue().sameTerm(getValue(n)); //return compare(n) == 0; }
public static NodeImpl createNode(Atom at) { return new NodeImpl(at); }
/** * First param is query * other param are variable bindings (variable, value) */ Mapping createMapping(Producer p, IDatatype[] param, int start){ ArrayList<Node> var = new ArrayList<Node>(); ArrayList<Node> val = new ArrayList<Node>(); for (int i = start; i < param.length; i += 2){ var.add(NodeImpl.createVariable(clean(param[i].getLabel()))); val.add(p.getNode(param[i+1])); } return Mapping.create(var, val); }
Variable getVariable() { if (edgeVariable != null) { return ((NodeImpl) edgeVariable).getAtom().getVariable(); } return null; }
@Override public boolean equals(Object o) { if (o instanceof Node) { return equals((Node) o); // was same } return false; }