Eurotermbank / Federated-Network-Toolkit-deployment

Other
2 stars 1 forks source link

That term-id is changed when TBX is imported leads to that references to the term posts are broken #11

Open mariask2 opened 3 years ago

mariask2 commented 3 years ago

My original TBX file looks like this:


<martifHeader>
  <fileDesc>
    <sourceDesc>
      <p>A term collection to test if the reference targets work</p>
    </sourceDesc>
  </fileDesc>
  <encodingDesc>
    <p type="XCSURI">https://eurotermbank.com/tbx.xcs</p>
  </encodingDesc>
  <text>
    <body>
      <termEntry id="ISOF ID 1">
        <langSet xml:lang="en">
          <ntig>
            <termGrp>
              <term>computer</term>
            </termGrp>
          </ntig>
        </langSet>
      </termEntry>
      <termEntry id="ISOF ID 2">
        <langSet xml:lang="en">
          <ntig>
            <termGrp>
              <term>computer monitor</term>
            </termGrp>
          </ntig>
        </langSet>
        <ref target="ISOF ID 1" type="see">See content
    related to the conept computer</ref>
      </termEntry>
    </body>
  </text>
</martifHeader>

Then I import it into the tool, and export it from there. Then it looks like this:


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE martif SYSTEM "https://www.gala-global.org/sites/default/files/uploads/pdfs/TBXcoreStructV02%20%281%29.dtd">
<martif type="TBX" xml:lang="en">
  <martifHeader>
    <fileDesc>
      <sourceDesc>
        <p>A term collection to test if the reference targets work</p>
      </sourceDesc>
    </fileDesc>
    <encodingDesc>
      <p type="XCSURI">https://eurotermbank.com/tbx.xcs</p>
    </encodingDesc>
  </martifHeader>
  <text>
    <body><termEntry id="tgl-215">
  <langSet xml:lang="en">
    <ntig>
      <termGrp>
        <term>computer</term>
      </termGrp>
    </ntig>
  </langSet>
  <note>Original termEntry ID: ISOF ID 1</note>
</termEntry><termEntry id="tgl-216">
  <langSet xml:lang="en">
    <ntig>
      <termGrp>
        <term>computer monitor</term>
      </termGrp>
    </ntig>
  </langSet>
  <ref target="ISOF ID 1" type="see">See content
    related to the conept computer</ref>
  <note>Original termEntry ID: ISOF ID 2</note>
</termEntry></body>
  </text>
</martif>

The "id" for the termEntry has change from "ISOF ID 1" to "tgl-215", but the target in the reference uses the old id:


<ref target="ISOF ID 1" type="see">See content related to the conept computer</ref>

Please note: I am not completely sure that the syntax I use for <ref target ...> is correct, so that could be a reason it doesn't work.

andish commented 3 years ago

2 options: 1) Original entry ID should be preserved (in the same time must assign new one to ensure uniqueness across whole ETB db) or 2) new entry IDs should be changed to new ones as well in relations