Skip to main content
Question

Full Data Model with mutliple connections

  • March 25, 2025
  • 1 reply
  • 15 views

Hello, 

we're using pygen to generate a Full Data Model and instances. One of our containers can have multiple connections to objects in another container (see the pic below).


As a result, definitions are lists of objects. It is then difficult to query data using tuples:
 

bays = dm_client.bay.list(
    bay_to_line=(space, id), 
    retrieve_connections="identifier", 
    limit=None, 
    ).to_pandas()

We can overcome this by reading all bays with retreive_connections=”full” and then querying the data. But we would like to generate a model, where such tricks are not needed and the definitions are not a list. Is it possible? 

To generate a model we do this workflow: 
 

neat.read.rdf("lines_bays.jsonld")
neat.infer(max_number_of_instance=-1)
neat.prepare.data_model.cdf_compliant_external_ids()
neat.verify()
neat.convert("dms")
neat.set.data_model_id(("lin", "lines", "v1"))
neat.to.cdf.data_model()
neat.to.cdf.instances()

 

1 reply

Anders  Albert
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • 108 replies
  • March 25, 2025

I am not sure I understand the question here. Pygen is generating an SDK based on your data model as it is, are you asking if pygen can change the data model such that in your case Bay and Line becomes the same object?

This sounds like a data modeling issue, i.e., you have to change your data model before you publish it to CDF and generates an SDK.


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings