Skip to content

component

Module for knowledge model components.

Attribute

Bases: AttributeMetadata

Class for knowledge model record attributes.

get_column

get_column()

Returns query of attribute.

Returns:

  • PQLColumn

    PQLColumn with attribute query.

Examples:

Extract data based on PQLs from knowledge model:

from pycelonis.pql import PQL, PQLColumn

record = knowledge_model.get_content().records.find_by_id('ACTIVITIES')
attribute = record.attributes.find_by_id('ACTIVITY_EN')

query = PQL() + attribute.get_column()

data_query, query_environment = knowledge_model.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)

Identifier

Bases: PqlBaseMetadata

Class for knowledge model record identifiers.

get_column

get_column()

Returns query of identifier.

Returns:

  • PQLColumn

    PQLColumn with identifier query.

Examples:

Extract data based on PQLs from knowledge model:

from pycelonis.pql import PQL, PQLColumn

record = knowledge_model.get_content().records.find_by_id('ACTIVITIES')
identifier = record.identifier

query = PQL() + identifier.get_column()

data_query, query_environment = knowledge_model.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)

Record

Bases: BusinessRecordMetadata

Class for knowledge model records.

attributes class-attribute

attributes: typing.Optional[CelonisCollection[Attribute]]

identifier class-attribute

identifier: typing.Optional[Identifier]

Filter

Bases: FilterMetadata

Class for knowledge model filters.

get_filter

get_filter()

Returns query of filter.

Returns:

Examples:

Extract data based on PQLs from knowledge model:

from pycelonis.pql import PQL, PQLColumn

km_filter = knowledge_model.get_content().filters.find_by_id('FILTER')

query = PQL() + PQLColumn(name="<name>", query="<query>") + km_filter.get_filter()

data_query, query_environment = knowledge_model.resolve_query(query)
df = data_model.export_data_frame(data_query, query_environment)