(g: SemanticGraph)
return new_g
Adds an implicit graph otherwise a copy of the original graph is returned.
    
    :param g: a graph with a non-empty 'entities' list
    :return: a list of suggested graphs
    >>> with_denotation_class_edge(SemanticGraph())
    [SemanticGraph([Edge(0, ?qvar-iclass->None)])]
import grounding.graph_queries    >>> add_denotation_class_edge(SemanticGraph([Edge(leftentityid=grounding.graph_queries.QUESTION_VAR, relationid='iclass')]))
    [SemanticGraph([Edge(0, ?qvar-iclass->None)])]
Adds an implicit graph otherwise a copy of the original graph is returned.
    
    :param g: a graph with a non-empty 'entities' list
    :return: a list of suggested graphs
    >>> with_denotation_class_edge(SemanticGraph())
    [SemanticGraph([Edge(0, ?qvar-iclass->None)])]
import grounding.graph_queries    >>> add_denotation_class_edge(SemanticGraph([Edge(leftentityid=grounding.graph_queries.QUESTION_VAR, relationid='iclass')]))
    [SemanticGraph([Edge(0, ?qvar-iclass->None)])]
Adds an implicit graph otherwise a copy of the original graph is returned . : param g : a graph with a non - empty entities list : return : a list of suggested graphs >>> with_denotation_class_edge ( SemanticGraph () ) [ SemanticGraph ( [ Edge ( 0 ?qvar - iclass - > None ) ] ) ] import grounding . graph_queries >>> add_denotation_class_edge ( SemanticGraph ( [ Edge ( leftentityid = grounding . graph_queries . QUESTION_VAR relationid = iclass ) ] )) [ SemanticGraph ( [ Edge ( 0 ?qvar - iclass - > None ) ] ) ]
def with_denotation_class_edge(g: SemanticGraph):
    """
    Adds an implicit graph otherwise a copy of the original graph is returned.
    
    :param g: a graph with a non-empty 'entities' list
    :return: a list of suggested graphs
    >>> with_denotation_class_edge(SemanticGraph())
    [SemanticGraph([Edge(0, ?qvar-iclass->None)])]
import grounding.graph_queries    >>> add_denotation_class_edge(SemanticGraph([Edge(leftentityid=grounding.graph_queries.QUESTION_VAR, relationid='iclass')]))
    [SemanticGraph([Edge(0, ?qvar-iclass->None)])]
    """
    if any(edge.relationid == 'iclass' for edge in g.edges):
        return g
    new_g = copy(g)
    new_g.edges.append(copy(DENOTATION_CLASS_EDGE))
    return new_g
def with_denotation_class_edge ( g : SemanticGraph ) : if any ( edge . relationid == 'iclass' for edge in g . edges ) : return g new_g = copy ( g ) new_g . edges . append ( copy ( DENOTATION_CLASS_EDGE ) ) return new_g