Schema

The following schema covers the functionality of the mapping subsystem.

Mappings

The mapping definitions must contain :mapping.mapping/type. The other attributes are optional.

[{:db/ident :mapping.mapping/type
  :db/doc "Indicates that the entity is a mapping description and gives it a type."
  :db/valueType :db.type/keyword
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.mapping/organisation
  :db/doc "The organisation providing the target mapping."
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.mapping/family
  :db/doc "The family of mappings this mapping belongs to."
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.mapping/name
  :db/doc "The name of this mapping."
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.mapping/uri
  :db/doc "A link to a description of the mapping."
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.mapping/description
  :db/doc "A description of the mapping."
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.mapping/version
  :db/doc "The verison of a mapping."
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.mapping/taxonomy-version
  :db/doc "The Taxonomy verison of a specific mapping."
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.mapping/slug
  :db/doc "The Taxonomy API route slugs that identifies one or more mappings."
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/many}]

Edges

[{:db/ident :mapping.edge/mapping
  :db/doc "The mappings under which an edge is valid."
  :db/valueType :db.type/ref
  :db/cardinality :db.cardinality/many}
 {:db/ident :mapping.edge/source
  :db/doc "The source entity of an edge."
  :db/valueType :db.type/ref
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.edge/target
  :db/doc "The target entity of an edge."
  :db/valueType :db.type/ref
  :db/cardinality :db.cardinality/one}]

External

[{:db/ident :mapping.external/source-attribute
  :db/doc "The source identifying attribute, or :id/db for entity-id."
  :db/valueType :db.type/keyword
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.external/target-attribute
  :db/doc "The target identifying attribute, or :id/db for entity-id."
  :db/valueType :db.type/keyword
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.external/attribute-mapping
  :db/doc "Attributes that should be taken from the source or target and added to the response. The tuple takes :source or :target, a database attribute and the name it should be given in the output map."
  :db/valueType :db.type/tuple
  :db/tupleTypes [:db.type/keyword :db.type/keyword :db.type/keyword]
  :db/cardinality :db.cardinality/many}
               ;; Created target entities
 {:db/ident :mapping.external/id
  :db/doc "Provides a string that represents an external ID."
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.external/uri
  :db/doc "Provides a string that represents an URI to an external resource for the mapping target."
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/one}
 {:db/ident :mapping.external/key-value-data
  :db/doc "Key-value data that should be added to the target entity."
  :db/valueType :db.type/tuple
  :db/tupleTypes [:db.type/keyword :db.type/string]
  :db/cardinality :db.cardinality/many}
 {:db/ident :mapping.external/annotations
  :db/doc "Annotations relating to the external target entity."
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/many}]