@Override public ConceptId generate() { return ConceptId.of(gen(String.class)); } }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof IdProperty) { IdProperty that = (IdProperty) o; return (this.id.equals(that.id())); } return false; }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= this.id.hashCode(); return h; }
/** * The Graql compute path query run method * * @return a Answer containing the list of shortest paths */ private Stream<ConceptList> runComputePath() { ConceptId fromID = query.from().get(); ConceptId toID = query.to().get(); if (!scopeContainsInstances(fromID, toID)) throw GraqlQueryException.instanceDoesNotExist(); if (fromID.equals(toID)) return Stream.of(new ConceptList(ImmutableList.of(fromID))); Set<LabelId> scopedLabelIds = convertLabelsToIds(scopeTypeLabels()); ComputerResult result = compute(new ShortestPathVertexProgram(fromID, toID), null, scopedLabelIds); Multimap<ConceptId, ConceptId> pathsAsEdgeList = HashMultimap.create(); Map<String, Set<String>> resultFromMemory = result.memory().get(ShortestPathVertexProgram.SHORTEST_PATH); resultFromMemory.forEach((id, idSet) -> idSet.forEach(id2 -> { pathsAsEdgeList.put(ConceptId.of(id), ConceptId.of(id2)); })); List<List<ConceptId>> paths; if (!resultFromMemory.isEmpty()) { paths = getComputePathResultList(pathsAsEdgeList, fromID); if (scopeIncludesAttributes()) { paths = getComputePathResultListIncludingImplicitRelations(paths); } } else { paths = Collections.emptyList(); } return paths.stream().map(ConceptList::new); }
/** * * @param value The string which potentially represents a Concept * @return The matching concept ID */ @CheckReturnValue @JsonCreator public static ConceptId of(String value){ return new ConceptId(value); }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= this.tx.hashCode(); h *= 1000003; h ^= this.id.hashCode(); return h; }
public static ConceptId convert(GrpcConcept.ConceptId id) { return ConceptId.of(id.getValue()); }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= this.tx.hashCode(); h *= 1000003; h ^= this.id.hashCode(); return h; }
@Override public boolean equals(Object object) { if (this == object) return true; if (object == null || getClass() != object.getClass()) return false; return id().equals(((RelationshipImpl) object).id()); }
public ConnectedComponentVertexProgram(ConceptId sourceId) { this.persistentProperties.put(SOURCE, sourceId.getValue()); }
@Override public ConceptId visitId(GraqlParser.IdContext ctx) { return ConceptId.of(visitIdentifier(ctx.identifier())); }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= this.tx.hashCode(); h *= 1000003; h ^= this.id.hashCode(); return h; }
@Override public boolean equals(Object object) { if (this == object) return true; if (object == null || getClass() != object.getClass()) return false; ConceptImpl concept = (ConceptImpl) object; //based on id because vertex comparisons are equivalent return id().equals(concept.id()); }
@Override public boolean equals(Object o) { if (o == this) return true; if (o == null || this.getClass() != o.getClass()) return false; ConceptId that = (ConceptId) o; return (this.value.equals(that.getValue())); }
private <X extends Concept> X getOrBuildConcept(VertexElement element, Function<VertexElement, X> conceptBuilder){ ConceptId conceptId = ConceptId.of(element.property(Schema.VertexProperty.ID)); return getOrBuildConcept(element, conceptId, conceptBuilder); }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= this.tx.hashCode(); h *= 1000003; h ^= this.id.hashCode(); return h; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof RemoteRule) { RemoteRule that = (RemoteRule) o; return (this.tx.equals(that.tx())) && (this.id.equals(that.id())); } return false; }
@Override public boolean canOperateOnEdges() { return id().getValue().startsWith(Schema.PREFIX_EDGE); } }