Property File: Data Generator Functions


Values can be generated for Properties on Relations and Nodes in the following format:

for nodes:
tdg.node.props.[node alias].[propName]=[function]:[function specific params]

First the Label property definition will be read, after that the alias for the same label. Alias properties will superseed label properties. So it is good to put the common properties as label properties and only those properties who a different for an alias in an alias property.

for relations
tdg.rel.props.[relname].[propName]=[function]:[function specific params]

for lookup nodes
tdg.lookup.props.[lookup name].[column].[propName]=[function]:[function specific params]

[column] (only applicable for lookup nodes!)
When you want to set a property on a lookup node you must prepend the property name with the column name returned in the cypher statement!

for repeat node relations
tdg.rel.repeat.props.[relation identifier].propName

[propName] : the name of the property.
It is possible to use 'special' properties starting with a '~' which are shown below in the reference table.

==== Special Properties

A set of predifined property names and their values are generated

~FromToDateTime=[FromDatefrom],[FromDateTo],[ToDateFrom],[ToDateTo]

This will generate a from and a to datetime property (timestamp)
date format "YYYY-MM-DD"
The generated From and To dates will be done based on the parameters. To avoid period overlap make sure that the FromDateFrom is before FromDateTo is before ToDateFrom is before ToDateTo

   example: 
         ~FromToDateTime=1960-01-30,1980-12-31,1981-01-01,2000-01-01

~FromToDate=[FromDatefrom],[FromDateTo],[ToDateFrom],[ToDateTo]

This will generate a from and a to date property (number value generated with date YYYYMMDD)
input date format "YYYY-MM-DD"
The generated From and To dates will be done based on the parameters. To avoid period overlap make sure that the FromDateFrom is before FromDateTo is before ToDateFrom is before ToDateTo

   example: 
         ~FromToDateTime=1960-01-30,1980-12-31,1981-01-01,2000-01-01

~DateAndTime=[datefrom],[dateTo]

This will generate a Date between the dateFrom and dateTo, and will create two properties "date" in format yyyy-MM-dd and "time" width a timestamp value
input date format "YYYY-MM-DD"

   example: 
         ~DateAndTime=1981-01-01,2000-01-01

~DateAndTimeNowR=[minutes range]

This will create two properties "date" in format yyyy-MM-dd and "time" width a timestamp value, based on a random date value between now - [minutes range] and now.

   example: 
         ~DateAndTime=1981-01-01,2000-01-01

~Person=[FromDate],[ToDate]

This will generate a set of person properties:
firstName,lastName,fullName,birthDate,ssn
The [FromDate] and [ToDate] are used to generate a birthDate

input date format "YYYY-MM-DD"

   example: 
         ~Person=1960-01-30,1980-12-31
~User=[FromDate],[ToDate]

This will generate a set of person properties:
firstName,lastName,userid,mail,startDate
The [FromDate] and [ToDate] are used to generate a startDate

input date format "YYYY-MM-DD"

   example: 
         ~User=1960-01-30,1980-12-31
==== Data Generation Functions

  == Person Functions

.[propName]=firstName

This will generate a fake first name

   example: 
         .firstname=firstName
.[propName]=lastName

This will generate a fake last name

   example: 
         .sn=lastName
.[propName]=fullName

This will generate a concatenated fake first and last name

   example: 
         .name=fullName
  == Company Functions

.[propName]=companyName

This will generate a Company Name

   example: 
         .company=companyName
.[propName]=companyBS

This will generate the Company Business

   example: 
         .companyBusiness=companyBS
.[propName]=companySlogan

This will generate a concatenated fake first and last name

   example: 
         .slogan=companySlogan
  == Internet Functions

.[propName]=email

This will generate an email address

   example: 
         .mail=email
.[propName]=url

This will generate an web url

   example: 
         .web=url
  == Location Functions

.[propName]=streetAddress

This will generate a Street Address

   example: 
         .address=streetAddress
.[propName]=secondaryAddress

This will generate a Secondary Address

   example: 
         .address2=secondaryAddress
