/** * @param predicate predicate to check for inclusion * @return true if the predicate IRI is not in the set of predicates that should be skipped from * blank node reuse analysis. */ private static boolean notInSkippedPredicates(RDFResourceIRI predicate) { return !skippedPredicates.contains(predicate.getIRI()); }
@Override public RDFNode visit(IRI iri) { return new RDFResourceIRI(iri); }
@Override public int hashCode() { return subject.hashCode() * 37 + predicate.hashCode() * 17 + object.hashCode(); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj instanceof RDFTriple) { RDFTriple other = (RDFTriple) obj; return subject.equals(other.subject) && predicate.equals(other.predicate) && object.equals(other.object); } // Commons RDF Triple.equals() contract if (obj instanceof Triple) { // Note: This also works on RDFLiteral // but is slightly more expensive as it must call the // getter methods when accessing obj. // // To ensure future compatibility, the Commons RDF getter // methods are also called on this rather than using the fields. Triple triple = (Triple) obj; return getSubject().equals(triple.getSubject()) && getPredicate().equals(triple.getPredicate()) && getObject().equals(triple.getObject()); } return false; }
@Override public String getNodeIDValue() { throw new UnsupportedOperationException( "RDFResource " + toString() + " is not a blank node; nodeId not defined."); } }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj instanceof RDFResourceIRI) { RDFResourceIRI other = (RDFResourceIRI) obj; return resource.equals(other.resource); } // Commons RDF IRI equals() contract if (obj instanceof org.apache.commons.rdf.api.IRI) { org.apache.commons.rdf.api.IRI iri = (org.apache.commons.rdf.api.IRI) obj; return ntriplesString().equals(iri.ntriplesString()); } return false; }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj instanceof RDFTriple) { RDFTriple other = (RDFTriple) obj; return subject.equals(other.subject) && predicate.equals(other.predicate) && object.equals(other.object); } // Commons RDF Triple.equals() contract if (obj instanceof Triple) { // Note: This also works on RDFLiteral // but is slightly more expensive as it must call the // getter methods when accessing obj. // // To ensure future compatibility, the Commons RDF getter // methods are also called on this rather than using the fields. Triple triple = (Triple) obj; return getSubject().equals(triple.getSubject()) && getPredicate().equals(triple.getPredicate()) && getObject().equals(triple.getObject()); } return false; }
@Override public String getNodeIDValue() { throw new UnsupportedOperationException( "RDFResource " + toString() + " is not a blank node; nodeId not defined."); } }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj instanceof RDFResourceIRI) { RDFResourceIRI other = (RDFResourceIRI) obj; return resource.equals(other.resource); } // Commons RDF IRI equals() contract if (obj instanceof org.apache.commons.rdf.api.IRI) { org.apache.commons.rdf.api.IRI iri = (org.apache.commons.rdf.api.IRI) obj; return ntriplesString().equals(iri.ntriplesString()); } return false; }
@Override protected RDFResourceIRI getPredicateNode(IRI uri) { return new RDFResourceIRI(uri); }
/** * @param predicate predicate to check for inclusion * @return true if the predicate IRI is not in the set of predicates that should be skipped from * blank node reuse analysis. */ private static boolean notInSkippedPredicates(RDFResourceIRI predicate) { return !skippedPredicates.contains(predicate.getIRI()); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj instanceof RDFTriple) { RDFTriple other = (RDFTriple) obj; return subject.equals(other.subject) && predicate.equals(other.predicate) && object.equals(other.object); } // Commons RDF Triple.equals() contract if (obj instanceof Triple) { // Note: This also works on RDFLiteral // but is slightly more expensive as it must call the // getter methods when accessing obj. // // To ensure future compatibility, the Commons RDF getter // methods are also called on this rather than using the fields. Triple triple = (Triple) obj; return getSubject().equals(triple.getSubject()) && getPredicate().equals(triple.getPredicate()) && getObject().equals(triple.getObject()); } return false; }
@Override public String getNodeIDValue() { throw new UnsupportedOperationException( "RDFResource " + toString() + " is not a blank node; nodeId not defined."); } }
@Override public int hashCode() { return subject.hashCode() * 37 + predicate.hashCode() * 17 + object.hashCode(); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj instanceof RDFResourceIRI) { RDFResourceIRI other = (RDFResourceIRI) obj; return resource.equals(other.resource); } // Commons RDF IRI equals() contract if (obj instanceof org.apache.commons.rdf.api.IRI) { org.apache.commons.rdf.api.IRI iri = (org.apache.commons.rdf.api.IRI) obj; return ntriplesString().equals(iri.ntriplesString()); } return false; }
@Override protected RDFResourceIRI getResourceNode(IRI uri) { return new RDFResourceIRI(uri); }
/** * @param predicate predicate to check for inclusion * @return true if the predicate IRI is not in the set of predicates that should be skipped from * blank node reuse analysis. */ private static boolean notInSkippedPredicates(RDFResourceIRI predicate) { return !skippedPredicates.contains(predicate.getIRI()); }
RDFNode object = triple.getObject(); if (lastSubject != null && (subj.equals(lastSubject) || subj.isAnonymous())) { if (lastPredicate != null && pred.equals(lastPredicate)) {
@Override public int hashCode() { return subject.hashCode() * 37 + predicate.hashCode() * 17 + object.hashCode(); }
@Override protected RDFResourceIRI getResourceNode(@Nonnull IRI iri) { return new RDFResourceIRI(iri); } }