comparison annotate.html @ 66:d0edaceb04b6

first time to Sonra, Kostas
author Henry S. Thompson <ht@markup.co.uk>
date Mon, 12 Jun 2017 17:08:07 +0200
parents
children 95faecfcc1b5
comparison
equal deleted inserted replaced
65:53dd4ccac4fb 66:d0edaceb04b6
1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!DOCTYPE html
3 PUBLIC "-//HST//DTD XHTML5 1.0 Transitional//EN" "http://www.ltg.ed.ac.uk/~ht/xhtml5.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="copyright" content="Copyright &#169; 2016"/><meta http-equiv="Content-type" content="text/html; charset=utf-8"/><style type="text/css">
5 ul.nolabel { margin: 0; margin-left: -2.5em}
6 ul.naked.nolabel {margin: 0; margin-left: 0; padding-left: 0}
7 ul.cdefn {clear: both}
8 div.ndli { margin-bottom: 1ex }
9 div.hidden {display: none}
10
11 ul.naked > li { list-style-type: none; background: none; margin-left: 2em;
12 margin-bottom: 0 }
13 li ul.naked > li, dd ul.naked > li { list-style-type: none; background: none; margin-left: 0;
14 margin-bottom: 0 }
15 li.cdefni {}
16 li.cdefni span.cl {display: inline-block; vertical-align: bottom}
17 li.cdefni span.cr {display: inline-block; margin-left: 1em; vertical-align: bottom}
18 pre.code {display: inline-block}
19 blockquote.vanilla {display: inline-block; margin-left: 1em;
20 border: solid 1px; background: rgb(238,234,230);
21 padding: .5ex .5em}
22 blockquote.vanilla ul.naked li {margin-left: 0 ! important;font-size: 100%}
23 ol ol ol, ol ol ol li {list-style-type: lower-roman}
24 ol ol, ol ol li {list-style-type: lower-alpha}
25 i i {font-style: normal}
26 li li {font-style: normal}
27 li ul li {font-style: normal}
28 li { line-height: 100%; margin-top: 0.3em}
29 .math {font-family: 'Arial Unicode MS', 'Lucida Sans Unicode', serif}
30 .sub {font-size: 80%; vertical-align: sub}
31 .termref {text-decoration: none; color: #606000}
32 .licence {margin-left: 1em; font-size: 70%}
33 .credits {margin-left: 1.5em; font-size: 70%}
34 .right {position: absolute}
35 .stackdown {vertical-align: text-top; margin-top: 0}
36 body {font-size: 12pt}
37 @page { size: A4 portrait; margin: 2cm;
38 orphans: 2; widows: 2;}
39 @media screen {
40 body {width: 20cm; margin-left: auto; margin-right: auto}
41 }
42 @media print {
43 body {font-size: 10pt}
44 h1, h2, h3, h4 {page-break-after: avoid}
45 }
46 pre.code {font-family: monospace;
47 font-weight: bold;
48 line-height: 120%;
49 padding-top: 0.2em;
50 padding-bottom: 0.2em;
51 padding-left: 1em;
52 padding-right: 1em;
53 border-style: solid;
54 border-left-width: 1em;
55 border-top-width: thin;
56 border-right-width: thin;
57 border-bottom-width: thin;
58 border-color: #95ABD0;
59 color: #00428C;
60 background-color: #E4E5E7;
61 }
62 pre {margin-left: 0em}
63 div.toc h2 {font-size: 120%; margin-top: 0em; margin-bottom: 0em}
64 div.toc h4 {font-size: 100%; margin-top: 0em; margin-bottom: 0em;
65 margin-left: 1em}
66 div.toc h1 {font-size: 140%; margin-bottom: 0em}
67 div.toc ul {margin-top: 1ex}
68 .byline {font-size: 120%}
69 div.figure {margin-left: 2em}
70 div.caption {font-style: italic; font-weight: bold; margin-top: 1em}
71 i i {font-style: normal}
72 img {border: 0}
73 .copyright {font-size: 70%}
74 </style><title>Spreadsheet annotation spec</title></head><body style="font-family: DejaVu Sans, Arial; background: rgb(254,250,246)"><div style="text-align: center" class="head"><hr/><h1>Spreadsheet annotation spec</h1><div class="byline">Henry S. Thompson</div><div class="byline">$Id$</div></div><div class="body"><div><h2>1. Introduction</h2><p>This is a first pass at defining an annotation menu structure for
75 spreadsheets. The assumption is that we'll have an 'Annotate' entry in the Excel
76 right-button menu for selected regions, which will pop up region-appropriate
77 menus.</p></div><div><h2>2. Top-level menus</h2><div style="width: 20%; float: right; clear: right; margin-left: .5em"><small><i>If the selection is a single cell I guess we try popping up a selection type menu,
78 with choices 'Row', 'Column', 'Matrix' and 'None' (the latter resulting in <code>_Nnnn</code>).</i></small></div><p>Right-clicking 'Annotate' when over a selected range will create a new
79 defined name of the form <code>_Xnnn</code>, where <code>X</code> is one of <code>R</code>,
80 <code>C</code> or <code>M</code> for <b>r</b>ows (horizontal range
81 selection), <b>c</b>olumns (vertical range selection) or
82 <b>m</b>atrix (for two-dimensional range selection) respectively, and
83 <code>nnn</code> is a serial number for the relevant selection type.</p><p>The comment field (attribute in the XML) of the defined name should contain a
84 feature-value dictionary, represented in JSON/Python style, that is, using the
85 following BNF</p>:
86 <pre class="code"><code>fvd := '{' ( fvp ( ',' fvp )* )? '}'
87 fvp := key ':' value
88 key := string
89 value := string | number | fvp | array
90 string := '"' char* '"'
91 array := '[' ( value ( ',' value )* )? ']'</code></pre><p>with whitespace ignored, 'number' being the usual integer or decimal
92 representation and 'char' being ASCII-only (?).</p><p>If possible, the selected range should appear as the value of the new
93 name <i>without</i> single-quotes.</p><p>Some features can and should be computed, others require annotator
94 decision. Some features and/or feature values are unique to a particular selection type, others are
95 shared across all or some types.</p><p>Accordingly, in order for the annotator to supply the required
96 information, a form should pop up with all the features appropriate to the
97 selection type. Literal or array-valued form fields will just require a value
98 menu (allowing multiple selection in the array-valued case), but features with
99 dictionary values will require cascading sub-forms.</p><p>The next two sections document the annotator-supplied and
100 software-supplied features. Except for 'comment', whose value is free text,
101 allowed values are tabulated.</p></div><div><h2>3. Annotator-supplied features</h2><div><h4>3.1. All types</h4><dl class=" "><dt><b><a name="comment">comment</a></b></dt><dd>string: unconstrained. By its nature difficult to
102 exploit, really should only be used to document a problem with the available
103 feature&amp;value vocabulary or structure.</dd></dl></div><div><h4>3.2. Both one-dimensional types</h4><dl class=" "><dt><b><a name="type">type</a></b></dt><dd>string: <code>"data"|"key"|"label"</code><p>"key" is my preferred word for what Dresden call "attribute". In the
104 simpler cases, think of it as what you might use in an HLOOKUP or VLOOKUP cell.</p></dd><dt><b><a name="content">content</a></b></dt><dd>fvd:
105 <dl class=" "><dt><b><a name="type">type</a></b></dt><dd>string: <code>"currency"|"date"|"datetime"|"integer"|"float"|"key"|"label"|"string"|"time"</code></dd></dl><p>The "key" and "label" content types are for use (as in the Dresden
106 paper example) where compound keys/labels are indicated by row or column spans.</p></dd></dl></div><div><h4>3.3. Matrices</h4><dl class=" "><dt><b><a name="type">type</a></b></dt><dd>string: <code>"table"|"data"|"label"|"condition"</code></dd><dt><b><a name="content">content</a></b></dt><dd>fvd:
107 <ul class=" "><li>string: <code>"rows"|"columns"|"cells"</code></li></ul></dd></dl><p>When a form for a matrix is completed, if <code>type</code> is 'data' a pop-up should offer to auto-fill
108 based on <code>content/type</code>. If chosen, this fills the matrix with
109 named ranges of the appropriate orientation (rows, columns or, in the case of
110 <code>cells</code>, both). If
111 it's not too hard, it would be good to go on to pop up the form for each
112 generated range
113 in turn, either having asked in advance for appropriate
114 features whose values are the same for all the ranges, or carrying forward
115 values from one to the next as defaults.</p></div></div><div><h2>4. Software-supplied features</h2></div><div><h2>5. Issues</h2><div><h4>5.1. Compound labels and keys</h4><p>There's a problem with
116 defining the structure I want for compound labels and keys, in that you can't
117 for example select the 6th column of rows 3 through 5 in the Dresden example,
118 to denote the "Group stage/Match 2/GA" column label:</p><img src="dresdenPlus.png" class="image" alt="table with three-row labels involving column spans, row and column labels added, F3:F5 highlighted" title="table with three-row labels involving column spans, row and column labels added, F3:F5 highlighted" width="75%"/><p>Excel would allow you to define a name for
119 F3:F5 in that spreadsheet, but I don't <i>think</i> you can select that
120 range with the mouse.</p></div><div><h4>5.2. Metadata</h4><p>Nothing in the above proposal provides a way to annotate what Dresden
121 call 'Metadata'. We could simply provide another 1-D type, e.g. 'meta', I suppose, or just allow uninteresting regions to remain unannotated.
122 There is a difference between on the one hand informative prose such as occurs in the Dresden
123 example with the Metadata label, and regions whose type is just not obvious (as
124 e.g. lots in the Kenneth Lay sheet from the Enron dataset...</p></div></div></div></body></html>