#519 precision should be a member of att.datable*


This bug report is a follow-up on the discussion found in https://listserv.brown.edu/archives/cgi-bin/wa?A2=tei-l;fc2bf4f.1307.

Bug #585 contains a proposal to deal with fuzzy dates:

<state from="1382" to="1477">
   <precision match="@from" atLeast="1382" atMost="1430"/>
   <precision match="@to" atLeast="1444"  atMost="1477"/>
   <p>Catholicos-Patriarch of the Church of the East.</p> 

That report proposed the addition of att.ranging to precision. In an e-mail discussion, Thomas A. Carlson pointed out that this covers the case of full-year dates, but fails to model more precise date information since att.ranging has a data type of data.numeric. But it might also be desirable to encode something like this:

<state type="reign" from="0501" to="0503-06-15">
    <precision match="@to" notBefore="0503-05-17" notAfter="0503-07-12"/>

For this reason, I propose to add att.datable* to precision. This would allow to use notBefore* and notAfter* to encode precision of dates.


  • Martin Holmes

    Martin Holmes - 2014-11-17

    In order to avoid ambiguity, perhaps we should provide a Schematron rule that says if a precision element uses att.datable attributes, its @target or @match should point to an att.datable attribute too; otherwise there's a lot of potential for ambiguity (@notBefore and @notAfter on precision pointing at @type -- what does that mean?).

  • James Cummings

    James Cummings - 2014-11-17
    • assigned_to: Martin Holmes
  • James Cummings

    James Cummings - 2014-11-17

    Assigning to Martin Holmes pending Council agreement.

  • James Cummings

    James Cummings - 2014-11-17
    • Group: AMBER --> GREEN
  • James Cummings

    James Cummings - 2014-11-17

    Council Agrees: Assigned to MH to implement, but run decisions passed Council, re: schematron constraint.

  • Martin Holmes

    Martin Holmes - 2014-11-19

    Dating attributes added in [r13070].



    Commit: [r13070]

    Last edit: Martin Holmes 2014-11-19
  • Martin Holmes

    Martin Holmes - 2014-11-19

    Here's my quick and dirty shot at a Schematron rule. It's pretty ugly:

    <constraintSpec ident="precision-1" scheme="isoschematron">
        <desc>If the <gi>precision</gi> element uses dating attributes, then 
        its @target or @match attribute must point to a dating attribute.</desc>
            <rule xmlns="http://purl.oclc.org/dsdl/schematron" context="tei:*precision[@when or @when-custom or @when-iso or @from or @from-custom or @from-iso or @to or @to-custom or @to-iso or @from or @from-custom or @from-iso or @notBefore or @notBefore-custom or @notBefore-iso or @notAfter or @notAfter-custom or @notAfter-iso]]">
                <assert test="matches(tokenize(@match, '/')[last()], '^@((when)|(from)|(to)|(from)|(notBefore)|(notAfter)).*') or matches(tokenize(@target, '/')[last()], '^@((when)|(from)|(to)|(from)|(notBefore)|(notAfter)).*')">
                    Where dating attributes are used on <name/>, the target or match of the <name/> element 
                    must also be a dating attribute.

    All comments appreciated.

  • Sebastian Rahtz

    Sebastian Rahtz - 2014-11-19

    You're playing with fire there. @target can be an arbitrary URL, and @match an arbitrary XPath expression, I think? Very very hard to check that sort of thing. But then I am not sure I understand the thing anyway :-}

  • Martin Holmes

    Martin Holmes - 2014-11-19

    You're absolutely right; I have no confidence that this can reliably be done (for instance, I'm assuming you're using @ to reference an attribute). Syd seemed to think it could be, but in the past I have comprehensively convinced myself (by trying) that XPath can't be used to parse XPath. To be honest I think it's safer not to attempt this; the number of users this feature will help is tiny, and if it doesn't work properly it might really bite them.

  • Martin Holmes

    Martin Holmes - 2015-05-25

    I propose closing this ticket without adding the Schematron, since I don't believe it can be coded safely; I don't believe you can parse XPath with XPath. Council should consider this at the FtF in Ann Arbor and see if it's possible to construct working Schematron, or agree to close the ticket without it. The main purpose of the ticket (adding dating attributes to <precision>) has been accomplished.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks