farling42 / csv2rw

Migrate data from CSV or XLSX files into Realm Works
GNU General Public License v3.0
3 stars 1 forks source link

Create connections during import #36

Closed farling42 closed 5 years ago

farling42 commented 6 years ago

Use a defined column to contain the name that matches a topic being created.

The column containing the reference needs to be copied to a new "connection" object

A connection can be attached to a topic or a plot

<connection target_id="id" target_role="role" nature="nature" 
    rating="rating(-3 to 3)" attitude="attitude"qualifier_tag_id="id" 
    qualifier="text" is_revealed="true(default false)" reveal_date="date">
<annotation>description</annotation>
</connection>

role (record_role) (default: Topic): Topic, Plot, Ext_Object, Smart_Image, Package, Snippet, Section, Plot_Node, Facet, Map_Pin, Partition, Tag, Alias, Connection, Asset, Plot_Group, Category, Domain

nature: Arbitrary, Generic, Union, Parent_To_Offspring, Offspring_To_Parent, Master_To_Minion, Minion_To_Master, Public_Attitude_Towards, Private_Attitude_Towards

attitude: Hostile, Angry, Annoyed, Neutral, Pleased, Friendly, Gracious

qualifier = dependent on role: from one of the domains in the structure definition:

NOTE: Whilst some links are two-way and others are one-way, Realm Works will create the reverse link for all connections; so the RWEXPORT file only needs to contain one of the links (which makes code A LOT easier).


<connection target_id="Topic_3" nature="Master_To_Minion" qualifier_tag_id="Tag_212" qualifier="Residence / Resident"/>
<connection target_id="Topic_7" nature="Arbitrary"/>
<connection target_id="Topic_10" nature="Public_Attitude_Towards" rating="2" attitude="Friendly"/>
<connection target_id="Topic_11" nature="Private_Attitude_Towards" rating="0" attitude="Neutral"/>
<connection target_id="Topic_33" nature="Minion_To_Master" qualifier_tag_id="Tag_210" qualifier="Owner / Subsidiary"/>
<connection target_id="Topic_9" nature="Union"/>
<connection target_id="Topic_31" nature="Generic" qualifier_tag_id="Tag_367" qualifier="General Family"/>

<domain_global domain_id="Domain_20" name="Comprises Relationship Types">
    <tag_global tag_id="Tag_205" name="Affiliation / Member" />
    <tag_global tag_id="Tag_206" name="Depends On / Depended Upon By" />
    <tag_global tag_id="Tag_207" name="Employer / Employee"/>
    <tag_global tag_id="Tag_208" name="Master / Minion"/>
    <tag_global tag_id="Tag_209" name="Organization / Chapter"/>
    <tag_global tag_id="Tag_210" name="Owner / Subsidiary" />
    <tag_global tag_id="Tag_211" name="Parent / Child"  />
    <tag_global tag_id="Tag_212" name="Residence / Resident" />
    <tag_global tag_id="Tag_213" name="Supervisor / Subordinate" />
</domain_global>

<domain_global domain_id="Domain_34" name="Generic Relationship Types">
    <tag_global tag_id="Tag_366" name="Equivalence"/>
    <tag_global tag_id="Tag_367" name="General Family"/>
    <tag_global tag_id="Tag_368" name="Peer"/>
    <tag_global tag_id="Tag_369" name="Personal"/>
</domain_global>

Comprises or Encompasses / Belongs To or Within

Residence / Resident Depends On / Depended Upon By Affiliation / Member Master / Minion Supervisor / Subordinate Employer / Employee Owner / Subsidiary Organization / Chapter Parent / Child

Two way connection

<connection target_id="Topic_3" nature="Master_To_Minion" qualifier_tag_id="Tag_212" qualifier="Residence / Resident">
<connection target_id="Topic_33" nature="Minion_To_Master" qualifier_tag_id="Tag_210" qualifier="Owner / Subsidiary">

<domain_global domain_id="Domain_20" name="Comprises Relationship Types">
    <tag_global tag_id="Tag_205" name="Affiliation / Member" />
    <tag_global tag_id="Tag_206" name="Depends On / Depended Upon By" />
    <tag_global tag_id="Tag_207" name="Employer / Employee"/>
    <tag_global tag_id="Tag_208" name="Master / Minion"/>
    <tag_global tag_id="Tag_209" name="Organization / Chapter"/>
    <tag_global tag_id="Tag_210" name="Owner / Subsidiary" />
    <tag_global tag_id="Tag_211" name="Parent / Child"  />
    <tag_global tag_id="Tag_212" name="Residence / Resident" />
    <tag_global tag_id="Tag_213" name="Supervisor / Subordinate" />
</domain_global>

Family Relationship To

Parent of (actually stored as "Belongs To or Within - Parent/Child") Child of (actually stored as "Belongs To or Within - Parent/Child") Immediate Ancestor of Offspring of Other Family of (actually stored as "Simple connection to - General Family") Union with

On creating the "Family Relationship To/Parent of" within RW, it is immediately changed to "Belongs To or Within - Parent/Child".

Two way connection

<connection target_id="Topic_9" nature="Union"/> for "Union"
<connection target_id="Topic_9" nature="Parent_To_Offspring"/> for "Immediate Ancestor Of"

Public Attitude Towards / Private Attitude Towards

attitude attribute: Graciously, Friendly, Pleased, Neutral, Annoyed, Angry Hostile

rating attribute: 3 to -3

The connection is one-way (no connection back from target to source).

<connection target_id="Topic_10" nature="Public_Attitude_Towards" rating="2" attitude="Friendly">
<connection target_id="Topic_11" nature="Private_Attitude_Towards" rating="0" attitude="Neutral">

Simple Connection to

Qualifiers: Peer, Equivalance, Personal, General Family

_The same qualifier_tagid is used in both topics

<connection target_id="Topic_31" nature="Generic" qualifier_tag_id="Tag_367" qualifier="General Family"/>

<domain_global domain_id="Domain_34" name="Generic Relationship Types">
    <tag_global tag_id="Tag_366" name="Equivalence"/>
    <tag_global tag_id="Tag_367" name="General Family"/>
    <tag_global tag_id="Tag_368" name="Peer"/>
    <tag_global tag_id="Tag_369" name="Personal"/>
</domain_global>

Arbitrary connection to

No qualifiers

The connection is one-way (no connection back from target to source).

<connection target_id="Topic_7" nature="Arbitrary">
farling42 commented 5 years ago

Implemented in V1.46