Hi @Kai Kang ,
Containers:
Containers act as the fundamental storage units for your data, much like tables in a SQL database. They hold raw data and form the base on which nodes, edges properties are built. Container can be used to populate properties on nodes and/or edges.
Nodes and Edges:
Nodes: Represent entities or objects in your data model, similar to records in a database table. It represents a real-world entity like a pump, sensor, pipeline segment, or any other relevant object in your industrial context. Think of it as a single record in a database table.
Edges and Direct relations represent relationships between nodes, establishing connections between different entities. (Direct relations are akin to foreign keys in a relational database)
Combining Containers with Nodes and Edges, CDF offers a strong framework for both data storage and defining complex relationships, catering to diverse data modeling and querying needs.
Instance: This is a broader term encompassing both nodes and edges. It essentially refers to any element within the knowledge graph.
Views and Connection Properties:
Views: Provide specific perspectives or interpretations of the data. They are virtual representations that focus on a subset of the data for particular use cases or analysis, similar to SQL views in a relational database.
Connection Properties: Define how different views relate and interact with each other, specifying how data in one view is connected to data in another.
In summary, Views and Connection Properties allow you to create tailored perspectives and interpretations of the data without altering the physical data itself. Nodes and Edges, on the other hand, serve as the building blocks for modeling complex relationships and networks within the data. While nodes and edges focus on the underlying structure and relationships, views and connection properties focus on presenting and interpreting that data effectively.
Let me know if this clarifies things!
Hi @Kai Kang
If you haven't taken it yet, I highly recommend that you take the Cognite Data Modeling 4-hour training available at Cognite Academy. The training material explains in detail how to craft schemas in CDF.
Happy studying!
Best regards,
André
Hi @Kanchana Premachandra
Thank you for your explanation, it helpsto understand data_modeling. I have completed the course but am still struggling to understand some aspects of cognite data modelling. Specifically, I am struggling to add a property to an edge.
In the course as well as the literature, it is mentioned that edges can traverse spaces and have properties (flowsTo can have a max pressure). In the example code though, I didn’t find examples with properties for the edges.
What I am trying to do seems simple enough. I have a container and a view called Sites, and another Container and View called Employees. I want to create an edge of type hasEmployees which has a property called ‘StartedOn: (Date())’. My questions are as follows:
- Where should I declare the property ‘StartedOn’? In the edge definition(EdgeApply)? or in the definition of the Node flows_to*? or both? or in the container that contains the edge definition?
- How to create instances of employees (Say employee_1, attached to , say Site_1 (Site_1 is the external_id of the Node for Site_1)
- Where will I see this property? Should I create a MappedPropertyApply() in whichever view (Employee or Site) that I want?
*In the course, an edge of type ‘flows_to’ is declared, using client.data_modeling.instances.apply(NodeApply()).
I will be grateful for your help.