Stylesheets icon indicating copy to clipboard operation
Stylesheets copied to clipboard

Issues with tei2rdf stylesheet

Open GermaineG opened this issue 8 years ago • 3 comments

I tried to use tei2rdf on a register file of organisations. Some issues have come up on that initially (I guess there might be more in the near future since my register is still work in progress and additional info will be added to it soon). Apologies for possible misunderstandings on my end, I am new to TEI, to CIDOC-CRM and to xslt ...

Major issue: orgs can have a place in TEI, but if they do, the tei2rdf results in invalid rdf:resources.

Example input:

<org xml:id="c06.a40b0b7b-ce3b-45eb-82f9-006bb7deb712"
                    type="library">
                  <orgName>National Library of Greece</orgName>
                  <place xml:id="c06.55309772-00d6-43e1-9744-daffc24bf1d8">
                     <location>
                        <geo xml:id="c06.4b819b9f-32d3-4744-a9d3-4fc45bb6f2e9">23.733249999999998 37.98116666666667</geo>
                     </location>
                     <placeName>
                        <settlement key="c06.50f45de5-c24d-409a-9448-1997785eaf70">Athens</settlement>
                        <country key="c06.3134dbab-f330-46fd-b4de-e3f5c0d7e212">Greece</country>
                     </placeName>
                  </place>
               </org>

result (invalid rdf):

   <E74_Group xmlns="http://purl.org/NET/crm-owl#"
              rdf:resource="http://www.example.com/place/c06.55309772-00d6-43e1-9744-daffc24bf1d8"/>

expected result would be something like that, maybe:

   <E74_Group xmlns="http://purl.org/NET/crm-owl#"
              rdf:about="http://www.example.com/org/c06.a40b0b7b-ce3b-45eb-82f9-006bb7deb712">
      <P74_has_current_or_former_residence rdf:resource="http://www.example.com/place/c06.55309772-00d6-43e1-9744-daffc24bf1d8"/>
   </E74_Group>

Reason and fix: The place definition gets transformed correctly, but the place is nested in the org definition without a property. For my need, as a quick fix, I have added a template for the match "org/place" similar to 'residence' for a person (xslt template "P74").

Minor Issue: orgNames

The transformation deals with placeNames and persNames, but not with orgNames, so organisations are transformed to E74 entities, but the identification gets lost (not really what I had in mind when creating a register of organisations ...).

For the input above I would expect something like this:

   <P131_is_identified_by>
         <E82_Actor_Appellation rdf:about="http://www.example.com/orgname/d4e367">
            <rdf:value>National Library of Greece</rdf:value>
         </E82_Actor_Appellation>
      </P131_is_identified_by>

Reason and fix: no template for orgName in tei2rdf. Template "E82" in crm.xsl only deals with personNames, not with orgNames. I think an orgName would be an E82 entity as well.

Bonus Issue/Question:

I am a bit confused about the resolution of refs for names. If I have something like this:

        <body>
            <div>
                <p>I mention a <placeName ref="#testid">place from within the file</placeName></p>
            </div>
            <div>
                <listPlace>
                    <place xml:id="testid">
                        <placeName>Testplace</placeName>
                    </place>
                </listPlace>
            </div>
        </body>

it creates two place entities in the rdf. Shouldn't it only produce one place with two <P87_is_identified_by> properties (one with "Testplace" and one with "place from within the file")?

And bonus bonus question: Would it be possible to take the prefixdef into account for refs? tei:resolveURI is already capable of that, if you use it like document(tei:resolveURI(...)). Of course it wouldn't work if the path cannot be resolved, but given a correct file or http path to another TEI file in the prefixDef it should work? Seems like a pretty difficult task to me to make it generic, but that is why I am asking here ;)

GermaineG avatar Aug 31 '17 08:08 GermaineG

I've made an attempt to fix your initial problem, and am waiting for permission to upload my new branch to the repository.

richardofsussex avatar Dec 07 '17 12:12 richardofsussex

Help wanted here – please see the PR #301 for additional comments

peterstadler avatar Jan 05 '18 14:01 peterstadler

Note the action on the PR: We should consult the Ontologies SIG for help with this.

ebeshero avatar Aug 15 '25 01:08 ebeshero