Realized Logical Component/Function in P4C

Hello everyone,

I am working with Python4Capella to extract data from a model into Excel.
My current script successfully builds a traceability matrix for the Physical Level, and now I would like to extend it.

My goal is to:
For each Physical Function, I want to retrieve the Logical Functions that realize it
For each Node PC, I want to retrieve the Logical Components that realize it

I tried using get_realizing_logical_functions() and get_allocated_functions() but are not working.
What is the correct approach to retrieve the Logical Functions/Component that realize (or are allocated to) a given Physical Element?

Any working example or code snippet would be very helpful.

Thanks a lot in advance!

From a PhysicalFunction you can use get_realized_logical_functions() but it calls a query from the semantic browser. So if needed you can call the Java API:

my_physical_function.get_java_object().getRealizedLogicalFunctions()

And from a BehaviorPC you can call get_realized_logical_components().