# uncomment the following line if you haven't installed bte_schema
# !pip install git+https://github.com/kevinxin90/bte_schema#egg=bte_schema

# uncomment the following line if you haven't installed biothings_schema
#pip install git+https://github.com/biothings/biothings_schema.py#egg=biothings_schema.py

# import metadata module from biothings_explorer
from biothings_explorer.metadata import Metadata

# initialize Metadata module
metadata = Metadata()

"""
Explanation: Important prerequisite

The package doesn't work with the newest version of Jupyter Notebook, run the following commands in your terminal before initiating the Notebook
pip install notebook==5.7.5
pip install tornado==4.5.3

Install dependencies
Don't worry about the error messages during installation, you will be fine.
End of explanation
"""


metadata.list_all_semantic_types()

"""
Explanation: List all semantic types used in BioThings Explorer
End of explanation
"""


metadata.list_all_id_types()

"""
Explanation: List all identifier types used in BioThings Explorer
End of explanation
"""


metadata.list_all_predicates()

"""
Explanation: List all predicates used in BioThings Explorer
End of explanation
"""


metadata.list_all_associations()

"""
Explanation: List all associations between semantic types in BioThings Explorer
End of explanation
"""


metadata.registry.filter_edges(input_cls="Gene")

"""
Explanation: Filter all edges with "Gene" as the subject
End of explanation
"""


metadata.registry.filter_edges(output_cls="ChemicalSubstance")

"""
Explanation: Filter all edges with "ChemicalSubstance" as the object
End of explanation
"""


metadata.registry.filter_edges(input_cls="Gene", output_cls="ChemicalSubstance")

"""
Explanation: Filter all edges connecting from "Gene" to "ChemicalSubstance"
End of explanation
"""


metadata.registry.filter_edges(input_cls="Gene", output_cls="ChemicalSubstance", edge_label="bts:targetedBy")

"""
Explanation: Filter all edges representing "Gene" -> "targetedBy" -> "ChemicalSubstance"
End of explanation
"""


