public SimpleTriplePattern(BlankNodeOrIRI subject, Variable predicate, Variable object) { this(new ResourceOrVariable(subject), new UriRefOrVariable(predicate), new ResourceOrVariable(object)); }
@Override public int hashCode() { return (isVariable() ? 13 * getVariable().hashCode() + 7 : 13 * getResource().hashCode() + 7); } }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof PropertyPathPattern)) { return false; } final PropertyPathPattern other = (PropertyPathPattern) obj; if (!this.subject.equals(other.getSubject())) { return false; } if (!this.propertyPathExpression.equals(other.getPropertyPathExpression())) { return false; } if (!this.object.equals(other.getObject())) { return false; } return true; }
@Override public IRI getResource() { return (IRI)super.getResource(); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof TriplePattern)) { return false; } final TriplePattern other = (TriplePattern) obj; if (!this.subject.equals(other.getSubject())) { return false; } if (!this.predicate.equals(other.getPredicate())) { return false; } if (!this.object.equals(other.getObject())) { return false; } return true; }
@Override public IRI getResource() { return (IRI)super.getResource(); }
public SimplePropertyPathPattern(BlankNodeOrIRI subject, PropertyPathExpression propertyPathExpression, Variable object) { this(new ResourceOrVariable(subject), new PropertyPathExpressionOrVariable(propertyPathExpression), new ResourceOrVariable(object)); }
@Override public int hashCode() { return (isVariable() ? 13 * getVariable().hashCode() + 7 : 13 * getResource().hashCode() + 7); } }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof PropertyPathPattern)) { return false; } final PropertyPathPattern other = (PropertyPathPattern) obj; if (!this.subject.equals(other.getSubject())) { return false; } if (!this.propertyPathExpression.equals(other.getPropertyPathExpression())) { return false; } if (!this.object.equals(other.getObject())) { return false; } return true; }
public SimplePropertyPathPattern(Variable subject, Variable propertyPathExpression, RDFTerm object) { this(new ResourceOrVariable(subject), new PropertyPathExpressionOrVariable(propertyPathExpression), new ResourceOrVariable(object)); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof ResourceOrVariable)) { return false; } final ResourceOrVariable other = (ResourceOrVariable) obj; if (this.isVariable() != other.isVariable()) { return false; } if (this.isVariable()) { if (!this.getVariable().equals(other.getVariable())) { return false; } } else { if (!this.getResource().equals(other.getResource())) { return false; } } return true; }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof TriplePattern)) { return false; } final TriplePattern other = (TriplePattern) obj; if (!this.subject.equals(other.getSubject())) { return false; } if (!this.predicate.equals(other.getPredicate())) { return false; } if (!this.object.equals(other.getObject())) { return false; } return true; }
public SimpleTriplePattern(Variable subject, Variable predicate, Variable object) { this(new ResourceOrVariable(subject), new UriRefOrVariable(predicate), new ResourceOrVariable(object)); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof ResourceOrVariable)) { return false; } final ResourceOrVariable other = (ResourceOrVariable) obj; if (this.isVariable() != other.isVariable()) { return false; } if (this.isVariable()) { if (!this.getVariable().equals(other.getVariable())) { return false; } } else { if (!this.getResource().equals(other.getResource())) { return false; } } return true; }
public SimpleTriplePattern(Variable subject, IRI predicate, Variable object) { this(new ResourceOrVariable(subject), new UriRefOrVariable(predicate), new ResourceOrVariable(object)); }
private void appendResourceOrVariable(StringBuffer s, ResourceOrVariable n) { if (n.isVariable()) { appendVariable(s, n.getVariable()); } else { RDFTerm r = n.getResource(); if (r instanceof BlankNode) { s.append("_:").append(r.toString().replace("@", ".")); } else { s.append(r.toString()); } } }