Article View: comp.text.sgml
Article #31Re: SGML and Data Representation
From: C. M. Sperberg-McQueen
Date: Wed, 22 Jul 1992 14:57
Date: Wed, 22 Jul 1992 14:57
65 lines
3268 bytes
3268 bytes
Darrell Raymond writes:
> I have a text of some length that contains many elements that overlap.
> I want you to find a way to tag the document so that the tags demarcate
> all the possible intersections of the elements. For example:
>
> <X>now is the <Y>time</X> for all good men</Y>
>
> This tagging shows an X and a Y element that overlap only for "time",
> but have their own content otherwise (X is "now is the time", and Y
> is "time for all good men"). If it helps, think of yourself describing
> a Venn diagram and all its possible intersections.
>
> What I want you to do is tell me how you would mark up such a document
> where the number of overlapping components is n. Note that the number of
> possible intersections is 2**n - 1. And to count as "expressed by SGML",
> the description must be within what SGML can enforce; if the DTD permits
> some other reasonable interpretation of the document, you lose.
Is n fixed or unbounded? For fixed n, a simple solution is to use n
concurrent markup streams. For unbounded n, one is limited to the
technique known as 'lying to the parser' by defining empty elements
which mark the beginning and ending of the spans you are interested in
marking:
<!DOCTYPE demo [
<!ELEMENT demo - - ANY >
<!ELEMENT begin - O EMPTY >
<!ATTLIST begin
id ID #REQUIRED
name CDATA #REQUIRED
end IDREF #REQUIRED >
<!ELEMENT end - O EMPTY >
<!ATTLIST end
id ID #REQUIRED
begin IDREF #REQUIRED >
]>
<demo>
<start id=s1 name=X end=s3>
Now is the
<start id=s2 name=Y end=s4>
time
<end id=s3 begin=s1>
for all good citizens
<end id=s4 begin=s2>
to come to the aid of the party.
</demo>
Since Elliot may (will?) claim this does the trick, and Darrell may (will?)
claim it does not, since SGML cannot enforce the matching between the
IDs and IDREFs of the START and END pairs, I think the readers of the group
need to vote on whether this fulfills the terms of the wager. I personally
think that if Elliot can't come up with something better than this for
arbitrary n, then he owes Darrell some of that home brew.
One can also do this by pointing into the text, as allowed by HyTime
and by TEI annotation mechanisms. They don't provide much better
validation than the example here, though.
I would be grateful, however, to know if anyone knows any existing
markup or modeling language which handles this problem more gracefully.
Darrell referred to Vincent Quint as though familiar with his work;
do Quint's languages handle this better than SGML? How do they work?
-Michael Sperberg-McQueen
Technical Details
Message-ID:
<92204.095707U35395@uicvm.uic.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!uicvm.uic.edu!u35395References:
<9207202246.AA15855@ucbvax.Berkeley.EDU> <BrrMCH.4LK@watdragon.waterloo.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!uicvm.uic.edu!u35395 Organization: University of Illinois at Chicago Date: Wednesday, 22 Jul 1992 09:57:07 CDT From: C. M. Sperberg-McQueen <U35395@uicvm.uic.edu> Message-ID: <92204.095707U35395@uicvm.uic.edu> Newsgroups: comp.text.sgml Subject: Re: SGML and Data Representation References: <9207202246.AA15855@ucbvax.Berkeley.EDU> <BrrMCH.4LK@watdragon.waterloo.edu> Lines: 65