Skip to content

Commit 1ae64f1

Browse files
Aleksi YrttiahoAleksi Yrttiaho
Aleksi Yrttiaho
authored and
Aleksi Yrttiaho
committed
Initial commit
1 parent a2d917d commit 1ae64f1

File tree

202 files changed

+46791
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+46791
-2
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.classpath
2+
.project
3+
.settings
4+
/target
5+
/src/main/resources/jdbc.properties
6+
/src/test/resources/jdbc.properties

LICENSE.txt

+197
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
2+
European Union Public Licence
3+
V. 1.1
4+
5+
6+
EUPL © the European Community 2007
7+
8+
9+
This European Union Public Licence (the “EUPL”) applies to the Work or Software (as defined below) which is provided under the terms of this Licence. Any use of the Work, other than as authorised under this Licence is prohibited (to the extent such use is covered by a right of the copyright holder of the Work).
10+
11+
The Original Work is provided under the terms of this Licence when the Licensor (as defined below) has placed the following notice immediately following the copyright notice for the Original Work:
12+
13+
Licensed under the EUPL V.1.1
14+
15+
or has expressed by any other mean his willingness to license under the EUPL.
16+
17+
18+
19+
1. Definitions
20+
21+
In this Licence, the following terms have the following meaning:
22+
23+
- The Licence: this Licence.
24+
25+
- The Original Work or the Software: the software distributed and/or communicated by the Licensor under this Licence, available as Source Code and also as Executable Code as the case may be.
26+
27+
- Derivative Works: the works or software that could be created by the Licensee, based upon the Original Work or modifications thereof. This Licence does not define the extent of modification or dependence on the Original Work required in order to classify a work as a Derivative Work; this extent is determined by copyright law applicable in the country mentioned in Article 15.
28+
29+
- The Work: the Original Work and/or its Derivative Works.
30+
31+
- The Source Code: the human-readable form of the Work which is the most convenient for people to study and modify.
32+
33+
- The Executable Code: any code which has generally been compiled and which is meant to be interpreted by a computer as a program.
34+
35+
- The Licensor: the natural or legal person that distributes and/or communicates the Work under the Licence.
36+
37+
- Contributor(s): any natural or legal person who modifies the Work under the Licence, or otherwise contributes to the creation of a Derivative Work.
38+
39+
- The Licensee or “You”: any natural or legal person who makes any usage of the Software under the terms of the Licence.
40+
41+
- Distribution and/or Communication: any act of selling, giving, lending, renting, distributing, communicating, transmitting, or otherwise making available, on-line or off-line, copies of the Work or providing access to its essential functionalities at the disposal of any other natural or legal person.
42+
43+
44+
45+
2. Scope of the rights granted by the Licence
46+
47+
The Licensor hereby grants You a world-wide, royalty-free, non-exclusive, sub-licensable licence to do the following, for the duration of copyright vested in the Original Work:
48+
49+
- use the Work in any circumstance and for all usage,
50+
- reproduce the Work,
51+
- modify the Original Work, and make Derivative Works based upon the Work,
52+
- communicate to the public, including the right to make available or display the Work or copies thereof to the public and perform publicly, as the case may be, the Work,
53+
- distribute the Work or copies thereof,
54+
- lend and rent the Work or copies thereof,
55+
- sub-license rights in the Work or copies thereof.
56+
57+
Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the applicable law permits so.
58+
59+
In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed by law in order to make effective the licence of the economic rights here above listed.
60+
61+
The Licensor grants to the Licensee royalty-free, non exclusive usage rights to any patents held by the Licensor, to the extent necessary to make use of the rights granted on the Work under this Licence.
62+
63+
64+
65+
3. Communication of the Source Code
66+
67+
The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to distribute and/or communicate the Work.
68+
69+
70+
71+
4. Limitations on copyright
72+
73+
Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the exclusive rights of the rights owners in the Original Work or Software, of the exhaustion of those rights or of other applicable limitations thereto.
74+
75+
76+
77+
5. Obligations of the Licensee
78+
79+
The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those obligations are the following:
80+
81+
Attribution right: the Licensee shall keep intact all copyright, patent or trademarks notices and all notices that refer to the Licence and to the disclaimer of warranties. The Licensee must include a copy of such notices and a copy of the Licence with every copy of the Work he/she distributes and/or communicates. The Licensee must cause any Derivative Work to carry prominent notices stating that the Work has been modified and the date of modification.
82+
83+
Copyleft clause: If the Licensee distributes and/or communicates copies of the Original Works or Derivative Works based upon the Original Work, this Distribution and/or Communication will be done under the terms of this Licence or of a later version of this Licence unless the Original Work is expressly distributed only under this version of the Licence. The Licensee (becoming Licensor) cannot offer or impose any additional terms or conditions on the Work or Derivative Work that alter or restrict the terms of the Licence.
84+
85+
Compatibility clause: If the Licensee Distributes and/or Communicates Derivative Works or copies thereof based upon both the Original Work and another work licensed under a Compatible Licence, this Distribution and/or Communication can be done under the terms of this Compatible Licence. For the sake of this clause, “Compatible Licence” refers to the licences listed in the appendix attached to this Licence. Should the Licensee’s obligations under the Compatible Licence conflict with his/her obligations under this Licence, the obligations of the Compatible Licence shall prevail.
86+
87+
Provision of Source Code: When distributing and/or communicating copies of the Work, the Licensee will provide a machine-readable copy of the Source Code or indicate a repository where this Source will be easily and freely available for as long as the Licensee continues to distribute and/or communicate the Work.
88+
89+
Legal Protection: This Licence does not grant permission to use the trade names, trademarks, service marks, or names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the copyright notice.
90+
91+
92+
93+
6. Chain of Authorship
94+
95+
The original Licensor warrants that the copyright in the Original Work granted hereunder is owned by him/her or licensed to him/her and that he/she has the power and authority to grant the Licence.
96+
97+
Each Contributor warrants that the copyright in the modifications he/she brings to the Work are owned by him/her or licensed to him/her and that he/she has the power and authority to grant the Licence.
98+
99+
Each time You accept the Licence, the original Licensor and subsequent Contributors grant You a licence to their contributions to the Work, under the terms of this Licence.
100+
101+
102+
103+
7. Disclaimer of Warranty
104+
105+
The Work is a work in progress, which is continuously improved by numerous contributors. It is not a finished work and may therefore contain defects or “bugs” inherent to this type of software development.
106+
107+
For the above reason, the Work is provided under the Licence on an “as is” basis and without warranties of any kind concerning the Work, including without limitation merchantability, fitness for a particular purpose, absence of defects or errors, accuracy, non-infringement of intellectual property rights other than copyright as stated in Article 6 of this Licence.
108+
109+
This disclaimer of warranty is an essential part of the Licence and a condition for the grant of any rights to the Work.
110+
111+
112+
113+
8. Disclaimer of Liability
114+
115+
Except in the cases of wilful misconduct or damages directly caused to natural persons, the Licensor will in no event be liable for any direct or indirect, material or moral, damages of any kind, arising out of the Licence or of the use of the Work, including without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, loss of data or any commercial damage, even if the Licensor has been advised of the possibility of such damage. However, the Licensor will be liable under statutory product liability laws as far such laws apply to the Work.
116+
117+
118+
119+
9. Additional agreements
120+
121+
While distributing the Original Work or Derivative Works, You may choose to conclude an additional agreement to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or services consistent with this Licence. However, in accepting such obligations, You may act only on your own behalf and on your sole responsibility, not on behalf of the original Licensor or any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against such Contributor by the fact You have accepted any such warranty or additional liability.
122+
123+
124+
125+
10. Acceptance of the Licence
126+
127+
The provisions of this Licence can be accepted by clicking on an icon “I agree” placed under the bottom of a window displaying the text of this Licence or by affirming consent in any other similar way, in accordance with the rules of applicable law. Clicking on that icon indicates your clear and irrevocable acceptance of this Licence and all of its terms and conditions.
128+
129+
Similarly, you irrevocably accept this Licence and all of its terms and conditions by exercising any rights granted to You by Article 2 of this Licence, such as the use of the Work, the creation by You of a Derivative Work or the Distribution and/or Communication by You of the Work or copies thereof.
130+
131+
132+
133+
11. Information to the public
134+
135+
In case of any Distribution and/or Communication of the Work by means of electronic communication by You (for example, by offering to download the Work from a remote location) the distribution channel or media (for example, a website) must at least provide to the public the information requested by the applicable law regarding the Licensor, the Licence and the way it may be accessible, concluded, stored and reproduced by the Licensee.
136+
137+
138+
139+
12. Termination of the Licence
140+
141+
The Licence and the rights granted hereunder will terminate automatically upon any breach by the Licensee of the terms of the Licence.
142+
143+
Such a termination will not terminate the licences of any person who has received the Work from the Licensee under the Licence, provided such persons remain in full compliance with the Licence.
144+
145+
146+
147+
13. Miscellaneous
148+
149+
Without prejudice of Article 9 above, the Licence represents the complete agreement between the Parties as to the Work licensed hereunder.
150+
151+
If any provision of the Licence is invalid or unenforceable under applicable law, this will not affect the validity or enforceability of the Licence as a whole. Such provision will be construed and/or reformed so as necessary to make it valid and enforceable.
152+
153+
The European Commission may publish other linguistic versions and/or new versions of this Licence, so far this is required and reasonable, without reducing the scope of the rights granted by the Licence. New versions of the Licence will be published with a unique version number.
154+
155+
All linguistic versions of this Licence, approved by the European Commission, have identical value. Parties can take advantage of the linguistic version of their choice.
156+
157+
158+
159+
14. Jurisdiction
160+
161+
Any litigation resulting from the interpretation of this License, arising between the European Commission, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice of the European Communities, as laid down in article 238 of the Treaty establishing the European Community.
162+
163+
Any litigation arising between Parties, other than the European Commission, and resulting from the interpretation of this License, will be subject to the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business.
164+
165+
166+
167+
15. Applicable Law
168+
169+
This Licence shall be governed by the law of the European Union country where the Licensor resides or has his registered office.
170+
171+
This licence shall be governed by the Belgian law if:
172+
173+
- a litigation arises between the European Commission, as a Licensor, and any Licensee;
174+
- the Licensor, other than the European Commission, has no residence or registered office inside a European Union country.
175+
176+
177+
===
178+
179+
180+
Appendix
181+
182+
183+
184+
“Compatible Licences” according to article 5 EUPL are:
185+
186+
187+
- GNU General Public License (GNU GPL) v. 2
188+
189+
- Open Software License (OSL) v. 2.1, v. 3.0
190+
191+
- Common Public License v. 1.0
192+
193+
- Eclipse Public License v. 1.0
194+
195+
- Cecill v. 2.0
196+
197+

README.md

+143-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,143 @@
1-
# tiku
2-
THL reporting interface for precalculated cubes and reports
1+
# THL reporting interface for precalculated cubes and reports
2+
3+
4+
## Development
5+
6+
### Configuration
7+
8+
The application requires a file `src/main/resources/jdbc.properties` with the following properties:
9+
10+
```
11+
database.driver=org.postgresql.Driver
12+
database.url=jdbc:postgresql://<host>:<port>/<database>
13+
database.user=
14+
database.password=
15+
database.environment.schema=
16+
```
17+
18+
The `database.environment.schema` property may be used differentiate between different environments (deve, test, prod).
19+
The data may have different states in each environment.
20+
21+
### Running the software
22+
23+
To start the application in a development environment run ```mvn jetty:run``` in the project basedir.
24+
25+
Application should respond at `http://localhost:8080`
26+
27+
The application servers resources at `/{state}/{lang}/{subject}/{section}/` where
28+
- state is one of deve, test, prod, see Concepts
29+
- lang is an ISO-693-1 language code e.g. fi, sv, en
30+
- subject (optional), see Concepts
31+
- section (optional), see Concepts
32+
33+
### Creating a WAR-file
34+
35+
To create a WAR-file run ```mvn package``` in the project basedir.
36+
37+
## Data
38+
39+
### Concepts
40+
41+
The application is based on a data interchange format used to provide performant multidimensional datasets
42+
with flexible metadata that can be localized. The format combines the idea of OLAP cubes and RDF.
43+
The cubes are assumed to be precalculated.
44+
45+
The dataset consists of
46+
- one or more fact tables that contains all the measure values
47+
- one table describing the hierarchy of each dimension used in the fact tables called tree
48+
- one table describing the metadata of each dimension as RDF triples
49+
- any number of reports that are based on fact tables
50+
51+
The backing database may contain any number of these datasets. The datasets are grouped by subjects to
52+
support topical listings for a better UX.
53+
54+
The dataset may have multiple versions. Each version is identified by a `runid` (timestamp) and has it's own
55+
state. The state may be one of deve, test or prod. This allows checking new datasets and their updates in the
56+
same instance and makes publishing a new dataset version fast.
57+
58+
### Database schema
59+
60+
Tables describing available datasets include
61+
62+
- meta_hydra - lists all datasets
63+
- meta_table - lists all database tables containing the data
64+
- meta_state - lists the state of each dataset
65+
- meta_ref_id_map - lists global surrogate ids for each node in metadata
66+
67+
Tables describing datasets include
68+
- x<runid>_fact* - one for each fact table in a dataset
69+
- x<runid>_tree - one for each dataset
70+
- x<runid>_meta - one for each dataset
71+
72+
Tables for usage logging include
73+
- TODO - for each access
74+
- TODO - for each filter value in access
75+
76+
### Fact tables
77+
78+
Fact tables consists of a column for each dimension, a column determining the measure and a column containing the value
79+
80+
| time_key | region_key | measure_key | val |
81+
|---|---|---|---|---|
82+
| 1 | 10 | 20 | 34.3 |
83+
| 1 | 11 | 20 | 23.5 |
84+
| 2 | 10 | 20 | 33.0 |
85+
| 2 | 11 | 20 | 24.5 |
86+
87+
where
88+
- time_key contains a key in the tree table where dimension = time
89+
- region_key contains a key in the tree table where dimension = region
90+
- measure_key contains a key in the tree table where dimension = measure
91+
- val is measure value that may be non-numeric
92+
93+
### Tree tables
94+
95+
| key | parent_key | dimension | stage | ref |
96+
|---|---|---|---|---|
97+
| | | | | |
98+
99+
where
100+
101+
- key is a dataset unique surrogate for the dimension node
102+
- parent_key references the parent of the dimension node unless node is at the root level
103+
- dimension is the identifier of the dimension
104+
- stage is the identifier of the hierarchy level e.g. year, month, week, day
105+
- ref is the uri of the dimension node
106+
107+
### Meta tables
108+
109+
| ref | tag | lang | data |
110+
|---|---|---|---|
111+
| | | | |
112+
113+
where
114+
115+
- ref is the subject uri
116+
- tag is the predicate uri
117+
- lang is a ISO 639-1 language code
118+
- data is the object value (a literal or an uri)
119+
120+
121+
### Metadata predicates
122+
123+
Supported metadata predicates include
124+
125+
- name
126+
- sort
127+
- decimal
128+
- password
129+
- is
130+
131+
132+
### Report description language
133+
134+
Reports (called summaries) are described using an XML based report description language. The language allows you
135+
to define which dimensions are used as filters (either constant or interactive) and what kind of visualisations
136+
are shown to the user.
137+
138+
Currently supported visualisations include
139+
- tables
140+
- line charts
141+
- bar charts
142+
- pie charts
143+
- gauge charts

0 commit comments

Comments
 (0)