Class PossibleMappingsCalculator

    • Constructor Detail

      • PossibleMappingsCalculator

        public PossibleMappingsCalculator​(SchemaGraph sourceGraph,
                                          SchemaGraph targetGraph,
                                          graphql.schema.diffing.SchemaDiffingRunningCheck runningCheck)
    • Method Detail

      • getFixedParentRestrictions

        public java.util.Map<Vertex,​Vertex> getFixedParentRestrictions()
      • getFixedParentRestrictionsInverse

        public java.util.Map<Vertex,​Vertex> getFixedParentRestrictionsInverse​(java.util.Map<Vertex,​Vertex> fixedOneToOneMappingsInverted)
      • getNonFixedParentRestrictions

        public java.util.Map<Vertex,​Vertex> getNonFixedParentRestrictions​(SchemaGraph sourceGraph,
                                                                                SchemaGraph targetGraph,
                                                                                Mapping mapping)
        This computes the initial set of parent restrictions based on the given non-fixed mapping.

        i.e. this introduces restrictions as the Mapping is being built, as decisions can have knock on effects on other vertices' possible mappings.

        See Mapping for definition of fixed vs non-fixed.

        If a Vertex is present in the output Map then the value is the parent the vertex MUST map to.

        e.g. for an output {collar: Dog} then the collar vertex must be a child of Dog in the mapping.

        Parameters:
        mapping - the mapping to get non-fixed parent restrictions for
        sourceGraph - the source graph
        targetGraph - the target graph
        Returns:
        Map where key is any vertex, and the value is the parent that vertex must map to
      • hasParentRestrictions

        public static boolean hasParentRestrictions​(Vertex vertex)
      • hasChildrenRestrictions

        public static boolean hasChildrenRestrictions​(Vertex vertex)