|Moderator:Juha Villman (see all)|
Table2Base is an extension which enables direct upload of data from wikipages to Opasnet Base. Data is displayed as a table in wikipage.
<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>
|3||2001||Sweden||600||Some additional stuffs|
- 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
----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. (type: truth, paradigm: science view) --Jouni 13:23, 9 July 2012 (EEST)
----#: . 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.) (type: truth, paradigm: science view) --Jouni 15:44, 9 July 2012 (EEST)
⇤--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. (type: truth, paradigm: science view) --Erkki Kuusisto 15:22, 21 May 2012 (EEST)
- ⇤--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. (type: truth, paradigm: science view) --Jouni 13:23, 9 July 2012 (EEST)
----#: . 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. (type: truth, paradigm: science view) --Jouni 13:23, 9 July 2012 (EEST)
⇤--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. (type: truth, paradigm: science view) --Erkki Kuusisto 15:22, 21 May 2012 (EEST)
- ←--5: . I support this idea. However, units of indices should be a separate parameter (e.g. indexnames) with the same length as index. (type: truth, paradigm: science view) --Jouni 13:23, 9 July 2012 (EEST)
⇤--3: . Combining attacks 1–2 above, I suggest a simplified syntax for t2b:
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, , "> (type: truth, paradigm: science view) --Erkki Kuusisto 15:22, 21 May 2012 (EEST)
- ⇤--6: . Because attack #1 is not accepted, also #3 is not accepted. (type: truth, paradigm: science view) --Jouni 13:23, 9 July 2012 (EEST)
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