1

Can you explain the concept of relationships in hyperledger composer, defined by the "arrow -->"?

Anam Nizami
  • 377
  • 1
  • 4
  • 22

1 Answers1

0

A relationship in the Composer language is a tuple composed of:

  1. The namespace of the type being referenced
  2. The type name of the type being referenced
  3. The identifier of the instance being referenced

A Relationship is a typed pointer to an instance. i.e the relationship with

 namespace = 'org.acme', 
    type = 'Vehicle',
    id = 'ABC' 

creates a pointer that points at an instance of org.acme.Vehicle with the id ABC.

For more details you can have use below links.

https://hyperledger.github.io/composer/jsdoc/module-composer-common.Relationship.html

https://hyperledger.github.io/composer/reference/cto_language.html

kots
  • 320
  • 1
  • 7