src/pybel/manager/query_manager.py
def query_nodes(
        self,
        bel: Optional[str] = None,
        type: Optional[str] = None,
        namespace: Optional[str] = None,
        name: Optional[str] = None,
    ) -> List[Node]:
        """Query nodes in the database.

        :param bel: BEL term that describes the biological entity. e.g. ``p(HGNC:APP)``
        :param type: Type of the biological entity. e.g. Protein
        :param namespace: Namespace keyword that is used in BEL. e.g. HGNC
        :param name: Name of the biological entity. e.g. APP
        """
        q = self.session.query(Node)

        if bel:
            q = q.filter(Node.bel.ilike(f'%{bel}%'))

        if type:
            q = q.filter(Node.type == type)

        if namespace or name:
            q = q.join(NamespaceEntry)

            if namespace:
                q = q.join(Namespace).filter(Namespace.keyword.ilike(namespace))

            if name:
                q = q.filter(NamespaceEntry.name.ilike(f'%{name}%'))

        return q
Query nodes in the database.

        :param bel: BEL term that describes the biological entity. e.g. ``p(HGNC:APP)``
        :param type: Type of the biological entity. e.g. Protein
        :param namespace: Namespace keyword that is used in BEL. e.g. HGNC
        :param name: Name of the biological entity. e.g. APP
        
Query nodes in the database.
Query nodes in the database .
def query_nodes(
        self,
        bel: Optional[str] = None,
        type: Optional[str] = None,
        namespace: Optional[str] = None,
        name: Optional[str] = None,
    ) -> List[Node]:
        q = self.session.query(Node)
        if bel:
            q = q.filter(Node.bel.ilike(f'%{bel}%'))
        if type:
            q = q.filter(Node.type == type)
        if namespace or name:
            q = q.join(NamespaceEntry)
            if namespace:
                q = q.join(Namespace).filter(Namespace.keyword.ilike(namespace))
            if name:
                q = q.filter(NamespaceEntry.name.ilike(f'%{name}%'))
        return q
def query_nodes ( self , bel : Optional [ str ] = None , type : Optional [ str ] = None , namespace : Optional [ str ] = None , name : Optional [ str ] = None , ) -> List [ Node ] : q = self . session . query ( Node ) if bel : q = q . filter ( Node . bel . ilike ( f'%{bel}%' ) ) if type : q = q . filter ( Node . type == type ) if namespace or name : q = q . join ( NamespaceEntry ) if namespace : q = q . join ( Namespace ) . filter ( Namespace . keyword . ilike ( namespace ) ) if name : q = q . filter ( NamespaceEntry . name . ilike ( f'%{name}%' ) ) return q
Query nodes in the database.
Query nodes in the database .
"""Query nodes in the database.

        :param bel: BEL term that describes the biological entity. e.g. ``p(HGNC:APP)``
        :param type: Type of the biological entity. e.g. Protein
        :param namespace: Namespace keyword that is used in BEL. e.g. HGNC
        :param name: Name of the biological entity. e.g. APP
        """
self
bel
Optional[str]
BEL term that describes the biological entity. e.g.
BEL term that describes the biological entity . e . g .
type
Optional[str]
Type of the biological entity. e.g. Protein
Type of the biological entity . e . g . Protein
namespace
Optional[str]
Namespace keyword that is used in BEL. e.g. HGNC
Namespace keyword that is used in BEL . e . g . HGNC
name
Optional[str]
Name of the biological entity. e.g. APP
Name of the biological entity . e . g . APP