item1 = KItem(
name="Machine-1",
ktype_id=dsms.ktypes.TestingMachine,
custom_properties={"Producer": "TestingLab GmBH",
"Room Number": "A404",
"Description": "Bending Test Machine"
}
)
item2 = KItem(
name="Machine-2",
ktype_id=dsms.ktypes.TestingMachine,
custom_properties={"Producer": "StressStrain GmBH",
"Room Number": "B500",
"Description": "Compression Test Machine"
}
)
item3 = KItem(
name="Specimen-1",
ktype_id=dsms.ktypes.Specimen,
linked_kitems=[item1],
annotations=["https://w3id.org/steel/ProcessOntology/TestPiece"],
custom_properties={"Geometry": "Cylindrical 150mm x 20mm x 40mm",
"Material": "Concrete",
"Project ID": "ConstructionProject2024"
}
)
item4 = KItem(
name="Specimen-2",
ktype_id=dsms.ktypes.Specimen,
linked_kitems=[item2],
annotations=["https://w3id.org/steel/ProcessOntology/TestPiece"],
custom_properties={"Geometry": "Rectangular 200mm x 30mm x 20mm",
"Material": "Metal",
"Project ID": "MetalBlenders2024"
}
)
item5 = KItem(
name="Research Institute ABC",
ktype_id=dsms.ktypes.Organization,
linked_kitems=[item1,item2],
annotations=["www.researchBACiri.org/foo"],
)
dsms.commit()
A solution would be to make a set of the kitems running through the create- and updated-commit, which would be refreshed after the overall committing operation. Currently, items get refresh after each individual commit.