Sample data create and import: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
 
(60 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Data creation and import is split into two tasks:
== Overview ==
Goal: creating sample data for the database.
 
The sample data should have
* many donors
* many recipients
* many donations
 
Data creation and import is done in a two step process:
 
[[File:SampleDataCreation.png|600px|alt This diagram shows the data flow of created sample data from benedata benerator into the sample data constructor and the into OpenPetra Server]]
 
# The 3rd-party data creation tool [https://www.benerator.de/ benerator] creates raw data (names, addresses, phone numbers...)
# The OpenPetra SampleDataConstructor-tool is specifically built to take this data, assemble, and import it into OpenPetra
 
== Related Bugtracking-Issues ==
 
* create sample data ([https://sourceforge.net/apps/mantisbt/openpetraorg/view.php?id=29 issue #29])
* create sample data ([https://sourceforge.net/apps/mantisbt/openpetraorg/view.php?id=29 issue #29])
* import this data ([https://sourceforge.net/apps/mantisbt/openpetraorg/view.php?id=220 issue #220])
* import this data ([https://sourceforge.net/apps/mantisbt/openpetraorg/view.php?id=220 issue #220])


The import is done via import file. Decision: simple for user.
== Running Sample Data Constructor ==
Creation of raw sample data and assembling this into the database are two separate steps which can be executed with nant:


Keeping the focus: the focus is creating sample data for the database, not import/export.
=== Creating Raw Sample Data ===
The following assumes that databene benerator is installed and functioning (see below on how to do this). If it is not installed, you may skip this step if you already have working sample data csv-files.
==== Creating Raw Sample Data with Benerator ====
To start the generation of data, run:
nant generateDemodata


The above points were decided to be done this way in a phonecall with Timo.  
This should create csv files containing sample data in the directory <code>demodata\generated</code>: "People.csv","Addresses.csv","Organisations.csv".


''
=== Running Sample Data Constructor ===
This page aims to act as whiteboard for displaying current state and solving this task. The task itself is tracked in the two issue stated above.''


== Creating sample data ==
The Sample Data Constructor assembles the raw data, and saves it onto the Petra Server. It requires raw sample data files ("People.csv","Addresses.csv","Organisations.csv") to be in the directory <code>demodata\generated</code>.


Goal: creating sample data for the database.
To run the Sample Data Constructor, run:
nant resetDatabase
nant importDemodata
 
'''Note''': It is necessary to reset the database content with <code>nant resetDatabase</code> before running <code>nant importDemodata</code> as otherwise the RDBMS's Referential Integrity checks will throw duplicate key Exceptions when Units are created!
 
After having run the sample data constructor, you can access the created data from the OpenPetra Client.
 
== Current State ==
 
* creating names and addresses and putting these into the OpenPetra database is completed
* creating donations is not done yet
 
== Installing third party software ==
 
Currently the only external software used is Benedata Benerator for creation of the raw data, but this in turn requires the java runtime enviroment.
 
=== Java ===
 
* Required: Java Runtime Environment only
 
=== Abridged Instructions ===


The sample data should have
* Download the [http://www.java.com/de/download/ current Java Runtime environment] and install
* many donors
* You might need to add the bin directory to your PATH:
* many recipients
* many donations


List of sample data generators: http://www.webresourcesdepot.com/test-sample-data-generators/
<code>
PATH = ....; "C:\Program Files (x86)\Java\jre6\bin"
</code>


{|
* Give it a quick test by opening a new command prompt / terminal and typing:
! Program
! creates
! area
! App-Type
! License
|-
| [http://www.generatedata.com/ generatedata.com]
| Addresses / Cities / Countries
| Netherlands, Canada, UK, US
| Webapp (JS,PHP,MySQL)
| GPL v2
|-
| [https://sourceforge.net/projects/dbmonster/ DBMonster ]
|
|
| Command-Line (Java)
| Apache License
|-
| http://www.briandunning.com/sample-data/
| Website with real address data (US) but with fake names. This could be useful with testing map services as well since there are real geographic locations.
|-
|}


= Coding =
<code>
Some coding has been done already:
java -version
See csharp\ICT\PetraTools\GenerateSampleData for transforming sample data into family records etc.
</code>


Also see partner import module, which processes csv and yaml files.
Example output:
csharp\ICT\Petra\Client\lib\MPartner\gui\PartnerImport.ManualCode.cs


== Importing sample data ==
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing)


The import is done via import file. Decision: simple for user.
=== Databene Benerator ===


Keeping the focus: the focus is creating sample data for the database, not import/export.  
* Project Website: https://www.benerator.de/
Import/export is a simple tool - which we put effort into, to keep it nice and simple and easy to understand. But in this case, a tool for sample data only.
* Note: The project is a java project
* Used version: 0.7.1 (as of 2011-November)
* Other requirements: Java Runtime Enviroment


Make the import file as simple as possible for the user, e.g. consciously limit the scope of the import files capability (one address per person), but rather not powerful import-file.


Intended location of data in OpenPetra:
* [https://sourceforge.net/project/platformdownload.php?group_id=222964 Download the Benerator distribution] from SourceForge
* Unzip into Program files (e.g. C:\Program Files\databene-benerator-0.7.1)
* nant should pick that version up, otherwise you need to add to your OpenPetra.build.config:
<property name="external.Benerator" value="${OP::GetFileInProgramDirectory('/databene-benerator-0.7.1/bin/benerator.bat')}"/>


{|
== See also ==
! Data
! Table
|-
| Person
| p_family
|-
| Address
| -
|-
| Donations
| -
|-
|}


p_family will be used for all data, and p_person ignored (This is in line with the attempts to replace p_person by p_family).
* List of possible 3rd party [[3rd-party Test Data Generators]]

Latest revision as of 17:37, 31 Mayıs 2022

Overview

Goal: creating sample data for the database.

The sample data should have

  • many donors
  • many recipients
  • many donations

Data creation and import is done in a two step process:

alt This diagram shows the data flow of created sample data from benedata benerator into the sample data constructor and the into OpenPetra Server

  1. The 3rd-party data creation tool benerator creates raw data (names, addresses, phone numbers...)
  2. The OpenPetra SampleDataConstructor-tool is specifically built to take this data, assemble, and import it into OpenPetra

Related Bugtracking-Issues

Running Sample Data Constructor

Creation of raw sample data and assembling this into the database are two separate steps which can be executed with nant:

Creating Raw Sample Data

The following assumes that databene benerator is installed and functioning (see below on how to do this). If it is not installed, you may skip this step if you already have working sample data csv-files.

Creating Raw Sample Data with Benerator

To start the generation of data, run:

nant generateDemodata

This should create csv files containing sample data in the directory demodata\generated: "People.csv","Addresses.csv","Organisations.csv".

Running Sample Data Constructor

The Sample Data Constructor assembles the raw data, and saves it onto the Petra Server. It requires raw sample data files ("People.csv","Addresses.csv","Organisations.csv") to be in the directory demodata\generated.

To run the Sample Data Constructor, run:

nant resetDatabase
nant importDemodata

Note: It is necessary to reset the database content with nant resetDatabase before running nant importDemodata as otherwise the RDBMS's Referential Integrity checks will throw duplicate key Exceptions when Units are created!

After having run the sample data constructor, you can access the created data from the OpenPetra Client.

Current State

  • creating names and addresses and putting these into the OpenPetra database is completed
  • creating donations is not done yet

Installing third party software

Currently the only external software used is Benedata Benerator for creation of the raw data, but this in turn requires the java runtime enviroment.

Java

  • Required: Java Runtime Environment only

Abridged Instructions

PATH = ....; "C:\Program Files (x86)\Java\jre6\bin"

  • Give it a quick test by opening a new command prompt / terminal and typing:

java -version

Example output:

java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing)

Databene Benerator

  • Project Website: https://www.benerator.de/
  • Note: The project is a java project
  • Used version: 0.7.1 (as of 2011-November)
  • Other requirements: Java Runtime Enviroment


  • Download the Benerator distribution from SourceForge
  • Unzip into Program files (e.g. C:\Program Files\databene-benerator-0.7.1)
  • nant should pick that version up, otherwise you need to add to your OpenPetra.build.config:
<property name="external.Benerator" value="${OP::GetFileInProgramDirectory('/databene-benerator-0.7.1/bin/benerator.bat')}"/>

See also