Table2Base: Difference between revisions
mNo edit summary |
Juha Villman (talk | contribs) m (Juha Villman moved page Table2Base2 to Table2Base over redirect) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
'''Example:''' | '''Example:''' | ||
<pre><t2b index="Year,Country" unit="#" obs="Mortality"> | <pre><t2b index="Year,Country" unit="#" obs="Mortality" desc="Description,Additional information"> | ||
2001|Finland|1000 | 2001|Finland|1000|data description| | ||
2002|Finland|100 | 2002|Finland|100|| | ||
2001|Sweden|600 | 2001|Sweden|600||Some additional stuffs | ||
2002|Sweden|800 | 2002|Sweden|800|| | ||
</t2b> | </t2b> | ||
</pre> | </pre> | ||
'''Displays:''' | '''Displays:''' | ||
<t2b index="Year,Country" unit="#" obs="Mortality"> | <t2b index="Year,Country" unit="#" obs="Mortality" desc="Description,Additional information"> | ||
2001|Norway|1000 | 2001|Norway|1000|data description| | ||
2002|Finland|100 | 2002|Finland|100|| | ||
2001|Sweden|600 | 2001|Sweden|600||Some additional stuffs | ||
2002|Sweden|800 | 2002|Sweden|800|| | ||
</t2b> | </t2b> | ||
Line 30: | Line 30: | ||
*'''obs''' defines the name of the result column | *'''obs''' defines the name of the result column | ||
**obs is optional | **obs is optional | ||
**if not defined default value "Result" is used | **if not defined default value "Result" is used | ||
*'''desc''' parameter can be used for displaying descriptive information | |||
** desc is optional | |||
** data in desc columns is not saved to database, it's only used for displaying purposes | |||
*Data is saved only when table is altered and page is saved | *Data is saved only when table is altered and page is saved | ||
*Number of data columns must match to number of indices + result column | *Number of data columns must match to number of indices + result column | ||
Line 36: | Line 39: | ||
*Table caption is a link to Base UI | *Table caption is a link to Base UI | ||
{{comment|# |The data should be updated also when parameters are changed, not only when the table contents are changed.|--[[User:Jouni|Jouni]] 13:42, 9 July 2012 (EEST)}} | |||
{{ | {{comment|4 |It must be possible to define units for each observation row separately. I suggest that if the parameter <nowiki>unit="column" then the Unit appears as a column before the observation columns and not in the title. Also, if parameter description="column"</nowiki>, then the last column will be Description.|--[[User:Jouni|Jouni]] 13:23, 9 July 2012 (EEST)}} | ||
{{comment|# |It would be useful to be able to put text like <nowiki>[[Page name]]</nowiki> to a cell in a t2b in such a way that it is understood to be an internal link. Other, more fancy linking options are not important <nowiki>(such as [[Page name|Link]], [http://www.domain.com Link] etc.)</nowiki>|--[[User:Jouni|Jouni]] 15:44, 9 July 2012 (EEST)}} | |||
{{attack_invalid|1 | The t2b functionality is important. However, the distinction of variables into "index" ja "location" types is ambiguous and arbitrary. E.g. in the dataset... | |||
* municipality, last name, first names, sex, height, weight, blood group | * municipality, last name, first names, sex, height, weight, blood group | ||
... at least the variables "municipality", "sex", and "blood group" (and in principle any of the other variables too) could be treated equally well as either "index" or "location" type. ⇒ Thus, I suggest that all variables be treated alike in the t2b syntax.|--[[User:Erkki Kuusisto|Erkki Kuusisto]] 15:22, 21 May 2012 (EEST)}} | ... at least the variables "municipality", "sex", and "blood group" (and in principle any of the other variables too) could be treated equally well as either "index" or "location" type. ⇒ Thus, I suggest that all variables be treated alike in the t2b syntax.|--[[User:Erkki Kuusisto|Erkki Kuusisto]] 15:22, 21 May 2012 (EEST)}} | ||
: {{attack|7 |The distinction between indices (explanations) and observations ("locations") is important, because they are stored in the database differently. You can search for index results but not for observation results. So, if you want to search for something, make it an index.|--[[User:Jouni|Jouni]] 13:23, 9 July 2012 (EEST)}} | |||
{{comment|# |The use of words index, location, observation, explanation, result, value,... are used in a confusing way. I suggest that we reparametrize this in the following way: | |||
* index → explanations. The use will remain the same. | |||
* explanationunits: a new parameter for the units of explanation columns. Must have the same length as explanations. | |||
* locations → observations. The use will remain the same. | |||
* unit: the name will remain but if gets the value "column", a new column is created for unit before the Result column. Any other value implies a unit for all rows. | |||
* description: a new parameter. If gets the value "column", a new column is created for description as the last column. | |||
* "Observation type": if the observation columns do not have an obvious meaningful name, this is used. Note: this name does not imply any special computing, unlike "Observation" in the old Opasnet Base system. | |||
|--[[User:Jouni|Jouni]] 13:23, 9 July 2012 (EEST)}} | |||
{{attack|2 | It is important that the "unit" can be defined separately for each variable. E.g. for weight and height in the sample dataset above. |--[[User:Erkki Kuusisto|Erkki Kuusisto]] 15:22, 21 May 2012 (EEST)}} | {{attack|2 | It is important that the "unit" can be defined separately for each variable. E.g. for weight and height in the sample dataset above. |--[[User:Erkki Kuusisto|Erkki Kuusisto]] 15:22, 21 May 2012 (EEST)}} | ||
: {{defend|5 |I support this idea. However, units of indices should be a separate parameter (e.g. indexnames) with the same length as index. |--[[User:Jouni|Jouni]] 13:23, 9 July 2012 (EEST)}} | |||
{{attack_invalid|3 | Combining attacks 1–2 above, I suggest a simplified syntax for t2b: | |||
{{ | |||
<nowiki><t2b variables_and_units=" | <nowiki><t2b variables_and_units=" | ||
Line 74: | Line 91: | ||
</nowiki> |--[[User:Erkki Kuusisto|Erkki Kuusisto]] 15:22, 21 May 2012 (EEST)}} | </nowiki> |--[[User:Erkki Kuusisto|Erkki Kuusisto]] 15:22, 21 May 2012 (EEST)}} | ||
:{{attack|6 |Because attack #1 is not accepted, also #3 is not accepted.|--[[User:Jouni|Jouni]] 13:23, 9 July 2012 (EEST)}} | |||
<br> '''Hints for spreadsheet software''' | <br> '''Hints for spreadsheet software''' |
Latest revision as of 13:17, 8 January 2014
Moderator:Juha Villman (see all) |
|
Upload data
|
Table2Base is an extension which enables direct upload of data from wikipages to Opasnet Base. Data is displayed as a table in wikipage.
Usage
Example:
<t2b index="Year,Country" unit="#" obs="Mortality" desc="Description,Additional information"> 2001|Finland|1000|data description| 2002|Finland|100|| 2001|Sweden|600||Some additional stuffs 2002|Sweden|800|| </t2b>
Displays:
Data updated successfully!
Obs | Year | Country | Mortality | Description | Additional information |
---|---|---|---|---|---|
1 | 2001 | Norway | 1000 | data description | |
2 | 2002 | Finland | 100 | ||
3 | 2001 | Sweden | 600 | Some additional stuffs | |
4 | 2002 | Sweden | 800 |
Notes:
- index argument defines indices of the datatable:
- example has 2 indices: Year and Country
- it is obligatory to have at least 1 index
- unit defines the unit of the variable
- it is obligatory to define unit
- obs defines the name of the result column
- obs is optional
- if not defined default value "Result" is used
- desc parameter can be used for displaying descriptive information
- desc is optional
- data in desc columns is not saved to database, it's only used for displaying purposes
- Data is saved only when table is altered and page is saved
- Number of data columns must match to number of indices + result column
- Each row must have equal number of columns
- Table caption is a link to Base UI
----#: . The data should be updated also when parameters are changed, not only when the table contents are changed. --Jouni 13:42, 9 July 2012 (EEST) (type: truth; paradigms: science: comment)
----4: . It must be possible to define units for each observation row separately. I suggest that if the parameter unit="column" then the Unit appears as a column before the observation columns and not in the title. Also, if parameter description="column", then the last column will be Description. --Jouni 13:23, 9 July 2012 (EEST) (type: truth; paradigms: science: comment)
----#: . It would be useful to be able to put text like [[Page name]] to a cell in a t2b in such a way that it is understood to be an internal link. Other, more fancy linking options are not important (such as [[Page name|Link]], [http://www.domain.com Link] etc.) --Jouni 15:44, 9 July 2012 (EEST) (type: truth; paradigms: science: comment)
⇤--1: . The t2b functionality is important. However, the distinction of variables into "index" ja "location" types is ambiguous and arbitrary. E.g. in the dataset...
- municipality, last name, first names, sex, height, weight, blood group
... at least the variables "municipality", "sex", and "blood group" (and in principle any of the other variables too) could be treated equally well as either "index" or "location" type. ⇒ Thus, I suggest that all variables be treated alike in the t2b syntax. --Erkki Kuusisto 15:22, 21 May 2012 (EEST) (type: truth; paradigms: science: attack)
- ⇤--7: . The distinction between indices (explanations) and observations ("locations") is important, because they are stored in the database differently. You can search for index results but not for observation results. So, if you want to search for something, make it an index. --Jouni 13:23, 9 July 2012 (EEST) (type: truth; paradigms: science: attack)
----#: . The use of words index, location, observation, explanation, result, value,... are used in a confusing way. I suggest that we reparametrize this in the following way:
- index → explanations. The use will remain the same.
- explanationunits: a new parameter for the units of explanation columns. Must have the same length as explanations.
- locations → observations. The use will remain the same.
- unit: the name will remain but if gets the value "column", a new column is created for unit before the Result column. Any other value implies a unit for all rows.
- description: a new parameter. If gets the value "column", a new column is created for description as the last column.
- "Observation type": if the observation columns do not have an obvious meaningful name, this is used. Note: this name does not imply any special computing, unlike "Observation" in the old Opasnet Base system. --Jouni 13:23, 9 July 2012 (EEST) (type: truth; paradigms: science: comment)
⇤--2: . It is important that the "unit" can be defined separately for each variable. E.g. for weight and height in the sample dataset above. --Erkki Kuusisto 15:22, 21 May 2012 (EEST) (type: truth; paradigms: science: attack)
- ←--5: . I support this idea. However, units of indices should be a separate parameter (e.g. indexnames) with the same length as index. --Jouni 13:23, 9 July 2012 (EEST) (type: truth; paradigms: science: defence)
⇤--3: . Combining attacks 1–2 above, I suggest a simplified syntax for t2b:
<t2b variables_and_units="
var_name_1, var_unit_1,
var_name_2, var_unit_2,
...,
var_name_N, var_unit_N ">
An example with the above dataset:
<t2b variables="
municipality, ,
last name, ,
first names, ,
sex, ,
height, cm,
weight, kg,
blood group, ,
">
--Erkki Kuusisto 15:22, 21 May 2012 (EEST) (type: truth; paradigms: science: attack)
- ⇤--6: . Because attack #1 is not accepted, also #3 is not accepted. --Jouni 13:23, 9 July 2012 (EEST) (type: truth; paradigms: science: attack)
Hints for spreadsheet software
If you have your data table in Open Office Calc, Excel, or some other software, you can use these formulas to convert tables into Table2Base code. This example is for Excel, other software may have slightly different syntax. Here, the data is in the spreadsheet in columns A...D. Columns A...C contain index values and column D observations. The first row contains index names and rows starting from row 2 contain data.
- Formula for the first row
- ="<tb2 index="&CHAR(34)&A1&","&B1&","&C1&CHAR(34)&" unit="&CHAR(34)&"kg"&CHAR(34)&" obs="&CHAR(34)&D1&CHAR(34)&">"
- Formula for the second row and beyond
- =A2&"|"&B2&"|"&C2&"|"&D2
See also
Keywords
References
Related files
<mfanonymousfilelist></mfanonymousfilelist>