Extensions

Extensions hold information tools need alongside the ontology, such as data sources and mappings for importing data, diagram layout, and custom data.

Custom data

Many objects have a custom field, directly or under their extensions, for any other data to keep with the model. The specification gives it no meaning. Grouping data under a key named after the tool or organisation that writes it avoids clashes with data written by other tools.

nodes:
  person:
    label: Person
    extensions:
      custom:
        acme:
          owner: catalogue-team

Model extensions

Extensions for a graph model.

Field Type Required Description

data_source_tables

map of table

No

Data source table schemas keyed by table id.

data_source_mappings

map of list of mapping

No

Sets of data source mappings from tables to nodes and relationships, often used for importing.

custom

map

No

User-defined arbitrary data.

Node extensions

Extensions for a node.

Field Type Required Description

indexes

map of node index

No

Database indexes on this node keyed by id.

display

node display

No

Optional visual information of this node.

custom

map

No

User-defined arbitrary data.

Node display

Visual information for a node.

Field Type Required Description

x

number

Yes

Horizontal position.

y

number

Yes

Vertical position.

colour

string

No

Display colour of the node as a hex string, e.g. #FF8800.

custom

map

No

User-defined arbitrary data.

Relationship extensions

Extensions for a relationship.

Field Type Required Description

indexes

map of relationship index

No

Indexes on this relationship keyed by id.

custom

map

No

User-defined arbitrary data.

Table

A data source table schema.

Field Type Required Description

source

string

Yes

Where the table’s data comes from.

columns

list of table column

No

Columns of the table in their source order.

primary_keys

list of strings

No

Names of the columns making up the primary key.

foreign_keys

map of foreign key

No

Foreign keys of the table keyed by id.

custom

map

No

User-defined arbitrary data.

Table column

A column of a data source table.

Field Type Required Description

name

string

No

Name of the column in the source. Unique within the table.

type

string

No

Data type of the column in the source.

size

integer

No

Size of the column.

suggested

type

No

Neo4j type suggested for values of this column.

supported

list of type

No

Neo4j types values of this column can be converted to when using the import tool.

nullable

boolean

No

Whether the column can hold null values. Defaults to true.

dimension

integer

No

Dimension of the column when it holds vectors.

custom

map

No

User-defined arbitrary data.

Foreign key

A foreign key of a table.

Field Type Required Description

columns

list of strings

Yes

Names of the columns in this table which make up the key.

references

foreign key reference

Yes

The table and columns the key refers to.

custom

map

No

User-defined arbitrary data.

Foreign key reference

The target of a foreign key.

Field Type Required Description

table

string

Yes

Id of the referenced table.

columns

list of strings

No

Names of the referenced columns.

custom

map

No

User-defined arbitrary data.

Mapping

A mapping from a data source table to the graph. Either a node, relationship or query mapping.

One of node mapping, query mapping, relationship mapping, chosen by its type.

Node mapping

Maps rows of a table to nodes.

Field Type Required Description

type

NODE

Yes

Always NODE.

node

string

Yes

Id of the node being mapped.

table

string

Yes

Id of the source table.

properties

map of property mapping

Yes

Mappings from property ids to source columns.

mode

mapping mode

No

Whether nodes are merged with existing nodes or always created.

match_label

string

No

Label used to match existing nodes.

key

list of strings

No

Ids of the properties which identify a node.

depends_on

string

No

Id of another mapping in the same list which must be imported before this one. Empty when there is no dependency.

id

string

No

Optional id of this mapping, so other mappings in the same list can reference it in depends_on.

Relationship mapping

Maps rows of a table to relationships.

Field Type Required Description

type

RELATIONSHIP

Yes

Always RELATIONSHIP.

relationship

string

Yes

Id of the relationship being mapped.

table

string

Yes

Id of the source table.

from_node

target mapping

Yes

How the start node of the relationship is matched.

to_node

target mapping

Yes

How the end node of the relationship is matched.

match_label

string

No

Label used to match existing relationships.

properties

map of property mapping

No

Mappings from property ids to source columns.

mode

mapping mode

No

Whether relationships are merged with existing relationships or always created.

key

list of strings

No

Ids of the properties which identify a relationship.

depends_on

string

No

Id of another mapping in the same list which must be imported before this one. Empty when there is no dependency.

id

string

No

Optional id of this mapping, so other mappings in the same list can reference it in depends_on.

Query mapping

Maps the results of a query run against a table.

Field Type Required Description

type

QUERY

Yes

Always QUERY.

table

string

Yes

Id of the source table.

query

string

Yes

The query to run.

depends_on

string

No

Id of another mapping in the same list which must be imported before this one. Empty when there is no dependency.

id

string

No

Optional id of this mapping, so other mappings in the same list can reference it in depends_on.

Property mapping

Maps a property to a source column.

Field Type Required Description

column

string

Yes

Name of the source column.

Target mapping

Identifies a node at one end of a mapped relationship.

Field Type Required Description

label

string

No

Label of the node.

properties

map of property mapping

No

Mappings from property ids to source columns used to match the node.

Mapping mode

Write approach used when importing data (merged into existing data or always created).

MERGE, CREATE