graphit/graph.py
def query_nodes(self, query=None, orm_cls=None, **kwargs):
        """
        Select nodes and edges based on node data query
        
        The `getnodes` method is called for the nodes matching the query
        
        :param query:   dictionary of node data key/value pairs to query
        :type query:    dict
        :param orm_cls: custom classes to construct new Graph class from.
        :type orm_cls:  list
        """
        
        # Build query
        query_set = []
        if isinstance(query, dict):
            query_set.extend(query.items())
        query_set.extend(kwargs.items())
        
        query_set = set(query_set)
        nodes = []
        for node, attr in self.nodes.items():
            if all([q in attr.items() for q in query_set]):
                nodes.append(node)
        
        nodes = list(set(nodes))
        return self.getnodes(nodes, orm_cls=orm_cls)

        Select nodes and edges based on node data query
        
        The `getnodes` method is called for the nodes matching the query
        
        :param query:   dictionary of node data key/value pairs to query
        :type query:    dict
        :param orm_cls: custom classes to construct new Graph class from.
        :type orm_cls:  list
        
Select nodes and edges based on node data query
The `getnodes` method is called for the nodes matching the query
Select nodes and edges based on node data query The ` getnodes ` method is called for the nodes matching the query
def query_nodes(self, query=None, orm_cls=None, **kwargs):
        query_set = []
        if isinstance(query, dict):
            query_set.extend(query.items())
        query_set.extend(kwargs.items())
        query_set = set(query_set)
        nodes = []
        for node, attr in self.nodes.items():
            if all([q in attr.items() for q in query_set]):
                nodes.append(node)
        nodes = list(set(nodes))
        return self.getnodes(nodes, orm_cls=orm_cls)
def query_nodes ( self , query = None , orm_cls = None , ** kwargs ) : query_set = [ ] if isinstance ( query , dict ) : query_set . extend ( query . items ( ) ) query_set . extend ( kwargs . items ( ) ) query_set = set ( query_set ) nodes = [ ] for node , attr in self . nodes . items ( ) : if all ( [ q in attr . items ( ) for q in query_set ] ) : nodes . append ( node ) nodes = list ( set ( nodes ) ) return self . getnodes ( nodes , orm_cls = orm_cls )
Select nodes and edges based on node data query
The `getnodes` method is called for the nodes matching the query
Select nodes and edges based on node data query The ` getnodes ` method is called for the nodes matching the query
"""
        Select nodes and edges based on node data query
        
        The `getnodes` method is called for the nodes matching the query
        
        :param query:   dictionary of node data key/value pairs to query
        :type query:    dict
        :param orm_cls: custom classes to construct new Graph class from.
        :type orm_cls:  list
        """ # Build query
self
query
dictionary of node data key/value pairs to query
dictionary of node data key / value pairs to query
orm_cls
custom classes to construct new Graph class from.
custom classes to construct new Graph class from .