Class AbstractGraphOperation
- java.lang.Object
-
- org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractReadOperation
-
- org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractGraphOperation
-
- Direct Known Subclasses:
GetEntityNeighborhood,GetLinkingEntities,GetRelatedEntities
public abstract class AbstractGraphOperation extends AbstractReadOperation
Base class that all graph operations should implement.
-
-
Field Summary
Fields Modifier and Type Field Description protected List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus>limitResultsByStatusprotected StringstartEntityGUID-
Fields inherited from class org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractReadOperation
asOfTime, existingDB, xtdb
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractGraphOperation(XtdbOMRSRepositoryConnector xtdb, String startEntityGUID, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, Date asOfTime)Create a new search operation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<List<?>>findDirectNeighbors(xtdb.api.IXtdbDatasource db, String entityGUID, List<String> entityTypeGUIDs, List<String> relationshipTypeGUIDs, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification)Find the immediate neighbors (1-degree separated entities and the relationships between) using the provided criteria.protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceGraphfindNeighborhood(xtdb.api.IXtdbDatasource db, List<String> entityTypeGUIDs, List<String> relationshipTypeGUIDs, List<String> limitResultsByClassification, int level, boolean includeRelationships)Find the entities and relationships that radiate out from the supplied entity GUID.protected StringgetEntityRefFromGraphTuple(List<?> tuple)Retrieve the entity reference from the provided graph query result.protected Set<List<?>>getNextLevelNeighbors(xtdb.api.IXtdbDatasource db, List<String> startingPoints, List<String> entityTypeGUIDs, List<String> relationshipTypeGUIDs, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification, Set<String> entityGUIDsVisited, Set<String> relationshipGUIDsVisited)Find the entities and relationships that radiate out directly from the supplied list of entity GUIDs.protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceGraphresultsToGraph(xtdb.api.IXtdbDatasource db, Collection<List<?>> xtdbResults, Set<String> entityGUIDsVisited, Set<String> relationshipGUIDsVisited, boolean includeRelationships)Translate the collection of XTDB tuple results (from a graph query) into an Egeria InstanceGraph.-
Methods inherited from class org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractReadOperation
getXtdbObjectByReference
-
-
-
-
Constructor Detail
-
AbstractGraphOperation
protected AbstractGraphOperation(XtdbOMRSRepositoryConnector xtdb, String startEntityGUID, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, Date asOfTime)
Create a new search operation.- Parameters:
xtdb- connectivity to XTDBstartEntityGUID- unique identifier of the starting entity for the traversallimitResultsByStatus- list of statuses by which to limit resultsasOfTime- the point-in-time for which to retrieve results
-
-
Method Detail
-
findNeighborhood
protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceGraph findNeighborhood(xtdb.api.IXtdbDatasource db, List<String> entityTypeGUIDs, List<String> relationshipTypeGUIDs, List<String> limitResultsByClassification, int level, boolean includeRelationships) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityNotKnownException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorExceptionFind the entities and relationships that radiate out from the supplied entity GUID. The results are scoped by the provided type GUIDs, other limiters, and the level.- Parameters:
db- already-opened point-in-time view of the datasource from which to retrieveentityTypeGUIDs- list of entity types to include in the query results (null means include all)relationshipTypeGUIDs- list of relationship types to include in the query results (null means include all)limitResultsByClassification- list of classifications that must be present on all returned entitieslevel- the number of relationships out from the starting entity thatincludeRelationships- whether to include relationships in the resulting graph (true) or not (false)- Returns:
- InstanceGraph of the neighborhood
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityNotKnownException- if the starting point of the neighborhood traversals cannot be found in the repositoryorg.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- if any issue closing open XTDB resources, or if the query runs longer than the defined threshold (default: 30s)
-
getNextLevelNeighbors
protected Set<List<?>> getNextLevelNeighbors(xtdb.api.IXtdbDatasource db, List<String> startingPoints, List<String> entityTypeGUIDs, List<String> relationshipTypeGUIDs, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification, Set<String> entityGUIDsVisited, Set<String> relationshipGUIDsVisited) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryTimeoutException
Find the entities and relationships that radiate out directly from the supplied list of entity GUIDs. The results are scoped by the provided type GUIDs, other limiters, and the level.- Parameters:
db- already opened point-in-time view of the databasestartingPoints- list of entity GUIDs from which we should start radiating outwardsentityTypeGUIDs- list of entity types to include in the query results (null means include all)relationshipTypeGUIDs- list of relationship types to include in the query results (null means include all)limitResultsByStatus- list of statuses to restrict results (null means include all)limitResultsByClassification- list of classifications that must be present on all returned entitiesentityGUIDsVisited- set of unique identifiers of entities that have already been visitedrelationshipGUIDsVisited- set of unique identifiers of relationships that have already been visited- Returns:
Set<List<?>>of the immediate neighbors of the specified starting point GUIDs, as graph tuples [[:entityRef :relationshipRef]]- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryTimeoutException- if the query runs longer than the defined threshold (default: 30s)
-
findDirectNeighbors
protected Collection<List<?>> findDirectNeighbors(xtdb.api.IXtdbDatasource db, String entityGUID, List<String> entityTypeGUIDs, List<String> relationshipTypeGUIDs, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification) throws TimeoutException
Find the immediate neighbors (1-degree separated entities and the relationships between) using the provided criteria.- Parameters:
db- already opened point-in-view of the databaseentityGUID- of the entity for which to find immediate relationshipsentityTypeGUIDs- of the entity type definitions by which to restrict entities in the resultsrelationshipTypeGUIDs- of the relationship type definitions by which to restrict relationships in the resultslimitResultsByStatus- by which to limit relationshipslimitResultsByClassification- by which to limit the entities in the results- Returns:
Collection<List<?>>of tuples of relationships and entities found in the results- Throws:
TimeoutException- if the query runs longer than the defined threshold (default: 30s)
-
resultsToGraph
protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceGraph resultsToGraph(xtdb.api.IXtdbDatasource db, Collection<List<?>> xtdbResults, Set<String> entityGUIDsVisited, Set<String> relationshipGUIDsVisited, boolean includeRelationships)Translate the collection of XTDB tuple results (from a graph query) into an Egeria InstanceGraph.- Parameters:
db- already opened point-in-time view of the databasextdbResults- list of result tuples, e.g. from a neighborhood or other graph searchentityGUIDsVisited- the list of entity GUIDs that have already been retrievedrelationshipGUIDsVisited- the list of relationship GUIDs that have already been retrievedincludeRelationships- whether to include relationships in the resulting graph (true) or not (false)- Returns:
- InstanceGraph
-
-