Property File: Node and Relation Settings


These settings define the nodes and the relations to be generated

==== Create Nodes

tdg.node.list=[alias]:[Label]:[#create],[Label]:[#create],[Label]:[#create]

This propery contains a comma seperated list of "create definitions". The "create definition" has the following format:

[alias]:[label]:[#create] or [label]:[#create] (label = alias)

   example: 
     tdg.node.list=p1:Person:20,p2:Person:20,Company:20
     

In words:
A set of 20 Nodes with Label Person with alias p1 will be created
A set of 20 Nodes with Label Person with alias p2 will be created
A set of 20 Nodes with Label Company with alias Company will be created

tdg.node.props.[node alias | Label].propName

It is possible to set properties on a node.

[node alias | Label]
When the label is chosen, the properties are set for all the Node sets which have the same label. You can also use the node alias name to set a property for only that set of nodes. You can combine these two. use [label].propName for generic/shared properties and [node alias] for specific properties. the [node alias].propName will overwrite the [label].propName value when it has the same Label!

See the Generator Functions for the possible property value generation possibilities.

   example: 
    tdg.node.props.Company.name=companyName
    tdg.node.props.Company.url=url
    tdg.node.props.Company.bs=companyBS
    tdg.node.props.Company.slogan=companySlogan
    tdg.node.props.Company.text=txtText:40
    tdg.node.props.Company.sentence=txtSentence
    tdg.node.props.Company.sentences=txtSentences:3
    tdg.node.props.Company.paragraph=txtParagraph:10
    tdg.node.props.Company.paragraphs=txtParagraphs:3
==== Lookup Nodes

tdg.lookup.nodes.list=[alias],[alias]

All the aliases for lookups must be in this list. Note that an [alias] must be unique for create and lookup nodes

   example: 
     tdg.lookup.nodes.list=mJobs,mCity
     
tdg.lookup.cypher.[lookup alias]=[cypher statement]

Every lookup alias must have a cypher statement. You must use a '\' in the cypher statement if you want to have a multiline statement. The cypher statement must have one or more node columns in the return.

   example: 
     tdg.lookup.cypher.mJobs=match (job:Job) \
                                where job.level = "high" \ 
				return job
				 
     tdg.lookup.cypher.mCity=match (city:City) return city
				  
tdg.lookup.props.[lookup alias].[return column].propName

It is possible to set properties on lookup node. The Lookup node is identified by the lookup alias and the name of the return column

See the Generator Functions for the possible property value generation possibilities.

   example: 
    tdg.lookup.props.mJobs.job.worktime=percentage
==== Relations

tdg.rel.list=[relation alias],[relation alias],

It is possible to create relations between lookup nodes, between nodes and between lookup nodes and nodes. The relations must be defined first in a list of relation aliases

   example: 
     tdg.rel.list=p1Likep2,p2dislikesp1,jobscity
          

Now for every relation alias a relation definition must be defined.

tdg.rel.def.[rel name]=[start identifier],[relationtype],[end identifier],[cardinality]

[start identifier]:
this is a [alias] for a newly created node or a [lookup alias].[cypher return column] for a lookup node which will be the relation start node

[relationtype] :
The relationship type.

[end identifier] :
this is a [alias] for a newly created node or a [alias].[cypher return column] for a lookup node which will be the relation end node.

[cardinality] : Possible values are: 1-n | n-1 | 1-1
1-n : The "end node" may have max one relation from the start node
n-1 : The "start node" may have max one relation to the end node
1-1 : The "end node" may have one relation from the start node and the "start node" may have one relation to the end node

NOTE:
If you use a lookup node in the relation then you MUST add the column name. The column name is the name of the return column of the cypher query.

   example: 
     tdg.rel.def.p1Likep2=p1,LIKES,p1,n-1
     tdg.rel.def.p2dislikesp1=p2,DISLIKES,p1,1-1
     tdg.rel.def.jobscity=mJobs.job,LOCATED_IN,mCity.city,n-1
          
tdg.rel.props.[relation alias].propName

It is possible to set properties on a relation.

See the Generator Functions for the possible property value generation possibilities.

   example: 
    tdg.rel.props.p2dislikesp1.weight=percentage
==== Repeater Lookup Nodes (In short repeatnode)

tdg.repeatnode.list=[repeatnode alias],[repeatnode alias],

Based on an input list every lookup query is executed.
Properties can be set on relations only.
The execution of the 'repeating' process is after the normal node, lookup node, relation processing, therefore there is also a repeater relation definition you can however relate there to node's and lookupnode's

   example: 
     tdg.repeatnode.list=compperson
          
tdg.repeatnode.input.[repeatnode alias]=[type]:[definition]

Based on an input list every lookup query is executed.
possible values for [type]:[definition]
- list: a comma separated list of values without quotes

examples:
    input.repeatOne=list:bus,tram,metro
    input.repearOne=list:1,2,3,4

- file:a File Name
This file must have a single value for each line.
The file must be present in the 'ddgres' directory
example:
    file:skills.txt
	     
- range:[from],[to]
example:
    range:1,10
	    
- query:[cypher query]
This Cypher query must return one column value (not a node!).
example: 
    query:match (c:City) return distinct c.name

tdg.repeatnode.cypher.[repeatnode alias].[name]=[cypher query]

[repeatnode alias]
must be a value from tdg.repeatnode.list
[queryname]
A name for the cypher query, you can have mulitple cypher queries in onw repeat node definition.
[cypher query]
A valid cypher query just like normal lookup node it must contain one or more ##INPUT## markers. The ##INPUT## will be replaced with a value from the input list

   example: 
     tdg.repeatnode.cypher.compperson.pers=MATCH (prs:Person) \
      -[:LIVES]->(cit:City {name:'##INPUT##'}) return prs
     tdg.repeatnode.cypher.compperson.comp=MATCH (cmp:Company) \
      -[:LOCATED_IN]->(cit:City {name:'##INPUT##'}) return cmp
          
tdg.rel.repeat.list=[repeat relation alias]

Relation definitions for the repeat nodes. It is possible to relate to normal nodes, lookup node and repeat nodes. Note that the repeat node is refreshed for every itteration over the input list.

   example: 
     tdg.rel.repeat.list=compprs
tdg.rel.repeat.def.[repeat relation alias]=[start node identifier],[type],[end node identifier],[cardinality]

Relation definitions for the repeat nodes. It is possible to relate to normal nodes, lookup node and repeat nodes. Note that the repeat node is refreshed for every itteration over the input list.

[start/end node identifier]
- for normal nodes it is the "node alias" - for lookup nodes it "lookup node alias.column" - for repeat nodes it s "repeatnode alias#name.column"

   example: 
     tdg.rel.repeat.def.compprs=compperson#pers.prs,WORKS_FOR,compperson#comp.cmp,n-1
tdg.rel.repeat.props.[repeat relation alias].propName

It is possible to set properties on a repeater relation.

See the Generator Functions for the possible property value generation possibilities.

   example: 
     tdg.rel.repeat.props.compprs.year=year:1950,2000