App

API for GraphQL enhanced queries against catapp and ase-db database

Some Examples:

  • Get total number of rows in table (in this case reactions):

    {reactions (first: 0) {
      totalCount
       edges {
         node {
           id
        }
      }
    }}
    
  • Filter by reactants and products from reactions:

    {reactions(reactants: "H2O", products: "OH") {
      edges {
        node {
          reactants
          products
          reactionEnergy
          activationEnergy
        }
      }
    }}
    
  • Filter by several reactants or products from reactions:

    {reactions(products: "Nstar+CH3star") {
      edges {
        node {
          reactants
          products
          reactionEnergy
          activationEnergy
        }
      }
    }}
    
  • Author-name from publications:

    {publications(authors: "~Bajdich") {
      edges {
        node {
          reactions {
            chemicalComposition
            reactants
            products
            reactionEnergy
           }
         }
        }
      }}
    
  • Full text search in reactions (reactants, products, chemical composition, facet):

    {reactions(textsearch: "CO CH 111") {
      edges {
        node {
          reactants
          products
          publication {
            title
            authors
          }
        }
      }
    }}
    
  • Full text search in publications (title, authors, year):

    {publications(pubtextsearch: "oxygen evolution bajdich 2017") {
      edges {
        node {
          title
          authors
          year
          reactions {
            reactants
            products
         }
        }
      }
    }}
    
  • Distinct reactants and products from reactions (works with and without “~”):

    {reactions(reactants: "~OH", products: "~", distinct: true) {
      edges {
        node {
          reactants
          products
          reactionEnergy
        }
      }
    }}
    
  • ASE structures belonging to reactions:

    {reactions(reactants: "~OH", first:1) {
       edges {
         node {
           systems {
             Cifdata
           }
         }
       }
     }}
    
  • Get all distinct DOIs:

    {publications {
       edges {
         node {
           doi
         }
       }
     }}
    
  • Get all entries published since (and including) 2015:

     {publications(year: 2015, op: "ge", last:1) {
       edges {
         node {
          id
          year
          systems {
             keyValuePairs
          }
        }
      }
    }}
    
class api.CountableConnection(*args, **kwargs)[source]

Bases: graphene.relay.connection.Connection

static resolve_total_count(root, info)[source]
total_count = <graphene.types.scalars.Int object>
class api.CustomSQLAlchemyObjectType(*args, **kwargs)[source]

Bases: graphene_sqlalchemy.types.SQLAlchemyObjectType

class api.FilteringConnectionField(type, *args, **kwargs)[source]

Bases: graphene_sqlalchemy.fields.SQLAlchemyConnectionField

RELAY_ARGS = ['first', 'last', 'before', 'after']
SPECIAL_ARGS = ['distinct', 'op', 'jsonkey', 'order']
classmethod get_query(model, info, **args)[source]
class api.Information(*args, **kwargs)[source]

Bases: api.CustomSQLAlchemyObjectType

class api.Key(*args, **kwargs)[source]

Bases: api.CustomSQLAlchemyObjectType

class api.Log(*args, **kwargs)[source]

Bases: api.CustomSQLAlchemyObjectType

class api.NumberKeyValue(*args, **kwargs)[source]

Bases: api.CustomSQLAlchemyObjectType

class api.Publication(*args, **kwargs)[source]

Bases: api.CustomSQLAlchemyObjectType

reactions = <graphene.types.structures.List object>
systems = <graphene.types.structures.List object>
class api.Query(*args, **kwargs)[source]

Bases: graphene.types.objecttype.ObjectType

information = <api.FilteringConnectionField object>
key = <api.FilteringConnectionField object>
logs = <api.FilteringConnectionField object>
node = <graphene.relay.node.NodeField object>
number_keys = <api.FilteringConnectionField object>
publications = <api.FilteringConnectionField object>
reaction_systems = <api.FilteringConnectionField object>
reactions = <api.FilteringConnectionField object>
species = <api.FilteringConnectionField object>
systems = <api.FilteringConnectionField object>
text_keys = <api.FilteringConnectionField object>
class api.Reaction(*args, **kwargs)[source]

Bases: api.CustomSQLAlchemyObjectType

reaction_systems = <graphene.types.structures.List object>
systems = <graphene.types.structures.List object>
class api.ReactionSystem(*args, **kwargs)[source]

Bases: api.CustomSQLAlchemyObjectType

class api.Species(*args, **kwargs)[source]

Bases: api.CustomSQLAlchemyObjectType

class api.System(*args, **kwargs)[source]

Bases: api.CustomSQLAlchemyObjectType

log = <graphene.types.structures.List object>
publication = <graphene.types.structures.List object>
static resolve__input_file(self, info, format='py')[source]

Return the structure as input for one of several DFT codes as supported by ASE. Default format is “py”. Run:

{systems(last: 1) {
  totalCount
  edges {
    node {
      InputFile(format:"")
    }
  }
}}

to show available formats. Try one of the available formats like,:

{systems(last: 10) {
  totalCount
  edges {
    node {
      InputFile(format:"espresso-in")
    }
  }
}}

to generate QE input.

class api.TextKeyValue(*args, **kwargs)[source]

Bases: api.CustomSQLAlchemyObjectType

api.get_filter_fields(model)[source]

Generate filter fields (= comparison) from graphene_sqlalcheme model

#.. automodule:: models
#:members: #:undoc-members: #:show-inheritance: