(g: SemanticGraph)
return groundings
Construct groudnings based on the wikidata scheme.

    :param g:
    :return:
    >>> len(get_all_groundings(SemanticGraph([Edge(leftentityid=QUESTION_VAR, rightentityid='Q571', qualifierentityid='MAX')])))
    365
    >>> len(get_all_groundings(SemanticGraph([Edge(leftentityid=QUESTION_VAR, rightentityid='Q571'), Edge(leftentityid=QUESTION_VAR, rightentityid='Q5')])))
    133225
Construct groudnings based on the wikidata scheme.
Construct groudnings based on the wikidata scheme .
def get_all_groundings(g: SemanticGraph):
    """
    Construct groudnings based on the wikidata scheme.

    :param g:
    :return:
    >>> len(get_all_groundings(SemanticGraph([Edge(leftentityid=QUESTION_VAR, rightentityid='Q571', qualifierentityid='MAX')])))
    365
    >>> len(get_all_groundings(SemanticGraph([Edge(leftentityid=QUESTION_VAR, rightentityid='Q571'), Edge(leftentityid=QUESTION_VAR, rightentityid='Q5')])))
    133225
    """
    variables = set()

    for i, edge in enumerate(g.edges):
        if not edge.grounded:
            variables.add(f"r{edge.edgeid:d}v")
    groundings = [[(v, r+"v") for r in scheme.frequent_properties] for v in variables]
    groundings = [dict(p) for p in itertools.product(*groundings)]
    return groundings
def get_all_groundings ( g : SemanticGraph ) : variables = set ( ) for i , edge in enumerate ( g . edges ) : if not edge . grounded : variables . add ( f"r{edge.edgeid:d}v" ) groundings = [ [ ( v , r + "v" ) for r in scheme . frequent_properties ] for v in variables ] groundings = [ dict ( p ) for p in itertools . product ( * groundings ) ] return groundings