1. A non-transitory computer readable storage medium, comprising executable instructions causing at least one computing system to: derive, from a database schema, an irreducible ambiguous group comprising a sub-schema with a set of vertices wherein any two vertices are part of a loop and have at least two minimal paths relating them in the sub-schema, the sub-schema specifying a subset of a graph of the database schema and comprising a list of boundary tables and a list of object tables, the boundary tables connecting the sub-schema to other parts of the database schema, the object tables being used to define objects in a semantic layer; receive user generated input designating joins in the sub-schema as excluded joins; and define a context of the sub-schema by: finding a tree that connects all boundary tables of the sub-schema plus all of the object tables of the sub-schema while excluding the excluded joins the tree specifying mandatory joins and neutral joins.