Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

Problems when adding GEDCOM-tags via Property Mapping

0 votes

I wish to show some additional GEDCOM-tag values in my familytree in addition to the Name.

My GEDCOM-file has the following look-and-feel (slightly modified);

0 @I6000000074662690046@ INDI
1 NAME Johanna /Sirén/
2 GIVN Sirén
2 SURN Sirén
1 SEX F
1 BIRT
2 DATE 1982-02-07
2 ADDR
3 CITY Borås
3 CTRY Sweden
1 DEAT
2 DATE 1982-02-10
2 CAUS UNKNOWN
2 ADDR
3 CITY Gothenburg
3 CTRY Sweden
1 FAMC @F6000000074662690050@
1 RFN geni:6000000074662690046
 
I have tried all (?) possible combinations of the following regular expressions
 
(?ms).*^\d\sDATE\s(.*)$
(?ms).*^\d\sCITY\s(.*)$
(?ms).*^\d\sCTRY\s(.*)$
 
with different 'Map to Label'-numbers
but with no success.
 
Is the number of labels limited to 3 ?
If so - can it be changed ?
Could you please give me a hint how to proceed.
All help will be appreciated.
in Help by (140 points)
To clarify my question a bit.

Find below the configuration of my Property Mapping

Mappings                                    Map To Label No.        Pattern                    Replacement

BIRT        LabelText        RegularExpression        2                    (?ms).*^\d\sDATE\s(.*)$        $1
BIRT        LabelText        RegularExpression        3                    (?ms).*^\d\sCITY\s(.*)$        $1
BIRT        LabelText        RegularExpression        4                    (?ms).*^\d\sCTRY\s(.*)$        $1
DEAT    LabelText        RegularExpression        5                    (?ms).*^\d\sDATE\s(.*)$        $1
DEAT    LabelText        RegularExpression        6                    (?ms).*^\d\sCITY\s(.*)$        $1
DEAT    LabelText        RegularExpression        7                    (?ms).*^\d\sCTRY\s(.*)$        $1

The first 2 lines produces almost exactly what I want to achieve
But when the 3rd line is added into the Configuration of my Property Mapping configuration it will put
the following text;

1982-02-10
2 CAUS UNKNOWN
2 CITY Gothenburg
2 CTRY Sweden

In the middle of the node.

Something is obviously incorrect.

It can be;
- my RegExp pattern
or
- works as designed (without me knowing the reason behind).

1 Answer

0 votes

yEd's properties mapper supports up to 10 labels per node (or edge).

If you specify a label number greater than the number of labels already present at your nodes, a new default label will be created. E.g. GEDCOM nodes have three labels by default, thus "Map To Label No." 4, 5, 6, and 7 in your sample above will each create a new label. And since each of the new labels will be a default label, all those new labels will be in the center of the node overlapping each other.

The way to fix this problem is to create the required number of labels and to place these labels sensiby before running properties mapper. Of course, creating and placing four new labels for each node in your GEDCOM graph is very tedious. Fortunately, the task of adding labels can be slightly automated:

  1. Create a user-defined palette section (see the Palette Manager documentation for details).
  2. Choose one node and add the required number of new labels. (New labels can be created by right-clicking a node to open its context menu and choosing "Add Label".)
  3. Right-click the modified node to open its context menu and choose "Add to Palette".
  4. Select a node from the other gender.
  5. Go to your user-defined palette section, right-click the template created in step 3 to open its context menu and choose "Apply". This will add the new labels to the selected node, but will also change the node's color to the template's color. Change the color (and only the color) back to the appropriate one for the gender.
  6. Add this node to your user-defined palette section as well.
  7. Use "Tools" -> "Select Elements" to select all male nodes.
  8. Apply the template appropriate for males from your user-defiend palette section.
  9. Use "Tools" -> "Select Elements" to select all female nodes.
  10. Apply the template appropriate for females from your user-defiend palette section.

Aside from that, you should append ".*" (without the quotes) to your regular expressions and make sure that "Mode" is set to "Replace First Match". Without the trailing ".*" any text after the match will remain in the resulting label. E.g. if the DEAT property has the value

2 DATE 1982-02-10
2 CAUS UNKNOWN
2 ADDR
3 CITY Gothenburg
3 CTRY Sweden

your expression "(?ms).*^\d\sDATE\s(.*)$" will match only the first line and thus the result of the conversion will be

1982-02-10
2 CAUS UNKNOWN
2 ADDR
3 CITY Gothenburg
3 CTRY Sweden

whereas "(?ms).*^\d\sDATE\s(.*)$.*" will match the complete text and thus the result of the conversion will be

1982-02-10

by [yWorks] (160k points)
Thanks a lot thomas.behr. You made my day :-)

It was my lack of skills and not yEd.
Legal Disclosure | Privacy Policy
...