.[propName]=streetAddressFull

This will generate a Street Address and Secondary address

   example: 
         .address=streetAddressFull
.[propName]=streetName

This will generate a Street name

   example: 
         .street=streetName
.[propName]=streetSuffix

This will generate a Street suffix

   example: 
         .suffix=streetSuffix
.[propName]=streetAddressNumber

This will generate a Street Address Number

   example: 
         .streetnr=streetAddressNumber
.[propName]=streetSuffix

This will generate a Street suffix

   example: 
         .suffix=streetSuffix
.[propName]=zipcode

This will generate a Postal Code

   example: 
         .zip=zipcode
.[propName]=country

This will generate a Country Name

   example: 
         .cntr=country
.[propName]=timezone

This will generate a Time Zone.

   example: 
         .zone=timezone
.[propName]=longitude

This will generate a longitude

   example: 
         .longt=longitude
.[propName]=latitude

This will generate a latitude

   example: 
         .latt=latitude
  == Other Functions

.[propName]=isbn10

This will generate an isbn code 10 characters long

   example: 
         .isbn=isbn10
.[propName]=isbn13

This will generate an isbn code 13 characters long

   example: 
         .isbn=isbn13
.[propName]=phoneNumber

This will generate a phone number

   example: 
         .phone=phoneNumber
.[propName]=concat:functiondef1;functiondef2

You can concatenate the output of functions

   example:
     .name=concat:fullName;codeSeq: - _
  == Sequence, Array and List Functions

.[propName]=sequence:[sequence name]

A sequence number is generated (long). The sequence has a name. So multiple sequences are possible. The sequence starts with the value 1

   example: 
         .personid=sequence:persons
.[propName]=elementFrom:[comma seperated list of values]

Pick a random element from a supplied comma seperated list of elements. It autodetects the return value.

   examples: 
         .xyznum=elementFrom:1,2,3,4,5,6
	 
	 .bcode=elementFrom:'a','bb','cc','ddd','e','6'
.[propName]=elementsFrom:[semi colon seperated list of comma seperated list of values]

Pick a random array element from a semi colon seperated list of comma seperated list of elements. It autodetects the return value.

   examples: 
         .seed=elementsFrom: 1,22,94;88,98;993,889,089
    
	 .code=elementsFrom: 'A','B';'X','Y'
.[propName]=nextElementFrom:[comma seperated list of values]

Pick the element from a supplied comma seperated list of elements starting with the first element. It autodetects the return type String or Double.

   examples: 
         .xyznum=nextElementFrom:1,2,3,4,5,6
	 
	 .bcode=nextElementFrom:'a','bb','cc','ddd','e','6'
.[propName]=nextElementFromLong:[comma seperated list of long values]

Pick the element from a supplied comma seperated list of long values starting with the first element. The return type Long.

   examples: 
         .xyznum=nextElementFromLong:1,2,3,4,5,6
.[propName]=listFile:[file name],[return type]

gets a randam value from a supplied list of possible values in a file. Every value in the file must be on a new line. Do not add a header. With the return type you can specify the return type: double,integer or string

   examples: 
         .city=listfile:cityList.txt,string
	 .price=listFile:prices.txt,double
	 .account=listFile:accountnr.txt,integer
.[propName]=listFileNext:file name],[return type],[identifier]

gets the next value from a supplied list of possible values in a file. It starts with the first entry, when the end of the list is reached it will start again at the beginning.
Every value in the file must be on a new line. Do not add a header. With the return type you can specify the return type: double,integer or string
With the indentifier it is possible to use listFileNext for the same file with values multiple times in the property definition, keeping the current position for each [identifier]

   examples: 
         .city=listfile:cityList.txt,string,qbv
	 .price=listFile:prices.txt,double,qbc
	 .account=listFile:accountnr.txt,integer,bb
  == Range Functions

.[propName]=number:[from integer],[to integer](,[format])

Generates a number (double) within the from and to range. When a format is given (java Decimal format) a string is returned, when the format is not specified a Double is returned

   examples: 
         .cost=number:1000,10000
	 .cost=number:1000,10000,##.00
