5. Searching KItems with the SDK#
In this tutorial we see how to search existing Kitems
5.1. Setting up#
Before you run this tutorial: make sure to have access to a DSMS-instance of your interest, alongwith with installation of this package and have establised access to the DSMS through DSMS-SDK (refer to Connecting to DSMS)
Now let us import the needed classes and functions for this tutorial.
[1]:
from dsms import DSMS, KItem
Now source the environmental variables from an .env file and start the DSMS-session.
[2]:
dsms = DSMS(env=".env")
5.2. Searching for KItems#
In this section, we would like to search for specfic KItems we created in the DSMS.
For this purpose, we will firstly create some KItems and apply the search-method on the DSMS-object later on in order to find them again in the DSMS.
We also want to demonstrate here, that we can link KItems to each other in order to find e.g. a related item of type DatasetCatalog. For this strategy, we are using the linked_kitems- attribute and the id of the item which we would like to link.
The procedure looks like this:
[3]:
item1 = KItem(
name="Machine-1",
ktype_id=dsms.ktypes.TestingMachine,
annotations=["https://w3id.org/steel/ProcessOntology/TestingMachine"],
custom_properties={"Producer": "TestingLab GmBH",
"Room Number": "A404",
"Description": "Bending Test Machine"
}
)
item2 = KItem(
name="Machine-2",
ktype_id=dsms.ktypes.TestingMachine,
annotations=["https://w3id.org/steel/ProcessOntology/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()
Note : Here in this tutorial, we use dsms.search with limit=1 to maintain readability but the user can adjust the variable limit as per requirement.
</b>
Now, we are apply to search for e.g. kitems of type TestingMachine:
[4]:
for result in dsms.search(ktypes=[dsms.ktypes.TestingMachine], limit=1):
print(result.hit)
print("\n")
KItem(
name = Machine-1,
id = d1524272-5f34-454b-bb61-7b0ab3a825a7,
ktype_id = testing-machine,
in_backend = True,
slug = machine-1-d1524272,
annotations = [],
attachments = [],
linked_kitems = [
id: ba1a7871-ff75-465f-8625-a7a0202edca4
name: Specimen-1
slug: specimen-1-ba1a7871
ktype_id: specimen
summary: None
avatar_exists: False
annotations: []
linked_kitems: [{
id: d1524272-5f34-454b-bb61-7b0ab3a825a7
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'sampletype': None, 'sampleinformation': None, 'sampleproductionprocess': None, 'Geometry': 'Cylindrical 150mm x 20mm x 40mm', 'Material': 'Concrete', 'Project ID': 'ConstructionProject2024'}
created_at: 2024-08-23T17:15:46.876917
updated_at: 2024-08-23T17:15:46.876917
,
id: 2335f57a-efc2-47ce-83b3-866cdeb6d30d
name: Research Institute ABC
slug: researchinstituteabc-2335f57a
ktype_id: organization
summary: None
avatar_exists: False
annotations: [{
iri: www.researchBACiri.org/foo,
name: research ABC Institute,
namespace: research,
description: None
}]
linked_kitems: [{
id: d1524272-5f34-454b-bb61-7b0ab3a825a7
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: None
created_at: 2024-08-23T17:15:47.998202
updated_at: 2024-08-23T17:15:47.998202
],
affiliations = [],
authors = [
{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}
],
avatar_exists = False,
contacts = [],
created_at = 2024-08-23 17:15:45.431622,
updated_at = 2024-08-23 17:15:45.431622,
external_links = [],
kitem_apps = [],
summary = None,
user_groups = [],
custom_properties = {
Producer: TestingLab GmBH,
Room Number: A404,
Description: Bending Test Machine
},
dataframe = None,
rdf_exists = False
)
… and for all of type Organization and DatasetCatalog:
[5]:
for result in dsms.search(ktypes=[dsms.ktypes.Organization, dsms.ktypes.DatasetCatalog], limit=1):
print(result.hit)
print("fuzziness: ", result.fuzzy)
print("\n")
KItem(
name = Research Institute ABC,
id = 2335f57a-efc2-47ce-83b3-866cdeb6d30d,
ktype_id = organization,
in_backend = True,
slug = researchinstituteabc-2335f57a,
annotations = [
{
iri: www.researchBACiri.org/foo,
name: research ABC Institute,
namespace: research,
description: None
}
],
attachments = [],
linked_kitems = [
id: d1524272-5f34-454b-bb61-7b0ab3a825a7
name: Machine-1
slug: machine-1-d1524272
ktype_id: testing-machine
summary: None
avatar_exists: False
annotations: []
linked_kitems: [{
id: ba1a7871-ff75-465f-8625-a7a0202edca4
}, {
id: 2335f57a-efc2-47ce-83b3-866cdeb6d30d
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'Producer': 'TestingLab GmBH', 'Room Number': 'A404', 'Description': 'Bending Test Machine'}
created_at: 2024-08-23T17:15:45.431622
updated_at: 2024-08-23T17:15:45.431622
],
affiliations = [],
authors = [
{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}
],
avatar_exists = False,
contacts = [],
created_at = 2024-08-23 17:15:47.998202,
updated_at = 2024-08-23 17:15:47.998202,
external_links = [],
kitem_apps = [],
summary = None,
user_groups = [],
custom_properties = None,
dataframe = None,
rdf_exists = False
)
fuzziness: False
… or for all of type Dataset with Specimen-1 in the name:
[6]:
for result in dsms.search(query="Specimen-1", ktypes=[dsms.ktypes.Dataset], limit=1):
print(result.hit)
print("\n")
… and for all of type Organization with the annotation www.researchBACiri.org/foo:
[7]:
for result in dsms.search(
ktypes=[dsms.ktypes.Organization], annotations=["www.researchBACiri.org/foo"], limit=1
):
print(result.hit)
print("\n")
KItem(
name = Research Institute ABC,
id = 2335f57a-efc2-47ce-83b3-866cdeb6d30d,
ktype_id = organization,
in_backend = True,
slug = researchinstituteabc-2335f57a,
annotations = [
{
iri: www.researchBACiri.org/foo,
name: research ABC Institute,
namespace: research,
description: None
}
],
attachments = [],
linked_kitems = [
id: d1524272-5f34-454b-bb61-7b0ab3a825a7
name: Machine-1
slug: machine-1-d1524272
ktype_id: testing-machine
summary: None
avatar_exists: False
annotations: []
linked_kitems: [{
id: ba1a7871-ff75-465f-8625-a7a0202edca4
}, {
id: 2335f57a-efc2-47ce-83b3-866cdeb6d30d
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'Producer': 'TestingLab GmBH', 'Room Number': 'A404', 'Description': 'Bending Test Machine'}
created_at: 2024-08-23T17:15:45.431622
updated_at: 2024-08-23T17:15:45.431622
],
affiliations = [],
authors = [
{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}
],
avatar_exists = False,
contacts = [],
created_at = 2024-08-23 17:15:47.998202,
updated_at = 2024-08-23 17:15:47.998202,
external_links = [],
kitem_apps = [],
summary = None,
user_groups = [],
custom_properties = None,
dataframe = None,
rdf_exists = False
)
KItem(
name = Research Institute ABC,
id = 379e07a7-acd3-45dd-8bbd-ad5edb549946,
ktype_id = organization,
in_backend = True,
slug = researchinstituteabc-379e07a7,
annotations = [
{
iri: www.researchBACiri.org/foo,
name: foo,
namespace: www.researchBACiri.org,
description: None
}
],
attachments = [],
linked_kitems = [
id: 31a7d354-6dfc-4aa5-832c-a1e581757193
name: Machine-1
slug: machine-1-31a7d354
ktype_id: testing-machine
summary: None
avatar_exists: False
annotations: [{
iri: https://w3id.org/steel/ProcessOntology/TestingMachine,
name: TestingMachine,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}]
linked_kitems: [{
id: af4e0334-6325-4ae7-91fd-cc1b21864cf1
}, {
id: 379e07a7-acd3-45dd-8bbd-ad5edb549946
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'Producer': 'TestingLab GmBH', 'Room Number': 'A404', 'Description': 'Bending Test Machine'}
created_at: 2024-08-23T18:16:40.453930
updated_at: 2024-08-23T18:16:40.453930
,
id: 8155c264-c790-4151-bff5-471e6a64fc21
name: Machine-2
slug: machine-2-8155c264
ktype_id: testing-machine
summary: None
avatar_exists: False
annotations: [{
iri: https://w3id.org/steel/ProcessOntology/TestingMachine,
name: TestingMachine,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}]
linked_kitems: [{
id: ce4309d3-cb6b-4fe0-85e6-d74e0b282b5d
}, {
id: 379e07a7-acd3-45dd-8bbd-ad5edb549946
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'Producer': 'StressStrain GmBH', 'Room Number': 'B500', 'Description': 'Compression Test Machine'}
created_at: 2024-08-23T18:16:42.132533
updated_at: 2024-08-23T18:16:42.132533
],
affiliations = [],
authors = [
{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}
],
avatar_exists = False,
contacts = [],
created_at = 2024-08-23 18:16:46.777379,
updated_at = 2024-08-23 18:16:46.777379,
external_links = [],
kitem_apps = [],
summary = None,
user_groups = [],
custom_properties = None,
dataframe = None,
rdf_exists = False
)
5.3. Fetching linked KItems from a KItem#
In the beginning under 5.1 we created some kitems and linked each other. Now we want to fetch the linked kitems and display them to the user. For this we use the linked_kitems attribute.
[8]:
item5.linked_kitems
[8]:
[
id: 31a7d354-6dfc-4aa5-832c-a1e581757193
name: Machine-1
slug: machine-1-31a7d354
ktype_id: testing-machine
summary: None
avatar_exists: False
annotations: [{
iri: https://w3id.org/steel/ProcessOntology/TestingMachine,
name: TestingMachine,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}]
linked_kitems: [{
id: af4e0334-6325-4ae7-91fd-cc1b21864cf1
}, {
id: 379e07a7-acd3-45dd-8bbd-ad5edb549946
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'Producer': 'TestingLab GmBH', 'Room Number': 'A404', 'Description': 'Bending Test Machine'}
created_at: 2024-08-23T18:16:40.453930
updated_at: 2024-08-23T18:16:40.453930
,
id: 8155c264-c790-4151-bff5-471e6a64fc21
name: Machine-2
slug: machine-2-8155c264
ktype_id: testing-machine
summary: None
avatar_exists: False
annotations: [{
iri: https://w3id.org/steel/ProcessOntology/TestingMachine,
name: TestingMachine,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}]
linked_kitems: [{
id: ce4309d3-cb6b-4fe0-85e6-d74e0b282b5d
}, {
id: 379e07a7-acd3-45dd-8bbd-ad5edb549946
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'Producer': 'StressStrain GmBH', 'Room Number': 'B500', 'Description': 'Compression Test Machine'}
created_at: 2024-08-23T18:16:42.132533
updated_at: 2024-08-23T18:16:42.132533
]
However, this linked KItem is not a “real” KItem. Due to performance reasons, we only display a slim representation of the linked KItem. Imagine if the linked KItem also has a linked KItem… this might lead to an infinite recursion. We can fetch the “real” KItem by using the fetch method of the linked KItem:
[9]:
item5.linked_kitems[0].fetch()
[9]:
KItem(
name = Machine-1,
id = 31a7d354-6dfc-4aa5-832c-a1e581757193,
ktype_id = testing-machine,
in_backend = True,
slug = machine-1-31a7d354,
annotations = [
{
iri: https://w3id.org/steel/ProcessOntology/TestingMachine,
name: TestingMachine,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}
],
attachments = [],
linked_kitems = [
id: af4e0334-6325-4ae7-91fd-cc1b21864cf1
name: Specimen-1
slug: specimen-1-af4e0334
ktype_id: specimen
summary: None
avatar_exists: False
annotations: [{
iri: https://w3id.org/steel/ProcessOntology/TestPiece,
name: TestPiece,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}]
linked_kitems: [{
id: 31a7d354-6dfc-4aa5-832c-a1e581757193
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'sampletype': None, 'sampleinformation': None, 'sampleproductionprocess': None, 'Geometry': 'Cylindrical 150mm x 20mm x 40mm', 'Material': 'Concrete', 'Project ID': 'ConstructionProject2024'}
created_at: 2024-08-23T18:16:43.773825
updated_at: 2024-08-23T18:16:43.773825
,
id: 379e07a7-acd3-45dd-8bbd-ad5edb549946
name: Research Institute ABC
slug: researchinstituteabc-379e07a7
ktype_id: organization
summary: None
avatar_exists: False
annotations: [{
iri: www.researchBACiri.org/foo,
name: foo,
namespace: www.researchBACiri.org,
description: None
}]
linked_kitems: [{
id: 31a7d354-6dfc-4aa5-832c-a1e581757193
}, {
id: 8155c264-c790-4151-bff5-471e6a64fc21
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: None
created_at: 2024-08-23T18:16:46.777379
updated_at: 2024-08-23T18:16:46.777379
],
affiliations = [],
authors = [
{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}
],
avatar_exists = False,
contacts = [],
created_at = 2024-08-23 18:16:40.453930,
updated_at = 2024-08-23 18:16:40.453930,
external_links = [],
kitem_apps = [],
summary = None,
user_groups = [],
custom_properties = {
Producer: TestingLab GmBH,
Room Number: A404,
Description: Bending Test Machine
},
dataframe = None,
rdf_exists = False
)
We can also get the linked KItems grouped by annotation:
[10]:
item5.linked_kitems.by_annotation
[10]:
{'https://w3id.org/steel/ProcessOntology/TestingMachine': [
id: 31a7d354-6dfc-4aa5-832c-a1e581757193
name: Machine-1
slug: machine-1-31a7d354
ktype_id: testing-machine
summary: None
avatar_exists: False
annotations: [{
iri: https://w3id.org/steel/ProcessOntology/TestingMachine,
name: TestingMachine,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}]
linked_kitems: [{
id: af4e0334-6325-4ae7-91fd-cc1b21864cf1
}, {
id: 379e07a7-acd3-45dd-8bbd-ad5edb549946
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'Producer': 'TestingLab GmBH', 'Room Number': 'A404', 'Description': 'Bending Test Machine'}
created_at: 2024-08-23T18:16:40.453930
updated_at: 2024-08-23T18:16:40.453930
,
id: 8155c264-c790-4151-bff5-471e6a64fc21
name: Machine-2
slug: machine-2-8155c264
ktype_id: testing-machine
summary: None
avatar_exists: False
annotations: [{
iri: https://w3id.org/steel/ProcessOntology/TestingMachine,
name: TestingMachine,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}]
linked_kitems: [{
id: ce4309d3-cb6b-4fe0-85e6-d74e0b282b5d
}, {
id: 379e07a7-acd3-45dd-8bbd-ad5edb549946
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'Producer': 'StressStrain GmBH', 'Room Number': 'B500', 'Description': 'Compression Test Machine'}
created_at: 2024-08-23T18:16:42.132533
updated_at: 2024-08-23T18:16:42.132533
]}
Again, we are able to fetch the “real” KItem by using the fetch method of the linked KItem:
[11]:
item5.linked_kitems.by_annotation["https://w3id.org/steel/ProcessOntology/TestingMachine"][0].fetch()
[11]:
KItem(
name = Machine-1,
id = 31a7d354-6dfc-4aa5-832c-a1e581757193,
ktype_id = testing-machine,
in_backend = True,
slug = machine-1-31a7d354,
annotations = [
{
iri: https://w3id.org/steel/ProcessOntology/TestingMachine,
name: TestingMachine,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}
],
attachments = [],
linked_kitems = [
id: af4e0334-6325-4ae7-91fd-cc1b21864cf1
name: Specimen-1
slug: specimen-1-af4e0334
ktype_id: specimen
summary: None
avatar_exists: False
annotations: [{
iri: https://w3id.org/steel/ProcessOntology/TestPiece,
name: TestPiece,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}]
linked_kitems: [{
id: 31a7d354-6dfc-4aa5-832c-a1e581757193
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'sampletype': None, 'sampleinformation': None, 'sampleproductionprocess': None, 'Geometry': 'Cylindrical 150mm x 20mm x 40mm', 'Material': 'Concrete', 'Project ID': 'ConstructionProject2024'}
created_at: 2024-08-23T18:16:43.773825
updated_at: 2024-08-23T18:16:43.773825
,
id: 379e07a7-acd3-45dd-8bbd-ad5edb549946
name: Research Institute ABC
slug: researchinstituteabc-379e07a7
ktype_id: organization
summary: None
avatar_exists: False
annotations: [{
iri: www.researchBACiri.org/foo,
name: foo,
namespace: www.researchBACiri.org,
description: None
}]
linked_kitems: [{
id: 31a7d354-6dfc-4aa5-832c-a1e581757193
}, {
id: 8155c264-c790-4151-bff5-471e6a64fc21
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: None
created_at: 2024-08-23T18:16:46.777379
updated_at: 2024-08-23T18:16:46.777379
],
affiliations = [],
authors = [
{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}
],
avatar_exists = False,
contacts = [],
created_at = 2024-08-23 18:16:40.453930,
updated_at = 2024-08-23 18:16:40.453930,
external_links = [],
kitem_apps = [],
summary = None,
user_groups = [],
custom_properties = {
Producer: TestingLab GmBH,
Room Number: A404,
Description: Bending Test Machine
},
dataframe = None,
rdf_exists = False
)
Additionally, we can retrieve the linked KItems grouped by ktype:
[12]:
item5.linked_kitems.by_ktype
[12]:
{<KTypes.TestingMachine: 'testing-machine'>: [
id: 31a7d354-6dfc-4aa5-832c-a1e581757193
name: Machine-1
slug: machine-1-31a7d354
ktype_id: testing-machine
summary: None
avatar_exists: False
annotations: [{
iri: https://w3id.org/steel/ProcessOntology/TestingMachine,
name: TestingMachine,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}]
linked_kitems: [{
id: af4e0334-6325-4ae7-91fd-cc1b21864cf1
}, {
id: 379e07a7-acd3-45dd-8bbd-ad5edb549946
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'Producer': 'TestingLab GmBH', 'Room Number': 'A404', 'Description': 'Bending Test Machine'}
created_at: 2024-08-23T18:16:40.453930
updated_at: 2024-08-23T18:16:40.453930
,
id: 8155c264-c790-4151-bff5-471e6a64fc21
name: Machine-2
slug: machine-2-8155c264
ktype_id: testing-machine
summary: None
avatar_exists: False
annotations: [{
iri: https://w3id.org/steel/ProcessOntology/TestingMachine,
name: TestingMachine,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}]
linked_kitems: [{
id: ce4309d3-cb6b-4fe0-85e6-d74e0b282b5d
}, {
id: 379e07a7-acd3-45dd-8bbd-ad5edb549946
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'Producer': 'StressStrain GmBH', 'Room Number': 'B500', 'Description': 'Compression Test Machine'}
created_at: 2024-08-23T18:16:42.132533
updated_at: 2024-08-23T18:16:42.132533
]}
… and retrieve them by type:
[13]:
item5.linked_kitems.by_ktype[dsms.ktypes.TestingMachine][0].fetch()
[13]:
KItem(
name = Machine-1,
id = 31a7d354-6dfc-4aa5-832c-a1e581757193,
ktype_id = testing-machine,
in_backend = True,
slug = machine-1-31a7d354,
annotations = [
{
iri: https://w3id.org/steel/ProcessOntology/TestingMachine,
name: TestingMachine,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}
],
attachments = [],
linked_kitems = [
id: af4e0334-6325-4ae7-91fd-cc1b21864cf1
name: Specimen-1
slug: specimen-1-af4e0334
ktype_id: specimen
summary: None
avatar_exists: False
annotations: [{
iri: https://w3id.org/steel/ProcessOntology/TestPiece,
name: TestPiece,
namespace: https://w3id.org/steel/ProcessOntology,
description: None
}]
linked_kitems: [{
id: 31a7d354-6dfc-4aa5-832c-a1e581757193
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: {'sampletype': None, 'sampleinformation': None, 'sampleproductionprocess': None, 'Geometry': 'Cylindrical 150mm x 20mm x 40mm', 'Material': 'Concrete', 'Project ID': 'ConstructionProject2024'}
created_at: 2024-08-23T18:16:43.773825
updated_at: 2024-08-23T18:16:43.773825
,
id: 379e07a7-acd3-45dd-8bbd-ad5edb549946
name: Research Institute ABC
slug: researchinstituteabc-379e07a7
ktype_id: organization
summary: None
avatar_exists: False
annotations: [{
iri: www.researchBACiri.org/foo,
name: foo,
namespace: www.researchBACiri.org,
description: None
}]
linked_kitems: [{
id: 31a7d354-6dfc-4aa5-832c-a1e581757193
}, {
id: 8155c264-c790-4151-bff5-471e6a64fc21
}]
external_links: []
contacts: []
authors: [{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}]
linked_affiliations: []
attachments: []
user_groups: []
custom_properties: None
created_at: 2024-08-23T18:16:46.777379
updated_at: 2024-08-23T18:16:46.777379
],
affiliations = [],
authors = [
{
user_id: 7f0e5a37-353b-4bbc-b1f1-b6ad575f562d
}
],
avatar_exists = False,
contacts = [],
created_at = 2024-08-23 18:16:40.453930,
updated_at = 2024-08-23 18:16:40.453930,
external_links = [],
kitem_apps = [],
summary = None,
user_groups = [],
custom_properties = {
Producer: TestingLab GmBH,
Room Number: A404,
Description: Bending Test Machine
},
dataframe = None,
rdf_exists = False
)
Clean up the DSMS from the tutortial:
[14]:
del dsms[item1]
del dsms[item2]
del dsms[item3]
del dsms[item4]
del dsms[item5]
dsms.commit()