ontolearn.lp_generator

Submodules

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.

Package Contents

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]
triple_gen
lp_gen
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.

Graph
kb_path
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.

path
max_num_lps
dl_syntax_renderer
kb
num_examples
min_num_pos_examples
atomic_concept_names
lp_gen
find_optimal_number_of_examples()[source]
generate_descriptions()[source]
sample_examples(pos, neg)[source]
save_data()[source]