bluesearch.widgets.mining_schema module¶
Implementation of the MiningSchma class.
- class MiningSchema[source]¶
Bases:
object
The mining schema for the mining widget.
- add_entity(entity_type, property_name=None, property_type=None, property_value_type=None, ontology_source=None)[source]¶
Add a new entity to the schema.
A warning is issued for duplicate entities.
- Parameters
entity_type (str) – The entity type, for example “CHEMICAL”.
property_name (str, optional) – The property name, for example “isChiral”.
property_type (str, optional) – The property type, for example “ATTRIBUTE”.
property_value_type (str, optional) – The property value type, for example “BOOLEAN”.
ontology_source (str, optional) – The ontology source, for example “NCIT”.
- add_from_df(entity_df)[source]¶
Add entities from a given dataframe.
The data frame has to contain a column named “entity_type”. Any columns matching the schema columns will be processed, all other columns will be ignored.
- Parameters
entity_df (pd.DataFrame) – The dataframe with new entities.
- property df¶
Get a dataframe with all entities.
- Returns
schema_df – The dataframe with all entities.
- Return type
pd.DataFrame