Class AbstractGraphOperation

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      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.
    • 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.InstanceGraph findNeighborhood​(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 String getEntityRefFromGraphTuple​(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.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.
    • Field Detail

      • startEntityGUID

        protected final String startEntityGUID
      • limitResultsByStatus

        protected final List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus
    • 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 XTDB
        startEntityGUID - unique identifier of the starting entity for the traversal
        limitResultsByStatus - list of statuses by which to limit results
        asOfTime - 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.RepositoryErrorException
        Find 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 retrieve
        entityTypeGUIDs - 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 entities
        level - the number of relationships out from the starting entity that
        includeRelationships - 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 repository
        org.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 database
        startingPoints - list of entity GUIDs from which we should start radiating outwards
        entityTypeGUIDs - 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 entities
        entityGUIDsVisited - set of unique identifiers of entities that have already been visited
        relationshipGUIDsVisited - 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 database
        entityGUID - of the entity for which to find immediate relationships
        entityTypeGUIDs - of the entity type definitions by which to restrict entities in the results
        relationshipTypeGUIDs - of the relationship type definitions by which to restrict relationships in the results
        limitResultsByStatus - by which to limit relationships
        limitResultsByClassification - 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 database
        xtdbResults - list of result tuples, e.g. from a neighborhood or other graph search
        entityGUIDsVisited - the list of entity GUIDs that have already been retrieved
        relationshipGUIDsVisited - the list of relationship GUIDs that have already been retrieved
        includeRelationships - whether to include relationships in the resulting graph (true) or not (false)
        Returns:
        InstanceGraph
      • getEntityRefFromGraphTuple

        protected String getEntityRefFromGraphTuple​(List<?> tuple)
        Retrieve the entity reference from the provided graph query result.
        Parameters:
        tuple - graph query result
        Returns:
        String reference for the entity