Skip to content

Flatten node_bindings into a list of strings (node IDs) #517

@colleenXu

Description

@colleenXu

[Depends on #506 AND #516, similar to what's being proposed in #505 for path_bindings]

The node_bindings values (defined using additionalProperties) are arrays of NodeBinding objects. If we decide to remove attributes and query_id from NodeBinding (see #506 AND #516), this object will only have 1 defined property, id.

If we aren't taking advantage of the NodeBinding object structure (having other properties besides id), it would be more concise and simple to make the node_bindings value an array of strings (node ids) instead.


The current spec

        node_bindings:
          type: object
          description: >-
            The dictionary of Input Query Graph to Result Knowledge Graph node
            bindings where the dictionary keys are the key identifiers of the
            Query Graph nodes and the associated values of those keys are
            instances of NodeBinding schema type (see below). This value is an
            array of NodeBindings since a given query node may have multiple
            knowledge graph Node bindings in the result.
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/NodeBinding'
            minItems: 1
          nullable: false 
...
    NodeBinding:
      type: object
      description: >-
          An instance of NodeBinding is a single KnowledgeGraph Node mapping,
          identified by the corresponding 'id' object key identifier of the
          Node within the Knowledge Graph. Instances of NodeBinding may
          include extra annotation in the form of additional properties.
          (such annotation is not yet fully standardized). Each Node
          Binding must bind directly to node in the original Query Graph.
      properties:
        id:
          oneOf:
            - $ref: '#/components/schemas/CURIE'
          nullable: false
          description: >-
            The CURIE of a Node within the Knowledge Graph.
        query_id:
          oneOf:
            - $ref: '#/components/schemas/CURIE'
          description: >-
            An optional property to provide the CURIE in the QueryGraph to
            which this binding applies. If the bound QNode does not have an
            an 'id' property or if it is empty, then this query_id MUST be
            null or absent. If the bound QNode has one or more CURIEs
            as an 'id' and this NodeBinding's 'id' refers to a QNode 'id'
            in a manner where the CURIEs are different (typically due to
            the NodeBinding.id being a descendant of a QNode.id), then
            this query_id MUST be provided. In other cases, there is no
            ambiguity, and this query_id SHOULD NOT be provided.
          nullable: true
        attributes:
          type: array
          description: >-
            A list of attributes providing further information about the
            node binding. This is not intended for capturing node attributes
            and should only be used for properties that vary from result to
            result.
          items:
            $ref: '#/components/schemas/Attribute'
          minItems: 1
          nullable: false
      additionalProperties: true
      required:
        - id

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions