ontolearn.lp_generator

Submodules

Package Contents

Classes

LPGen

RDFTriples

The knowledge graph/base is converted into triples of the form: individual_i ---role_j---> concept_k or

KB2Data

This class takes an owl file, loads it into a knowledge base using ontolearn.knowledge_base.KnowledgeBase.

class ontolearn.lp_generator.LPGen(kb_path, storage_dir=None, max_num_lps=1000, depth=3, max_child_length=20, refinement_expressivity=0.2, downsample_refinements=True, sample_fillers_count=10, num_sub_roots=50, min_num_pos_examples=1)[source]
generate()[source]
class ontolearn.lp_generator.RDFTriples(kb_path, storage_dir=None)[source]

The knowledge graph/base is converted into triples of the form: individual_i —role_j—> concept_k or individual_i —role_j—> individual_k and stored in a txt file for the computation of embeddings.

export_triples(export_folder_name='triples')[source]
class ontolearn.lp_generator.KB2Data(path, storage_dir=None, max_num_lps=1000, depth=3, max_child_length=20, refinement_expressivity=0.2, downsample_refinements=True, sample_fillers_count=10, num_sub_roots=50, min_num_pos_examples=1)[source]

This class takes an owl file, loads it into a knowledge base using ontolearn.knowledge_base.KnowledgeBase. A refinement operator is used to generate a large number of concepts, from which we filter and retain the shortest non-redundant concepts. We export each concept and its instances (eventually positive and negative examples) into a json file.

find_optimal_number_of_examples()[source]
generate_descriptions()[source]
sample_examples(pos, neg)[source]
save_data()[source]