construct_root_dict(): returns a dictionary containing the root types and their arguments' name, type, kind and description.
fetch_schema(): Retrieves the entire schema from the PDB URL or a local file if fetching online schema fails.
construct_type_dict(): Constructs a dictionary from the schema, where each key is a type name and each value is a dictionary containing field names and their types
construct_name_list(): Creates a list of all field names in the schema
make_type_subgraph(): Creates a subgraph for a given type, including its fields and their relationships.
recurse_build_schema(): Recursively builds the schema graph by traversing the type hierarchy.
apply_weights(): Applies weights to edges in the schema graph based on the root types (assigns the weight of a root type to all edges that originate from a type that is a subtype of the root type).
make_type_node(): Creates a new type node in the schema graph.
make_field_node(): Creates a new field node in the schema graph.
verify_unique_field(): Checks if a field name is unique in the schema; returns true if the field name is unique, and false if redundant.
get_input_id_dict(): Returns a dictionary of input IDs arguments and their descriptions for a given input type
recurse_fields(): Recursively constructs a GraphQL query string from a dictionary of fields. (need to address double path in query string; query string output is still valid)
get_descendant_fields(): Returns a list of all descendant fields under a specific node (field name) in the graph, used when requesting a non-scalar value.
extract_name_description(): creates a dict with field name and description pairs from the schema data, includes dot notation for redundant fields (will need to add minor edit for dict construction because it currently stores the first redundant field without dot notation, for ex: stores the firstid without dot notation, but every other id will have dot notation)
find_field_names(): return all field names containing a partial string along with their descriptions
regex_checks(): Performs regular expression checks on regular pdb input IDs and CSM IDs to ensure they match the expected format.
__construct_query_networkx(): Constructs a GraphQL query string using NetworkX (incomplete function).
__construct_query_rustworkx(): Constructs a GraphQL query string using RustWorkx.
Query.py:
get_editor_link(): Returns a link to the GraphiQL editor with the constructed query.
post_quer(): Posts the constructed query to the RCSB API and handles batching for plural inputs.
parse_gql_error(): Parses and raises any GraphQL errors in the response.
batch_ids(): Batches input IDs into lists of a specified size for plural inputs.
merge_response(): Merges multiple response dictionaries into a single response.
2 starter notebooks + readme
schema.py:
construct_root_dict()
: returns a dictionary containing the root types and their arguments' name, type, kind and description.fetch_schema()
: Retrieves the entire schema from the PDB URL or a local file if fetching online schema fails.construct_type_dict()
: Constructs a dictionary from the schema, where each key is a type name and each value is a dictionary containing field names and their typesconstruct_name_list()
: Creates a list of all field names in the schemamake_type_subgraph()
: Creates a subgraph for a given type, including its fields and their relationships.recurse_build_schema()
: Recursively builds the schema graph by traversing the type hierarchy.apply_weights()
: Applies weights to edges in the schema graph based on the root types (assigns the weight of a root type to all edges that originate from a type that is a subtype of the root type).make_type_node()
: Creates a new type node in the schema graph.make_field_node()
: Creates a new field node in the schema graph.verify_unique_field()
: Checks if a field name is unique in the schema; returns true if the field name is unique, and false if redundant.get_input_id_dict()
: Returns a dictionary of input IDs arguments and their descriptions for a given input typerecurse_fields()
: Recursively constructs a GraphQL query string from a dictionary of fields. (need to address double path in query string; query string output is still valid)get_descendant_fields()
: Returns a list of all descendant fields under a specific node (field name) in the graph, used when requesting a non-scalar value.extract_name_description()
: creates a dict with field name and description pairs from the schema data, includes dot notation for redundant fields (will need to add minor edit for dict construction because it currently stores the first redundant field without dot notation, for ex: stores the firstid
without dot notation, but every other id will have dot notation)find_field_names()
: return all field names containing a partial string along with their descriptionsregex_checks()
: Performs regular expression checks on regular pdb input IDs and CSM IDs to ensure they match the expected format.__construct_query_networkx()
: Constructs a GraphQL query string using NetworkX (incomplete function).__construct_query_rustworkx()
: Constructs a GraphQL query string using RustWorkx.get_editor_link()
: Returns a link to the GraphiQL editor with the constructed query.post_quer()
: Posts the constructed query to the RCSB API and handles batching for plural inputs.parse_gql_error()
: Parses and raises any GraphQL errors in the response.batch_ids()
: Batches input IDs into lists of a specified size for plural inputs.merge_response()
: Merges multiple response dictionaries into a single response.