Example
The database
As an example we set up a database that contains the following schema.
[{:db/ident :local-id
:db/doc "Local identifier for the entity."
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db/unique :db.unique/identity}
{:db/ident :occupation
:db/doc "Occupation of the entity."
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}
{:db/ident :annotation
:db/doc "Annotations for the entity."
:db/valueType :db.type/string
:db/cardinality :db.cardinality/many}
{:db/ident :remote-id
:db/doc "Remote identifier for the entity."
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db/unique :db.unique/identity}]
And fill it with this data describing roles, actors and extras who have played roles in film adaptions of the novel Treasure Island by Robert Luis Stevenson.
[{:remote-id "NOT MAPPED"}
{:local-id "Presenter"
:occupation "Disembodied Voice of the Narrative"}
{:remote-id "Walt Disney"}
{:local-id "Hispaniola"
:annotation "This is the fictional ship!"}
{:remote-id "Hispaniola"
:annotation "This is the actual boat!"}
{:local-id "Long John Silver"
:occupation "Mighty Pirate!"}
{:remote-id "Robert Newton"
:annotation ["An irrelevant fact."
"And another one."]
:occupation "Not A Scientist Actually"}
{:remote-id "L. Charles"
:occupation "Actor!"}
{:remote-id "Eddie Izzard"}
{:local-id "Captain Smollett"}
{:remote-id "Basil Sydney"}
{:remote-id "Fred Tooze"}
{:remote-id "Philip Glenister"}
{:local-id "Jim Hawkins"}
{:remote-id "Bobby Driscoll"}
{:remote-id "Michael Croudson"}
{:remote-id "Toby Regbo"}
{:local-id "Just This Guy, You Know"
:occupation "Galactic President"}]
Now we have a database with information, but it lacks relations. Who played what and when?
Mappings
Treasure Island (1950)
{:mapping
{:type :default
:organisation "The Mighty Pirates"
:family "Epics"
:name "Skattkammarön"
:version "1950"
:taxonomy-version "23"
:description "En film om en skattkammare på en ö."
:uri "https://www.imdb.com/title/tt0043067/"}
:config
{:source
{:id :local-id
:include
{:occupation :role}}
:target
{:id :remote-id
:mapping :remote-id
:include {:occupation :occupation}}}
:data
{:edges
[["Presenter" "Walt Disney"]
["Hispaniola" "Hispaniola"]
["Long John Silver" "Robert Newton"]
["Long John Silver" "L. Charles"]
["Captain Smollett" "Basil Sydney"]
["Captain Smollett" "Fred Tooze"]
["Jim Hawkins" "Bobby Driscoll"]
["Jim Hawkins" "Michael Croudson"]]}}
Treasure Island (2021)
{:mapping
{:type :default
:organisation "The Mighty Pirates"
:family "Epics"
:name "Skattkammarön"
:version "2012"
:taxonomy-version "23"
:description "En helt ny film om en skattkammare på en ö."
:uri "https://www.imdb.com/title/tt1820723/"}
:config
{:source
{:id :local-id}
:target
{:id :remote-id
:mapping :remote-id}}
:data
{:targets [{:db/id "not-mapped"
:mapping.external/id "N/A"
:mapping.external/annotations
["This is source has no mapping."]
:mapping.external/key-value-data
[[:label "Not Mapped"]]}]
:edges [["Presenter" {:db/id "not-mapped"}]
["Hispaniola" "Hispaniola"]
["Long John Silver" "Eddie Izzard"]
["Captain Smollett" "Philip Glenister"]
["Jim Hawkins" "Toby Regbo"]]}}
Updatable mappings and edges
If there is a new EURES ESCO v. 2.0.0-alpha under test and the edge is valid under this new version the update could be encoded as follows:
{:id <eures_esco_v_2.0.0-alpha_entity_id>
:family "EURES"
:name "ESCO"
:testing "This is just for internal exploration ..."
:version "2.0.0-alpha"
:bi-directional false}
{:source <source_entity_id>
:target <target_entity_id>
:mapping [ <eures_esco_v_1.0.9_entity_id>
<eures_esco_v_2.0.0-alpha_entity_id> ]}