gedcom.json 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +246 -256
- package/dist/ToJSON/console.js +15 -12
- package/dist/ToJSON/console.js.map +1 -1
- package/dist/ToJSON/models/DefinitionCache.js.map +1 -1
- package/dist/ToJSON/models/LineParsingResult.js.map +1 -1
- package/dist/ToJSON/models/ParsedLine.js +1 -1
- package/dist/ToJSON/models/ParsedLine.js.map +1 -1
- package/dist/ToJSON/models/Parsing.js +8 -6
- package/dist/ToJSON/models/Parsing.js.map +1 -1
- package/dist/ToJSON/models/ParsingObject.js.map +1 -1
- package/dist/ToJSON/models/ParsingOptions.js.map +1 -1
- package/dist/ToJSON/models/ParsingPath.js.map +1 -1
- package/dist/ToJSON/models/ParsingResult.js.map +1 -1
- package/dist/ToJSON/models/StatisticLine.js.map +1 -1
- package/dist/ToJSON/models/Statistics.js +2 -2
- package/dist/ToJSON/models/Statistics.js.map +1 -1
- package/dist/ToJSON/models/Store.js +11 -11
- package/dist/ToJSON/models/Store.js.map +1 -1
- package/dist/ToJSON/models/TagDefinition.js +11 -11
- package/dist/ToJSON/models/TagDefinition.js.map +1 -1
- package/dist/ToJSON/parsing/lineHelper.js +8 -8
- package/dist/ToJSON/parsing/lineHelper.js.map +1 -1
- package/dist/ToJSON/parsing/lineValidation.js +6 -6
- package/dist/ToJSON/parsing/lineValidation.js.map +1 -1
- package/dist/ToJSON/parsing/parseDate.js +84 -84
- package/dist/ToJSON/parsing/parseDate.js.map +1 -1
- package/dist/ToJSON/parsing/parseLine.js +8 -8
- package/dist/ToJSON/parsing/parseLine.js.map +1 -1
- package/dist/ToJSON/parsing/parsing.js +17 -17
- package/dist/ToJSON/parsing/parsing.js.map +1 -1
- package/dist/ToJSON/parsing/processLine.js +18 -18
- package/dist/ToJSON/parsing/processLine.js.map +1 -1
- package/dist/ToJSON/processing/manipulateValues.js +9 -10
- package/dist/ToJSON/processing/manipulateValues.js.map +1 -1
- package/dist/ToJSON/processing/result.js +87 -80
- package/dist/ToJSON/processing/result.js.map +1 -1
- package/dist/common.js +5 -5
- package/dist/common.js.map +1 -1
- package/dist/console.js +4 -4
- package/dist/console.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/options/version551.yaml +303 -296
- package/package.json +13 -8
- package/src/ToJSON/console.ts +67 -67
- package/src/ToJSON/models/DefinitionCache.ts +7 -7
- package/src/ToJSON/models/LineParsingResult.ts +7 -7
- package/src/ToJSON/models/ParsedLine.ts +35 -35
- package/src/ToJSON/models/Parsing.ts +45 -41
- package/src/ToJSON/models/ParsingObject.ts +16 -16
- package/src/ToJSON/models/ParsingOptions.ts +41 -41
- package/src/ToJSON/models/ParsingPath.ts +7 -7
- package/src/ToJSON/models/ParsingResult.ts +10 -10
- package/src/ToJSON/models/StatisticLine.ts +16 -16
- package/src/ToJSON/models/Statistics.ts +63 -63
- package/src/ToJSON/models/Store.ts +106 -108
- package/src/ToJSON/models/TagDefinition.ts +123 -122
- package/src/ToJSON/parsing/lineHelper.ts +21 -21
- package/src/ToJSON/parsing/lineValidation.ts +39 -40
- package/src/ToJSON/parsing/parseDate.ts +280 -286
- package/src/ToJSON/parsing/parseLine.ts +33 -33
- package/src/ToJSON/parsing/parsing.ts +134 -141
- package/src/ToJSON/parsing/processLine.ts +112 -109
- package/src/ToJSON/processing/manipulateValues.ts +52 -53
- package/src/ToJSON/processing/result.ts +247 -241
- package/src/common.ts +14 -14
- package/src/console.ts +7 -8
- package/src/index.ts +3 -6
- package/test.json +0 -323
package/README.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# gedcom.json
|
|
2
2
|
|
|
3
|
-
<!-- [](https://travis-ci.com/Jisco/gedcom.json) -->
|
|
3
|
+
<!-- [](https://travis-ci.com/Jisco/gedcom.json) -->
|
|
4
|
+
|
|
4
5
|
[](https://codecov.io/gh/Jisco/gedcom.json) [](https://snyk.io/test/github/Jisco/gedcom.json?targetFile=package.json)
|
|
5
6
|
|
|
6
7
|
Live example: [CodeSandbox](https://codesandbox.io/s/blissful-elbakyan-tofq8?file=/index.html)
|
|
7
8
|
|
|
8
9
|
## Description
|
|
9
10
|
|
|
10
|
-
This package can be used to parse a file or a string from gedcom format to an object. The object can be used for further data processing or just to create an JSON file.
|
|
11
|
+
This package can be used to parse a file or a string from gedcom format to an object. The object can be used for further data processing or just to create an JSON file.
|
|
11
12
|
|
|
12
13
|
:warning: **Conversion from JSON or JS to GEDCOM is currently under development** :warning:
|
|
13
14
|
|
|
@@ -23,7 +24,7 @@ I am aware that there are already several parsers for the gedcom format. However
|
|
|
23
24
|
|
|
24
25
|
**Through this own definition of how the parsing should be done, it is possible to process files or lines that differ from the original GEDCOM format.**
|
|
25
26
|
|
|
26
|
-
:file_folder: There are 6 example gedcom files available which i found on the internet. I used this files to test against. All files can be found in the ["examples"](/examples) subfolder.
|
|
27
|
+
:file_folder: There are 6 example gedcom files available which i found on the internet. I used this files to test against. All files can be found in the ["examples"](/examples) subfolder. Next to the gedcom files are the converted json files, which were created with this package.
|
|
27
28
|
|
|
28
29
|
## How-To
|
|
29
30
|
|
|
@@ -31,23 +32,23 @@ I am aware that there are already several parsers for the gedcom format. However
|
|
|
31
32
|
|
|
32
33
|
##### Via commandline
|
|
33
34
|
|
|
34
|
-
Just run npx ts-node src/console.ts
|
|
35
|
+
Just run npx ts-node src/console.ts with the wanted flags. Eg if you run "npm run demo:JSON" it will execute "ts-node src/console.ts --path 'examples/simpsons.get'" and will print out the Simpsons GEDCOM example file as JSON object in the console. With "npm run demoFile:JSON" it will do the same but prints the JSON object in a 'test.json' file.
|
|
35
36
|
|
|
36
|
-
| Flag | Description
|
|
37
|
-
| ---------------- |
|
|
38
|
-
| --onlyStats | Only print the parsing statistcs to the console
|
|
39
|
-
| --opt
|
|
40
|
-
| --out
|
|
41
|
-
| --path
|
|
42
|
-
| --silent | Don't print anything to the console
|
|
43
|
-
| --showProgress | Print the progress during processing the file
|
|
37
|
+
| Flag | Description |
|
|
38
|
+
| ---------------- | --------------------------------------------------------------------------- |
|
|
39
|
+
| --onlyStats | Only print the parsing statistcs to the console |
|
|
40
|
+
| --opt _xxx.yaml_ | Set the path to the yaml [definition file](#create-your-own-defintion-file) |
|
|
41
|
+
| --out _xxx.json_ | File path to print into |
|
|
42
|
+
| --path _xxx.ged_ | Set the path to the GEDCOM file |
|
|
43
|
+
| --silent | Don't print anything to the console |
|
|
44
|
+
| --showProgress | Print the progress during processing the file |
|
|
44
45
|
|
|
45
46
|
##### Via Node or JS
|
|
46
47
|
|
|
47
48
|
In your js\ts file you can import the parsing file via
|
|
48
49
|
|
|
49
50
|
```typescript
|
|
50
|
-
import { JsonParsing, ParsingOptions } from
|
|
51
|
+
import { JsonParsing, ParsingOptions } from 'gedcom.json';
|
|
51
52
|
```
|
|
52
53
|
|
|
53
54
|
Create an new parsing options object.
|
|
@@ -61,19 +62,19 @@ Then you have to set the path to the gedcom and the config file respectively the
|
|
|
61
62
|
File content:
|
|
62
63
|
|
|
63
64
|
```typescript
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
parsingOptions.SetFilePath('examples/simpsons.ged');
|
|
66
|
+
parsingOptions.SetConfigFile('options/version551.yaml'); // optional! uses options/version551.yaml by default
|
|
66
67
|
```
|
|
67
68
|
|
|
68
69
|
String content:
|
|
69
70
|
|
|
70
71
|
```typescript
|
|
71
|
-
|
|
72
|
+
parsingOptions.SetText(`
|
|
72
73
|
0 HEAD
|
|
73
74
|
...
|
|
74
75
|
0TRLR
|
|
75
76
|
`);
|
|
76
|
-
|
|
77
|
+
parsingOptions.SetConfig(`
|
|
77
78
|
Definition:
|
|
78
79
|
...
|
|
79
80
|
`);
|
|
@@ -110,34 +111,34 @@ The **result** object has two properties: 'Object' and 'Statistics'.
|
|
|
110
111
|
The **Object** property contains the javascript object. This can be used **directly **or printed to file via
|
|
111
112
|
|
|
112
113
|
```typescript
|
|
113
|
-
parse.SaveAs(result.Object,
|
|
114
|
+
parse.SaveAs(result.Object, 'test.json');
|
|
114
115
|
```
|
|
115
116
|
|
|
116
117
|
**Statistics**
|
|
117
118
|
|
|
118
|
-
| Property | Description
|
|
119
|
-
| ----------------------------------- |
|
|
120
|
-
| LinesCount | Count of all lines
|
|
121
|
-
| ParsedLinesCount | Count of all lines that has been parsed
|
|
122
|
-
| NotParsedLinesCount | Count of all lines that has
|
|
123
|
-
| NotParsedLinesList | List of all line numbers of not parsed lines
|
|
124
|
-
| NotParsedLinesWithoutGEDCOMTagCount | Count of all lines that has
|
|
125
|
-
| IncorrectLinesCount | Count of all incorrect lines (no tag, too long etc pp)
|
|
126
|
-
| IncorrectLines | Array of object from incorrect lines. Properties:
|
|
119
|
+
| Property | Description |
|
|
120
|
+
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
121
|
+
| LinesCount | Count of all lines |
|
|
122
|
+
| ParsedLinesCount | Count of all lines that has been parsed |
|
|
123
|
+
| NotParsedLinesCount | Count of all lines that has _NOT_ been parsed |
|
|
124
|
+
| NotParsedLinesList | List of all line numbers of not parsed lines |
|
|
125
|
+
| NotParsedLinesWithoutGEDCOMTagCount | Count of all lines that has _NOT_ been parsed because their tag is not defined in the yaml definition file |
|
|
126
|
+
| IncorrectLinesCount | Count of all incorrect lines (no tag, too long etc pp) |
|
|
127
|
+
| IncorrectLines | Array of object from incorrect lines. Properties: _LineNumber_, _Line_ and _Text_ |
|
|
127
128
|
|
|
128
129
|
### Create your own defintion file
|
|
129
130
|
|
|
130
131
|
#### Structure
|
|
131
132
|
|
|
132
|
-
The configuration file has to begin with the **Definition** Property.
|
|
133
|
+
The configuration file has to begin with the **Definition** Property. Followed by multiple [**Tag**](#tag) definitions. Each Tag can have different properties including further Tags. It's possible to do a flat Tags definition list, or to do specific defintions of each Tag beneath another Tag. :laughing:
|
|
133
134
|
|
|
134
|
-
When a line with a specific tag is parsed the parser searches the matching
|
|
135
|
+
When a line with a specific tag is parsed the parser searches the matching _Tag_ defintion.
|
|
135
136
|
|
|
136
137
|
```
|
|
137
138
|
NAME Test /Name/
|
|
138
139
|
```
|
|
139
140
|
|
|
140
|
-
will search a for an matching
|
|
141
|
+
will search a for an matching _Tag_ defintion in the yaml definition
|
|
141
142
|
|
|
142
143
|
```yaml
|
|
143
144
|
- Tag: NAME
|
|
@@ -153,7 +154,7 @@ Example:
|
|
|
153
154
|
1 NAME Abraham /Simpson/
|
|
154
155
|
```
|
|
155
156
|
|
|
156
|
-
Will first look for an defintion of the
|
|
157
|
+
Will first look for an defintion of the _NAME_ Tag beneath the _INDI_ Tag.
|
|
157
158
|
|
|
158
159
|
```yaml
|
|
159
160
|
- Tag: INDI
|
|
@@ -163,22 +164,22 @@ Will first look for an defintion of the *NAME* Tag beneath the *INDI* Tag.
|
|
|
163
164
|
Property: Fullname
|
|
164
165
|
```
|
|
165
166
|
|
|
166
|
-
If this is not defined the search continues be going higher in the defintion until it ends by the '
|
|
167
|
+
If this is not defined the search continues be going higher in the defintion until it ends by the '_global_' defintion for the _NAME_ Tag.
|
|
167
168
|
|
|
168
169
|
```yaml
|
|
169
170
|
- Tag: NAME
|
|
170
171
|
Property: Name
|
|
171
172
|
```
|
|
172
173
|
|
|
173
|
-
In this way it is possible to parse the
|
|
174
|
+
In this way it is possible to parse the _NAME_ Tag by default with a property name _Name_ but beneath the _INDI_ object it will be parsed as _Fullname_ property.
|
|
174
175
|
|
|
175
176
|
#### Tag definition
|
|
176
177
|
|
|
177
|
-
The most simple defintion of an
|
|
178
|
+
The most simple defintion of an _Tag_ looks like the following
|
|
178
179
|
|
|
179
180
|
```yaml
|
|
180
|
-
- Tag: NAME
|
|
181
|
-
Property: Name
|
|
181
|
+
- Tag: NAME # Tag name matching the tag in the gedcom file
|
|
182
|
+
Property: Name # Name of the target property
|
|
182
183
|
```
|
|
183
184
|
|
|
184
185
|
Example:
|
|
@@ -189,23 +190,23 @@ Example:
|
|
|
189
190
|
|
|
190
191
|
But mostly there is no single value (eg property) defined in the gedcom files, the common case is an object in an array of objects
|
|
191
192
|
|
|
192
|
-
This will be done via the
|
|
193
|
+
This will be done via the _CollectAs_ property.
|
|
193
194
|
|
|
194
195
|
```yaml
|
|
195
|
-
- Tag: INDI
|
|
196
|
-
CollectAs: Individuals
|
|
197
|
-
- Tag: NAME
|
|
198
|
-
Property: Name
|
|
196
|
+
- Tag: INDI # Tag name mathing the tag in the gedcom file
|
|
197
|
+
CollectAs: Individuals # Name of the target collection property
|
|
198
|
+
- Tag: NAME # Tag name matching the tag in the gedcom file
|
|
199
|
+
Property: Name # Name of the target property
|
|
199
200
|
```
|
|
200
201
|
|
|
201
202
|
Example:
|
|
202
203
|
|
|
203
|
-
| GEDCOM Lines (order matters) | JS Result
|
|
204
|
-
| ---------------------------- |
|
|
205
|
-
| 0 @Abraham_Simpson@ INDI | <pre>{<br />
|
|
206
|
-
| 1 NAME Abraham /Simpson/ | <pre>{<br />
|
|
204
|
+
| GEDCOM Lines (order matters) | JS Result |
|
|
205
|
+
| ---------------------------- | ------------------------------------------------------------------------------ |
|
|
206
|
+
| 0 @Abraham_Simpson@ INDI | <pre>{<br /> Individuals: []<br />}</pre> |
|
|
207
|
+
| 1 NAME Abraham /Simpson/ | <pre>{<br /> Individuals: [<br/> Name: "Abraham /Simpson/"<br/> ]<br />}</pre> |
|
|
207
208
|
|
|
208
|
-
Extended example of the
|
|
209
|
+
Extended example of the _INDI_ Tag (all properties will be explained below the example:
|
|
209
210
|
|
|
210
211
|
YAML Definition:
|
|
211
212
|
|
|
@@ -215,15 +216,15 @@ YAML Definition:
|
|
|
215
216
|
CollectAsArray: true
|
|
216
217
|
Property: Id
|
|
217
218
|
Properties:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
219
|
+
- Tag: NAME
|
|
220
|
+
Property: Fullname
|
|
221
|
+
Properties:
|
|
222
|
+
- Tag: GIVN
|
|
223
|
+
Property: Givenname
|
|
224
|
+
MergeWithLast: INDI
|
|
225
|
+
- Tag: SURN
|
|
226
|
+
Property: Surname
|
|
227
|
+
MergeWithLast: INDI
|
|
227
228
|
```
|
|
228
229
|
|
|
229
230
|
GEDCOM Lines
|
|
@@ -241,12 +242,12 @@ Result
|
|
|
241
242
|
{
|
|
242
243
|
Individuals: [
|
|
243
244
|
{
|
|
244
|
-
Id:
|
|
245
|
-
Surname:
|
|
246
|
-
Givenname:
|
|
247
|
-
Fullname:
|
|
248
|
-
}
|
|
249
|
-
]
|
|
245
|
+
Id: '@Abraham_Simpson@',
|
|
246
|
+
Surname: 'Simpson',
|
|
247
|
+
Givenname: 'Abraham',
|
|
248
|
+
Fullname: 'Abraham /Simpson/',
|
|
249
|
+
},
|
|
250
|
+
];
|
|
250
251
|
}
|
|
251
252
|
```
|
|
252
253
|
|
|
@@ -284,9 +285,8 @@ Result
|
|
|
284
285
|
|
|
285
286
|
```javascript
|
|
286
287
|
{
|
|
287
|
-
Individuals:
|
|
288
|
-
|
|
289
|
-
Id: "@Abraham_Simpson@"
|
|
288
|
+
Individuals: {
|
|
289
|
+
Id: '@Abraham_Simpson@';
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
```
|
|
@@ -302,15 +302,14 @@ Result
|
|
|
302
302
|
|
|
303
303
|
```javascript
|
|
304
304
|
{
|
|
305
|
-
Individuals:
|
|
306
|
-
[
|
|
305
|
+
Individuals: [
|
|
307
306
|
{
|
|
308
|
-
Id:
|
|
307
|
+
Id: '@Abraham_Simpson@',
|
|
309
308
|
},
|
|
310
309
|
{
|
|
311
|
-
Id:
|
|
312
|
-
}
|
|
313
|
-
]
|
|
310
|
+
Id: '@Homer_Simpson@',
|
|
311
|
+
},
|
|
312
|
+
];
|
|
314
313
|
}
|
|
315
314
|
```
|
|
316
315
|
|
|
@@ -335,12 +334,11 @@ Result
|
|
|
335
334
|
|
|
336
335
|
```javascript
|
|
337
336
|
{
|
|
338
|
-
Individuals:
|
|
339
|
-
[
|
|
337
|
+
Individuals: [
|
|
340
338
|
{
|
|
341
|
-
Id:
|
|
342
|
-
}
|
|
343
|
-
]
|
|
339
|
+
Id: '@Abraham_Simpson@',
|
|
340
|
+
},
|
|
341
|
+
];
|
|
344
342
|
}
|
|
345
343
|
```
|
|
346
344
|
|
|
@@ -353,14 +351,14 @@ Long form of [Type](#Type) property. Allows input of conversion options.
|
|
|
353
351
|
Optional: Delimiter (default value is ',')
|
|
354
352
|
|
|
355
353
|
```yaml
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
354
|
+
Definition:
|
|
355
|
+
- Tag: NOTE
|
|
356
|
+
CollectAs: Notes
|
|
357
|
+
Property:
|
|
358
|
+
Name: Value
|
|
359
|
+
ConvertTo:
|
|
360
|
+
Type: Array
|
|
361
|
+
Delimiter: '#'
|
|
364
362
|
```
|
|
365
363
|
|
|
366
364
|
```
|
|
@@ -371,9 +369,8 @@ Result:
|
|
|
371
369
|
|
|
372
370
|
```javascript
|
|
373
371
|
{
|
|
374
|
-
Notes:
|
|
375
|
-
|
|
376
|
-
Value: [ "A", "B", "C,D" ]
|
|
372
|
+
Notes: {
|
|
373
|
+
Value: ['A', 'B', 'C,D'];
|
|
377
374
|
}
|
|
378
375
|
}
|
|
379
376
|
```
|
|
@@ -407,16 +404,16 @@ Converts a GEDCOM Date String to a date. Because there a multiple variants possi
|
|
|
407
404
|
|
|
408
405
|
```yaml
|
|
409
406
|
Definition:
|
|
410
|
-
- Tag: DATES
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
407
|
+
- Tag: DATES
|
|
408
|
+
Properties:
|
|
409
|
+
- Tag: DATE
|
|
410
|
+
Property: Date
|
|
411
|
+
ConvertTo:
|
|
412
|
+
Type: Date
|
|
413
|
+
From: Start # Property will be "Start" instead the default value "From"
|
|
414
|
+
To: End # Property will be "End" instead the default value "To"
|
|
415
|
+
Original: Initial # Property will be "Initial" instead the default value "Original"
|
|
416
|
+
Value: JSDate # Property will be "JSDate" instead the default value "Value"
|
|
420
417
|
```
|
|
421
418
|
|
|
422
419
|
```
|
|
@@ -430,7 +427,7 @@ Result:
|
|
|
430
427
|
{
|
|
431
428
|
Date:
|
|
432
429
|
{
|
|
433
|
-
Start:
|
|
430
|
+
Start:
|
|
434
431
|
{
|
|
435
432
|
JSDate: new Date(1980, 1, 4, 0, 0 , 0),
|
|
436
433
|
HasYear: true,
|
|
@@ -459,18 +456,18 @@ Optional:
|
|
|
459
456
|
|
|
460
457
|
```yaml
|
|
461
458
|
Definition:
|
|
462
|
-
- Tag: NOTE
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
459
|
+
- Tag: NOTE
|
|
460
|
+
CollectAs: Notes
|
|
461
|
+
Properties:
|
|
462
|
+
- Tag: CONC
|
|
463
|
+
Property: Text
|
|
464
|
+
Type: String
|
|
465
|
+
- Tag: CONT
|
|
466
|
+
Property: Text
|
|
467
|
+
ConvertTo:
|
|
468
|
+
Type: String
|
|
469
|
+
NewLineIfEmpty: true # all empty CONT values will add a new line
|
|
470
|
+
NewLineCharacter: ' | ' # value of new line
|
|
474
471
|
```
|
|
475
472
|
|
|
476
473
|
```
|
|
@@ -488,9 +485,8 @@ Result:
|
|
|
488
485
|
|
|
489
486
|
```javascript
|
|
490
487
|
{
|
|
491
|
-
Notes:
|
|
492
|
-
|
|
493
|
-
Text: `1 | ABC | ...`
|
|
488
|
+
Notes: {
|
|
489
|
+
Text: `1 | ABC | ...`;
|
|
494
490
|
}
|
|
495
491
|
}
|
|
496
492
|
```
|
|
@@ -503,16 +499,16 @@ Works only in combination with a previous defined explicit date eg **1 JAN 1999*
|
|
|
503
499
|
|
|
504
500
|
```yaml
|
|
505
501
|
Definition:
|
|
506
|
-
- Tag: DATES
|
|
507
|
-
Properties:
|
|
508
|
-
- Tag: DATE
|
|
509
|
-
Property: Date
|
|
510
|
-
Type: Date
|
|
502
|
+
- Tag: DATES
|
|
511
503
|
Properties:
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
504
|
+
- Tag: DATE
|
|
505
|
+
Property: Date
|
|
506
|
+
Type: Date
|
|
507
|
+
Properties:
|
|
508
|
+
- Tag: TIME
|
|
509
|
+
Property: Time
|
|
510
|
+
ConvertTo:
|
|
511
|
+
Type: Time
|
|
516
512
|
```
|
|
517
513
|
|
|
518
514
|
```
|
|
@@ -541,15 +537,15 @@ Time has no own property
|
|
|
541
537
|
|
|
542
538
|
```yaml
|
|
543
539
|
Definition:
|
|
544
|
-
- Tag: DATES
|
|
545
|
-
Properties:
|
|
546
|
-
- Tag: DATE
|
|
547
|
-
Property: Date
|
|
548
|
-
Type: Date
|
|
540
|
+
- Tag: DATES
|
|
549
541
|
Properties:
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
Type:
|
|
542
|
+
- Tag: DATE
|
|
543
|
+
Property: Date
|
|
544
|
+
Type: Date
|
|
545
|
+
Properties:
|
|
546
|
+
- Tag: TIME
|
|
547
|
+
ConvertTo:
|
|
548
|
+
Type: Time
|
|
553
549
|
```
|
|
554
550
|
|
|
555
551
|
Result:
|
|
@@ -562,19 +558,19 @@ Date:
|
|
|
562
558
|
HasYear: true,
|
|
563
559
|
HasMonth: true,
|
|
564
560
|
HasDay: true,
|
|
565
|
-
Original: "4 JUN 1999 14:35:22" // date and time combined, because the original time value will else be lost
|
|
561
|
+
Original: "4 JUN 1999 14:35:22" // date and time combined, because the original time value will else be lost
|
|
566
562
|
}
|
|
567
563
|
}
|
|
568
564
|
```
|
|
569
565
|
|
|
570
566
|
##### IsSingleValue (Boolean)
|
|
571
567
|
|
|
572
|
-
Normally if a property value is found twice or more it will be converted to an array of values. With
|
|
568
|
+
Normally if a property value is found twice or more it will be converted to an array of values. With _IsSingleValue_ it is possible to force the last found value to win.
|
|
573
569
|
|
|
574
570
|
```yaml
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
571
|
+
Definition:
|
|
572
|
+
- Tag: NOTE
|
|
573
|
+
Property: Note
|
|
578
574
|
```
|
|
579
575
|
|
|
580
576
|
```
|
|
@@ -586,28 +582,28 @@ Result:
|
|
|
586
582
|
|
|
587
583
|
```javascript
|
|
588
584
|
{
|
|
589
|
-
|
|
585
|
+
Note: ['Note1', 'Note2'];
|
|
590
586
|
}
|
|
591
587
|
```
|
|
592
588
|
|
|
593
589
|
Set IsSingleValue to be 'true';
|
|
594
590
|
|
|
595
591
|
```yaml
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
592
|
+
Definition:
|
|
593
|
+
- Tag: NOTE
|
|
594
|
+
Property: Note
|
|
595
|
+
IsSingleValue: true
|
|
600
596
|
```
|
|
601
597
|
|
|
602
598
|
Result (last value wins):
|
|
603
599
|
|
|
604
600
|
```javascript
|
|
605
601
|
{
|
|
606
|
-
|
|
602
|
+
Note: 'Note2';
|
|
607
603
|
}
|
|
608
604
|
```
|
|
609
605
|
|
|
610
|
-
######
|
|
606
|
+
######
|
|
611
607
|
|
|
612
608
|
##### MergeWithNext (String)
|
|
613
609
|
|
|
@@ -616,16 +612,16 @@ It's possible to merge a value with the next object with the given Tag. If no ne
|
|
|
616
612
|
Example:
|
|
617
613
|
|
|
618
614
|
```yaml
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
615
|
+
Definition:
|
|
616
|
+
- Tag: A
|
|
617
|
+
CollectAs: A
|
|
618
|
+
- Tag: B
|
|
619
|
+
Property: Value_B
|
|
620
|
+
- Tag: C
|
|
621
|
+
Property: Value_C
|
|
622
|
+
- Tag: D
|
|
623
|
+
Property: Value_D
|
|
624
|
+
MergeWithNext: B # merge result with next Tag B
|
|
629
625
|
```
|
|
630
626
|
|
|
631
627
|
```
|
|
@@ -639,18 +635,17 @@ Result:
|
|
|
639
635
|
|
|
640
636
|
```javascript
|
|
641
637
|
{
|
|
642
|
-
A:
|
|
643
|
-
[
|
|
638
|
+
A: [
|
|
644
639
|
// parsed Tag C
|
|
645
640
|
{
|
|
646
|
-
Value_C:
|
|
641
|
+
Value_C: 'Value_Of_C',
|
|
647
642
|
},
|
|
648
643
|
// parsed Tag B merged with Tag D
|
|
649
644
|
{
|
|
650
|
-
Value_B:
|
|
651
|
-
Value_D:
|
|
652
|
-
}
|
|
653
|
-
]
|
|
645
|
+
Value_B: 'Value_Of_B',
|
|
646
|
+
Value_D: 'Value_Of_D',
|
|
647
|
+
},
|
|
648
|
+
];
|
|
654
649
|
}
|
|
655
650
|
```
|
|
656
651
|
|
|
@@ -661,16 +656,16 @@ Same as [MergeWithNext](#mergewithnext) but in the reversed direction. Can be an
|
|
|
661
656
|
Example (String)
|
|
662
657
|
|
|
663
658
|
```yaml
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
659
|
+
Definition:
|
|
660
|
+
- Tag: A
|
|
661
|
+
CollectAs: A
|
|
662
|
+
- Tag: B
|
|
663
|
+
Property: Value_B
|
|
664
|
+
- Tag: C
|
|
665
|
+
Property: Value_C
|
|
666
|
+
- Tag: D
|
|
667
|
+
Property: Value_D
|
|
668
|
+
MergeWithLast: B # merge result with last Tag B
|
|
674
669
|
```
|
|
675
670
|
|
|
676
671
|
```
|
|
@@ -684,18 +679,17 @@ Result:
|
|
|
684
679
|
|
|
685
680
|
```javascript
|
|
686
681
|
{
|
|
687
|
-
A:
|
|
688
|
-
[
|
|
682
|
+
A: [
|
|
689
683
|
// parsed Tag B merged with Tag D
|
|
690
684
|
{
|
|
691
|
-
Value_B:
|
|
692
|
-
Value_D:
|
|
693
|
-
},
|
|
685
|
+
Value_B: 'Value_Of_B',
|
|
686
|
+
Value_D: 'Value_Of_D',
|
|
687
|
+
},
|
|
694
688
|
// parsed Tag C
|
|
695
689
|
{
|
|
696
|
-
Value_C:
|
|
690
|
+
Value_C: 'Value_Of_C',
|
|
697
691
|
},
|
|
698
|
-
]
|
|
692
|
+
];
|
|
699
693
|
}
|
|
700
694
|
```
|
|
701
695
|
|
|
@@ -703,13 +697,13 @@ Example (Boolean)
|
|
|
703
697
|
|
|
704
698
|
```yaml
|
|
705
699
|
Definition:
|
|
706
|
-
- Tag: NOTE
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
- Tag: CONC
|
|
710
|
-
|
|
711
|
-
- Tag: CONT
|
|
712
|
-
|
|
700
|
+
- Tag: NOTE
|
|
701
|
+
Property: Id
|
|
702
|
+
CollectAs: Notes
|
|
703
|
+
- Tag: CONC
|
|
704
|
+
MergeWithLast: true
|
|
705
|
+
- Tag: CONT
|
|
706
|
+
MergeWithLast: true
|
|
713
707
|
```
|
|
714
708
|
|
|
715
709
|
```
|
|
@@ -733,20 +727,20 @@ Result:
|
|
|
733
727
|
}
|
|
734
728
|
```
|
|
735
729
|
|
|
736
|
-
:warning: Because the object has no last property (
|
|
730
|
+
:warning: Because the object has no last property (_CONC_ has no defined property) there will be created on property with the name _Text_.
|
|
737
731
|
|
|
738
732
|
Example (Boolean) WITH defined parent property
|
|
739
733
|
|
|
740
734
|
```yaml
|
|
741
735
|
Definition:
|
|
742
|
-
- Tag: NOTE
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
- Tag: EVEN
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
- Tag: CONC
|
|
749
|
-
|
|
736
|
+
- Tag: NOTE
|
|
737
|
+
Property: Id
|
|
738
|
+
CollectAs: Notes
|
|
739
|
+
- Tag: EVEN
|
|
740
|
+
CollectAs: Events
|
|
741
|
+
Property: Name
|
|
742
|
+
- Tag: CONC
|
|
743
|
+
MergeWithLast: true
|
|
750
744
|
```
|
|
751
745
|
|
|
752
746
|
```
|
|
@@ -759,10 +753,10 @@ Result:
|
|
|
759
753
|
|
|
760
754
|
```javascript
|
|
761
755
|
{
|
|
762
|
-
Notes:
|
|
756
|
+
Notes:
|
|
763
757
|
{
|
|
764
758
|
Id: "@N00010@",
|
|
765
|
-
Events:
|
|
759
|
+
Events:
|
|
766
760
|
{
|
|
767
761
|
Name: "RCKarnes-RootsWeb & John D Newport-Ancestry.com (johndnewport@valornet.com)",
|
|
768
762
|
}
|
|
@@ -781,15 +775,15 @@ Property Name in the object. This can be interpretated as an object path if "."
|
|
|
781
775
|
|
|
782
776
|
```yaml
|
|
783
777
|
Definition:
|
|
784
|
-
- Tag: WHAT
|
|
785
|
-
|
|
778
|
+
- Tag: WHAT
|
|
779
|
+
Property: Id
|
|
786
780
|
```
|
|
787
781
|
|
|
788
782
|
Result:
|
|
789
783
|
|
|
790
784
|
```js
|
|
791
785
|
{
|
|
792
|
-
|
|
786
|
+
Id: 'ID';
|
|
793
787
|
}
|
|
794
788
|
```
|
|
795
789
|
|
|
@@ -797,17 +791,16 @@ Configuration with 'path':
|
|
|
797
791
|
|
|
798
792
|
```yaml
|
|
799
793
|
Definition:
|
|
800
|
-
- Tag: WHAT
|
|
801
|
-
|
|
794
|
+
- Tag: WHAT
|
|
795
|
+
Property: What.Id
|
|
802
796
|
```
|
|
803
797
|
|
|
804
798
|
Result:
|
|
805
799
|
|
|
806
800
|
```js
|
|
807
801
|
{
|
|
808
|
-
What:
|
|
809
|
-
|
|
810
|
-
Id: 'ID'
|
|
802
|
+
What: {
|
|
803
|
+
Id: 'ID';
|
|
811
804
|
}
|
|
812
805
|
}
|
|
813
806
|
```
|
|
@@ -821,16 +814,16 @@ Defines that a Tag definition has specific definitions for following Tags.
|
|
|
821
814
|
CollectAs: Individuals
|
|
822
815
|
CollectAsArray: true
|
|
823
816
|
Property: Id
|
|
824
|
-
Properties:
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
817
|
+
Properties: # specifies the NAME Tag
|
|
818
|
+
- Tag: NAME
|
|
819
|
+
Property: Fullname
|
|
820
|
+
Properties: # specifies the GIVN and SURN Tag
|
|
821
|
+
- Tag: GIVN
|
|
822
|
+
Property: Givenname
|
|
823
|
+
MergeWithLast: INDI
|
|
824
|
+
- Tag: SURN
|
|
825
|
+
Property: Surname
|
|
826
|
+
MergeWithLast: INDI
|
|
834
827
|
```
|
|
835
828
|
|
|
836
829
|
##### Replace (Object)
|
|
@@ -844,16 +837,16 @@ Could be used to replace substring in the property value.
|
|
|
844
837
|
|
|
845
838
|
```yaml
|
|
846
839
|
Definition:
|
|
847
|
-
- Tag: INDI
|
|
848
|
-
|
|
849
|
-
Properties:
|
|
850
|
-
- Tag: RESI
|
|
840
|
+
- Tag: INDI
|
|
841
|
+
CollectAs: Persons
|
|
851
842
|
Properties:
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
843
|
+
- Tag: RESI
|
|
844
|
+
Properties:
|
|
845
|
+
- Tag: EMAIL
|
|
846
|
+
Property: EMail
|
|
847
|
+
Replace:
|
|
848
|
+
Value: '@@' # replace '@@'
|
|
849
|
+
With: '@' # with a single '@'
|
|
857
850
|
```
|
|
858
851
|
|
|
859
852
|
```
|
|
@@ -868,9 +861,8 @@ Result:
|
|
|
868
861
|
|
|
869
862
|
```javascript
|
|
870
863
|
{
|
|
871
|
-
Persons:
|
|
872
|
-
|
|
873
|
-
EMail: [ 'email@test.com', 'anotherEmail@test.com' ]
|
|
864
|
+
Persons: {
|
|
865
|
+
EMail: ['email@test.com', 'anotherEmail@test.com'];
|
|
874
866
|
}
|
|
875
867
|
}
|
|
876
868
|
```
|
|
@@ -881,15 +873,15 @@ Adds the given string at the beginning of the value.
|
|
|
881
873
|
|
|
882
874
|
```yaml
|
|
883
875
|
Definition:
|
|
884
|
-
- Tag: INDI
|
|
885
|
-
|
|
886
|
-
Properties:
|
|
887
|
-
- Tag: RESI
|
|
876
|
+
- Tag: INDI
|
|
877
|
+
CollectAs: Persons
|
|
888
878
|
Properties:
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
879
|
+
- Tag: RESI
|
|
880
|
+
Properties:
|
|
881
|
+
- Tag: EMAIL
|
|
882
|
+
Property: EMail
|
|
883
|
+
StartWith: >- # needed in yaml because the string value 'mail:' end with ':'
|
|
884
|
+
mail: # add 'mail:' at the beginning of each EMail value
|
|
893
885
|
```
|
|
894
886
|
|
|
895
887
|
```
|
|
@@ -904,9 +896,8 @@ Result:
|
|
|
904
896
|
|
|
905
897
|
```javascript
|
|
906
898
|
{
|
|
907
|
-
Persons:
|
|
908
|
-
|
|
909
|
-
EMail: [ 'mail:email@@test.com', 'mail:anotherEmail@@test.com' ]
|
|
899
|
+
Persons: {
|
|
900
|
+
EMail: ['mail:email@@test.com', 'mail:anotherEmail@@test.com'];
|
|
910
901
|
}
|
|
911
902
|
}
|
|
912
903
|
```
|
|
@@ -917,12 +908,12 @@ Could be used to remove html from property values.
|
|
|
917
908
|
|
|
918
909
|
```yaml
|
|
919
910
|
Definition:
|
|
920
|
-
- Tag: INDI
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
911
|
+
- Tag: INDI
|
|
912
|
+
CollectAs: Persons
|
|
913
|
+
Properties:
|
|
914
|
+
- Tag: NOTE
|
|
915
|
+
Property: Note
|
|
916
|
+
StripHtml: true
|
|
926
917
|
```
|
|
927
918
|
|
|
928
919
|
```
|
|
@@ -934,9 +925,8 @@ Result:
|
|
|
934
925
|
|
|
935
926
|
```javascript
|
|
936
927
|
{
|
|
937
|
-
Persons:
|
|
938
|
-
|
|
939
|
-
Note: 'Whatever'
|
|
928
|
+
Persons: {
|
|
929
|
+
Note: 'Whatever';
|
|
940
930
|
}
|
|
941
931
|
}
|
|
942
932
|
```
|
|
@@ -945,7 +935,7 @@ Result:
|
|
|
945
935
|
|
|
946
936
|
Reference to GEDCOM format. This activates parsing of this tag. If a tag that has not been defined occurs when a GEDCOM formatted line is run through, this and all subsequent subordinate lines are ignored.
|
|
947
937
|
|
|
948
|
-
Tags must be redefined for each property within the main tag. Any tag can be used and is not tied to a defined GEDCOM tag. :rocket: If you defined it the parser can parse it.
|
|
938
|
+
Tags must be redefined for each property within the main tag. Any tag can be used and is not tied to a defined GEDCOM tag. :rocket: If you defined it the parser can parse it.
|
|
949
939
|
|
|
950
940
|
##### Type
|
|
951
941
|
|
|
@@ -953,8 +943,8 @@ Short version of [ConvertTo](#convertto) without options. The default values of
|
|
|
953
943
|
|
|
954
944
|
```yaml
|
|
955
945
|
- Tag: CONC
|
|
956
|
-
Property: Text
|
|
957
|
-
Type: String
|
|
946
|
+
Property: Text
|
|
947
|
+
Type: String
|
|
958
948
|
- Tag: DATE
|
|
959
949
|
Property: Date
|
|
960
950
|
Type: Date
|
|
@@ -1034,11 +1024,11 @@ Result:
|
|
|
1034
1024
|
}
|
|
1035
1025
|
```
|
|
1036
1026
|
|
|
1037
|
-
Dates like **JAN 1999** will also be converted to a between value. **JAN 1999**
|
|
1027
|
+
Dates like **JAN 1999** will also be converted to a between value. **JAN 1999** for example is between 01.01.1999 and 01.02.1999
|
|
1038
1028
|
|
|
1039
|
-
|
|
1029
|
+
###### Single Dates
|
|
1040
1030
|
|
|
1041
|
-
A single date in the GEDCOM format looks like **20 JAN 1999**.
|
|
1031
|
+
A single date in the GEDCOM format looks like **20 JAN 1999**.
|
|
1042
1032
|
|
|
1043
1033
|
```
|
|
1044
1034
|
20 JAN 1999
|
|
@@ -1056,13 +1046,13 @@ A single date in the GEDCOM format looks like **20 JAN 1999**.
|
|
|
1056
1046
|
|
|
1057
1047
|
There are different markings for dates. These are optional. For each a new property with the value 'true' is added.
|
|
1058
1048
|
|
|
1059
|
-
| Marker | Description
|
|
1060
|
-
| ------ |
|
|
1061
|
-
| EST | Estimated based on an algorithm using some other event date
|
|
1062
|
-
| ABT | About, meaning the date is not exact.
|
|
1063
|
-
| CAL | Calculated mathematically, for example, from an event date and age.
|
|
1064
|
-
| AFT | Event happened after the given date.
|
|
1065
|
-
| BEF | Event happened before the given date.
|
|
1049
|
+
| Marker | Description | Example |
|
|
1050
|
+
| ------ | ----------------------------------------------------------------------------------------------------------------- | --------------- |
|
|
1051
|
+
| EST | Estimated based on an algorithm using some other event date | EST 20 JAN 1999 |
|
|
1052
|
+
| ABT | About, meaning the date is not exact. | ABT 20 JAN 1999 |
|
|
1053
|
+
| CAL | Calculated mathematically, for example, from an event date and age. | CAL 20 JAN 1999 |
|
|
1054
|
+
| AFT | Event happened after the given date. | AFT 20 JAN 1999 |
|
|
1055
|
+
| BEF | Event happened before the given date. | BEF 20 JAN 1999 |
|
|
1066
1056
|
| INT | Interpreted from knowledge about the associated date phrase included in parentheses. Returns just the text value. | INT Sometime |
|
|
1067
1057
|
|
|
1068
1058
|
Estimated example (but it's the same for ABT, CAL, AFT and BEF).
|