.[propName]=numberR:[from integer],[to integer],[nr of decimals integer]

Generates a number (double) within the from and to range. Generates a number (double) within the from and to range. The number will be rounded up the given nr of decimals

   examples: 
         .cost=numberR:1000,10000,2
.[propName]=int:[from integer],[to integer]

Generates a random integer within the given range. from must be smaller than to.

   example: 
         .cost=int:1000,10000
.[propName]=percentage

Generates a random integer number between 0 and 100 (does the same as int:0,101)

   example: 
         .completed=percentage
  == Date Functions

.[propName]=randomDateString:,(,)

generate a datestring within a given range in the date format given. If format is left away the format 'yyyy-MM-dd' is used.

   examples: 
         .birth=randomDateString:2000-11-22,2014-09-09
	 .start=randomDateString:2000-11-22,2014-09-09,MM-dd-yyyy
.[propName]=randomDate:[dateFrom yyyy-MM-dd],[dateTo yyyy-MM-dd] example .

generate a date numeric value in format yyyymmdd within a given range.

   example: 
         .startDate==randomDate:2000-11-22,2014-09-09
.[propName]=randomDateTime:[dateFrom yyyy-MM-dd],[dateTo yyyy-MM-dd]

generate a date timestamp value within the given range

   example: 
         .startDateTime=randomDateTime:2000-11-22,2014-09-09
.[propName]=now

generates a timestamp value for now.

   example: 
         .created=now
.[propName]=today

Generates a data string yyyy-MM-dd for the current date

   example: 
         .created=today
.[propName]=year:[from year yyyy],[to year yyyy]

Generate a year number within a given range from,to

   example: 
         .since=year:1950:2014
  == Boolean and Constant Functions

.[propName]=boolean:[percentage true]

returns a boolean true or false the [percentage true] is used to get a percentage of true values over all the calls for this function. So if 70 is given an avarage of 70 % of the calls will return true.

   example: 
         .active=boolean:60
.[propName]=constantString:[a string value]

Returns the constant string value you give.

   example: 
         .caption=constantString:Member of
.[propName]=constantNumber:[a number value]

Returns the constant number value you give. It will be a double in the db.

   example: 
         .level=constantNumber:8.2
.[propName]=constantLong:[a number value]

Returns the constant number value you give. It will be a long in the db.

   example: 
         .level=constantNumber:8.2
  == Code Generating Functions

.[propName]=code:[code format]

A random code is generated based on the [code format]
on the place of a # an integer is generated (0..9).
on the place of a _ a capital letter is generated (ABCDEFGHIJKLMNOPQRSTUVWXYZ).

   examples: 
         .creditcard=code:#### #### #### ####
	 .ssn=code:AB###.####.####.ABC
	 .key=code:##-#####-##___
.[propName]=IP:[code format]

A random IP code is generated based on the [code format]
on the place of a # an integer is generated (0..255).

   examples: 
         .ip=IP:#.#.#.#
	 .ip=IP:165.10.#.#
.[propName]=codeSeq:[code format]

The same as code but appended with a sequence number (long) starting with 1 This code is then garantueed unique in this data genertion run. For every [code format] a sequence is created.

   examples: 
         .area=codeSeq:area-
	  (the generated values are area-1, area-2, area-3 etc)
  == Text Generating Functions

.[propName]=txtWords:[number of words]

retuns an array of words

   example: 
         .keywords=txtWords:10
.[propName]=txtText:[number of letters]

returns a string

   example: 
         .remarks=txtText:100
.[propName]=txtSentence

returns a sentence

   example: 
         .summary=txtSentence
.[propName]=txtSentences:[number of sentences]

returns an array of sentences

   example: 
         .summary=txtSentences:10
.[propName]=txtParagraph:[sentence count]

returns a paragraph String with a given sentence count.

   example: 
         .summary=txtParagraph:5
.[propName]=txtParagraphs:[paragraph count]

returns an array of paragraphs (String)

   example: 
         .summary=txtParagraphs:2