src/pybel/manager/query_manager.py
def query_citations(
        self,
        db: Optional[str] = None,
        db_id: Optional[str] = None,
        name: Optional[str] = None,
        author: Union[None, str, List[str]] = None,
        date: Union[None, str, datetime.date] = None,
        evidence_text: Optional[str] = None,
    ) -> List[Citation]:
        """Query citations in the database.

        :param db: Type of the citation. e.g. PubMed
        :param db_id: The identifier used for the citation. e.g. PubMed_ID
        :param name: Title of the citation.
        :param author: The name or a list of names of authors participated in the citation.
        :param date: Publishing date of the citation.
        :param evidence_text:
        """
        query = self.session.query(Citation)

        if author is not None:
            query = query.join(Author, Citation.authors)
            if isinstance(author, str):
                query = query.filter(Author.name.like(author))
            elif isinstance(author, Iterable):
                query = query.filter(Author.has_name_in(set(author)))
            else:
                raise TypeError

        if db and not db_id:
            query = query.filter(Citation.db.like(db))
        elif db_id and db:
            query = query.filter(Citation.db_id == db_id)
        elif db_id and not db:
            raise ValueError('reference specified without type')

        if name:
            query = query.filter(Citation.name.like(name))

        if date:
            if isinstance(date, datetime.date):
                query = query.filter(Citation.date == date)
            elif isinstance(date, str):
                query = query.filter(Citation.date == parse_datetime(date))

        if evidence_text:
            query = query.join(Evidence).filter(Evidence.text.like(evidence_text))

        return query.all()
Query citations in the database.

        :param db: Type of the citation. e.g. PubMed
        :param db_id: The identifier used for the citation. e.g. PubMed_ID
        :param name: Title of the citation.
        :param author: The name or a list of names of authors participated in the citation.
        :param date: Publishing date of the citation.
        :param evidence_text:
        
Query citations in the database.
Query citations in the database .
def query_citations(
        self,
        db: Optional[str] = None,
        db_id: Optional[str] = None,
        name: Optional[str] = None,
        author: Union[None, str, List[str]] = None,
        date: Union[None, str, datetime.date] = None,
        evidence_text: Optional[str] = None,
    ) -> List[Citation]:
        query = self.session.query(Citation)
        if author is not None:
            query = query.join(Author, Citation.authors)
            if isinstance(author, str):
                query = query.filter(Author.name.like(author))
            elif isinstance(author, Iterable):
                query = query.filter(Author.has_name_in(set(author)))
            else:
                raise TypeError
        if db and not db_id:
            query = query.filter(Citation.db.like(db))
        elif db_id and db:
            query = query.filter(Citation.db_id == db_id)
        elif db_id and not db:
            raise ValueError('reference specified without type')
        if name:
            query = query.filter(Citation.name.like(name))
        if date:
            if isinstance(date, datetime.date):
                query = query.filter(Citation.date == date)
            elif isinstance(date, str):
                query = query.filter(Citation.date == parse_datetime(date))
        if evidence_text:
            query = query.join(Evidence).filter(Evidence.text.like(evidence_text))
        return query.all()
def query_citations ( self , db : Optional [ str ] = None , db_id : Optional [ str ] = None , name : Optional [ str ] = None , author : Union [ None , str , List [ str ] ] = None , date : Union [ None , str , datetime . date ] = None , evidence_text : Optional [ str ] = None , ) -> List [ Citation ] : query = self . session . query ( Citation ) if author is not None : query = query . join ( Author , Citation . authors ) if isinstance ( author , str ) : query = query . filter ( Author . name . like ( author ) ) elif isinstance ( author , Iterable ) : query = query . filter ( Author . has_name_in ( set ( author ) ) ) else : raise TypeError if db and not db_id : query = query . filter ( Citation . db . like ( db ) ) elif db_id and db : query = query . filter ( Citation . db_id == db_id ) elif db_id and not db : raise ValueError ( 'reference specified without type' ) if name : query = query . filter ( Citation . name . like ( name ) ) if date : if isinstance ( date , datetime . date ) : query = query . filter ( Citation . date == date ) elif isinstance ( date , str ) : query = query . filter ( Citation . date == parse_datetime ( date ) ) if evidence_text : query = query . join ( Evidence ) . filter ( Evidence . text . like ( evidence_text ) ) return query . all ( )
Query citations in the database.
Query citations in the database .
"""Query citations in the database.

        :param db: Type of the citation. e.g. PubMed
        :param db_id: The identifier used for the citation. e.g. PubMed_ID
        :param name: Title of the citation.
        :param author: The name or a list of names of authors participated in the citation.
        :param date: Publishing date of the citation.
        :param evidence_text:
        """
self
db
Optional[str]
Type of the citation. e.g. PubMed
Type of the citation . e . g . PubMed
db_id
Optional[str]
The identifier used for the citation. e.g.
The identifier used for the citation . e . g .
name
Optional[str]
Title of the citation.
Title of the citation .
author
Union[None, str, List[str]]
The name or a list of names of authors participated in the citation.
The name or a list of names of authors participated in the citation .
date
Union[None, str, datetime.date]
Publishing date of the citation.
Publishing date of the citation .
evidence_text
Optional[str]
None