familysearch / gedcom5-conversion Goto Github PK
View Code? Open in Web Editor NEWUtilities for GEDCOM 5.5 to GEDCOM X Conversion
License: Other
Utilities for GEDCOM 5.5 to GEDCOM X Conversion
License: Other
09:46:32.281 ERROR - SAXException: Unrecognized encoding in gedcom file: ISO-885
9-5 @ 0
Exception in thread "main" org.xml.sax.SAXParseException; systemId: file:/C:/tem
p/New.ged; lineNumber: 0; SAXException: Unrecognized encoding in gedcom file: IS
O-8859-5
at org.gedml.GedcomParser.parse(GedcomParser.java:369)
at org.folg.gedcom.parser.ModelParser.parseGedcom(ModelParser.java:1552)
at org.gedcomx.tools.Gedcom2Gedcomx.convert55File(Gedcom2Gedcomx.java:18
at org.gedcomx.tools.Gedcom2Gedcomx.doMain(Gedcom2Gedcomx.java:156)
at org.gedcomx.tools.Gedcom2Gedcomx.main(Gedcom2Gedcomx.java:222)
Running Java 7 Update 9 on Windows 7
Pulled gedcom5-conversion-0.2.0-SNAPSHOT-full.jar
When converting my GEDCOM pulled from ancestry I get the following error:
Exception in thread "main" java.lang.NullPointerException
at org.gedcomx.conversion.gedcom.dq55.SubmitterMapper.toContributor(Subm
itterMapper.java:34)
at org.gedcomx.conversion.gedcom.dq55.GedcomMapper.toGedcomx(GedcomMappe
r.java:43)
at org.gedcomx.tools.Gedcom2Gedcomx.convert55File(Gedcom2Gedcomx.java:20
6)
at org.gedcomx.tools.Gedcom2Gedcomx.doMain(Gedcom2Gedcomx.java:159)
at org.gedcomx.tools.Gedcom2Gedcomx.main(Gedcom2Gedcomx.java:216)
The GeditCom Torture Test cites the source for most events similar to this:
2 SOUR @source1@
3 PAGE 42
3 DATA
4 DATE 31 DEC 1900
4 TEXT Some number of children source text.
3 QUAY 3
3 NOTE Am number of children source note.
Gedcom5-conversion discards the TEXT and NOTE tags, and the remaining data are the same for all of the citations, but gedcom5-conversion creates a separate instance of
```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#" xmlns:ns4="http://purl.org/dc/terms/" xmlns:gx="http://gedcomx.org/" xmlns:gxc="http://gedcomx.org/conclusion/v1/" rdf:ID="SOURCE1-1">
<ns4:partOf>
<rdf:value>descriptions/SOURCE1</rdf:value>
</ns4:partOf>
<ns4:description>
<rdf:value>42</rdf:value>
</ns4:description>
</rdf:Description>
for each one. This is a colossal waste of space. While the torture test is an extreme case, it is not at all uncommon with real data to need to reuse a citation for several events.
The initial implementation of the"X-DC-creator" attribute was implemented as a per-entry attribute with a boolean value. Instead, it should be a main attribute and should be a URI that references the contributor (e.g., "contributors/SUBM1").
It would be nice to have a command-line option(s) to set the default log level. For example, perhaps "-q" could induce a "quiet" mode where only errors are emitted.
root@CISSASGOT-PC:/mnt/c/WWW/gedcom5-conversion/tmp# java -jar gedcom-converter.jar -i my.ged -o my.gedx
Exception in thread "main" java.lang.NullPointerException
at org.gedcomx.conversion.gedcom.dq55.SubmitterMapper.toContributor(SubmitterMapper.java:34)
at org.gedcomx.conversion.gedcom.dq55.GedcomMapper.toGedcomx(GedcomMapper.java:42)
at org.gedcomx.conversion.gedcom.dq55.GedcomMapper.toGedcomx(GedcomMapper.java:33)
at org.gedcomx.tools.Gedcom2Gedcomx.convert55File(Gedcom2Gedcomx.java:202)
at org.gedcomx.tools.Gedcom2Gedcomx.doMain(Gedcom2Gedcomx.java:156)
at org.gedcomx.tools.Gedcom2Gedcomx.main(Gedcom2Gedcomx.java:222)
root@CISSASGOT-PC:/mnt/c/WWW/gedcom5-conversion/tmp#
Following the instructions in README.md, I got an error:
C:\temp>java -jar gedcom5-conversion-0.2.0-SNAPSHOT.jar no main manifest attribute, in gedcom5-conversion-0.2.0-SNAPSHOT.jar
Digging into the problem, I found using the gedcom5-conversion-0.2.0-SNAPSHOT-full.jar
alternative snapshot to work correctly. I presume this includes necessary libraries?
The README.md instructions should be amended to suggest this and make clear the difference.
I tried to build the converter and since neither I nor Maven could find org.folg.gedcom, I compiled FamilySearch/Gedcom myself and used the snippet
<dependency>
<groupId>org.folg.gedcom</groupId>
<artifactId>gedcom</artifactId>
<version>${gedcom.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/gedcom-1.2-SNAPSHOT.jar</systemPath>
</dependency>
But now I get the failing tests below. Am I using the wrong artifact? And which version is correct? The assumptions in the test cases or the parsed version?
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@6f75e721
Tests run: 54, Failures: 6, Errors: 0, Skipped: 0, Time elapsed: 8.625 sec <<< FAILURE!
testToOrganization1(org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest) Time elapsed: 0.055 sec <<< FAILURE!
java.lang.AssertionError: Unexpected phone: data:/,Phone%3A%20866-000-0000
at org.testng.Assert.fail(Assert.java:89)
at org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest.testToOrganization1(SourceDescriptionMapperOrganizationTest.java:98)
testToOrganization3(org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest) Time elapsed: 0.005 sec <<< FAILURE!
java.lang.AssertionError: Unexpected phone: data:/,Phone%3A%20(731)%20642-8655,%20Extension%20%23109
at org.testng.Assert.fail(Assert.java:89)
at org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest.testToOrganization3(SourceDescriptionMapperOrganizationTest.java:196)
testToOrganization4(org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest) Time elapsed: 0.005 sec <<< FAILURE!
java.lang.AssertionError: Unexpected phone: data:/,Fax%3A%20479-444-1777
at org.testng.Assert.fail(Assert.java:89)
at org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest.testToOrganization4(SourceDescriptionMapperOrganizationTest.java:258)
testToOrganization5(org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest) Time elapsed: 0.003 sec <<< FAILURE!
java.lang.AssertionError: expected:<tel:+1%20573.204-2331> but was:<tel:/+1%20573.204-2331>
at org.testng.Assert.fail(Assert.java:89)
at org.testng.Assert.failNotEquals(Assert.java:489)
at org.testng.Assert.assertEquals(Assert.java:118)
at org.testng.Assert.assertEquals(Assert.java:171)
at org.testng.Assert.assertEquals(Assert.java:181)
at org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest.testToOrganization5(SourceDescriptionMapperOrganizationTest.java:298)
testToOrganization7(org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest) Time elapsed: 0.003 sec <<< FAILURE!
java.lang.AssertionError: Unexpected phone: data:/,Phone%3A%20801-533-3535%20%3C%3E
at org.testng.Assert.fail(Assert.java:89)
at org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest.testToOrganization7(SourceDescriptionMapperOrganizationTest.java:389)
testToContributor1(org.gedcomx.conversion.gedcom.dq55.SubmitterMapperTest) Time elapsed: 0.007 sec <<< FAILURE!
java.lang.AssertionError: expected:<[data:,Phone%3A%20935-555-1212, data:,Fax%3A%20935-555-0101]> but was:<[data:/,Phone%3A%20935-555-1212, data:/,Fax%3A%20935-555-0101]>
at org.testng.Assert.fail(Assert.java:89)
at org.testng.Assert.failNotEquals(Assert.java:489)
at org.testng.Assert.assertEquals(Assert.java:118)
at org.testng.Assert.assertEquals(Assert.java:171)
at org.testng.Assert.assertEquals(Assert.java:181)
at org.gedcomx.conversion.gedcom.dq55.SubmitterMapperTest.testToContributor1(SubmitterMapperTest.java:69)
Results :
Failed tests: testToOrganization1(org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest): Unexpected phone: data:/,Phone%3A%20866-000-0000
testToOrganization3(org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest): Unexpected phone: data:/,Phone%3A%20(731)%20642-8655,%20Extension%20%23109
testToOrganization4(org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest): Unexpected phone: data:/,Fax%3A%20479-444-1777
testToOrganization5(org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest): expected:<tel:+1%20573.204-2331> but was:<tel:/+1%20573.204-2331>
testToOrganization7(org.gedcomx.conversion.gedcom.dq55.SourceDescriptionMapperOrganizationTest): Unexpected phone: data:/,Phone%3A%20801-533-3535%20%3C%3E
testToContributor1(org.gedcomx.conversion.gedcom.dq55.SubmitterMapperTest): expected:<[data:,Phone%3A%20935-555-1212, data:,Fax%3A%20935-555-0101]> but was:<[data:/,Phone%3A%20935-555-1212, data:/,Fax%3A%20935-555-0101]>
Tests run: 54, Failures: 6, Errors: 0, Skipped: 0
Hey there, not sure what's the issue on my side, but getting this exception when trying to convert .ged to .gedx. I'm using the torture test files, in this case TGC551.ged.
❯ java -jar gedcom5-conversion-1.12.0-full.jar -i ./TestGED/TGC551.ged -o ./test.gedx
Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/DataSource
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.<clinit>(RuntimeBuiltinLeafInfoImpl.java:464)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:64)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:133)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:85)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:162)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:93)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:455)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:303)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:142)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1174)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:162)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:262)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:249)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:442)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:652)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:599)
at org.gedcomx.fileformat.DefaultXMLSerialization.newContext(DefaultXMLSerialization.java:116)
at org.gedcomx.fileformat.DefaultXMLSerialization.<init>(DefaultXMLSerialization.java:49)
at org.gedcomx.fileformat.DefaultXMLSerialization.<init>(DefaultXMLSerialization.java:44)
at org.gedcomx.tools.Gedcom2Gedcomx.convert55File(Gedcom2Gedcomx.java:224)
at org.gedcomx.tools.Gedcom2Gedcomx.doMain(Gedcom2Gedcomx.java:177)
at org.gedcomx.tools.Gedcom2Gedcomx.main(Gedcom2Gedcomx.java:248)
Caused by: java.lang.ClassNotFoundException: javax.activation.DataSource
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 26 more
My Java version:
java -version
openjdk version "13.0.1" 2019-10-15
OpenJDK Runtime Environment (build 13.0.1+9)
OpenJDK 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
The same error happens also with OpenJDK 15
java -version
openjdk version "15" 2020-09-15
OpenJDK Runtime Environment AdoptOpenJDK (build 15+36)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15+36, mixed mode, sharing
> java -jar gedcom5-conversion-1.12.0-full.jar -i ./TestGED/TGC551.ged -o ./TestGED/TGC551.gedx
Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/DataSource
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.<clinit>(RuntimeBuiltinLeafInfoImpl.java:464)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:64)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:133)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:85)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:162)
>java -jar target/gedcom5-conversion-1.14.0-SNAPSHOT-full.jar -i "C:\temp\xxxx.ged" -o c:/temp/my.gedx
C:\Temp>java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment Microsoft-25199 (build 11.0.12+7)
OpenJDK 64-Bit Server VM Microsoft-25199 (build 11.0.12+7, mixed mode)
Exception in thread "main" java.lang.NoSuchMethodError: 'void com.fasterxml.jackson.core.JsonGenerator.writeStartObject(java.lang.Object)'
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:162)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:2795)
at org.gedcomx.fileformat.JacksonJsonSerialization.serialize(JacksonJsonSerialization.java:64)
at org.gedcomx.fileformat.GedcomxOutputStream.addResource(GedcomxOutputStream.java:135)
at org.gedcomx.fileformat.GedcomxOutputStream.addResource(GedcomxOutputStream.java:106)
at org.gedcomx.tools.Gedcom2Gedcomx.convert55File(Gedcom2Gedcomx.java:205)
at org.gedcomx.tools.Gedcom2Gedcomx.doMain(Gedcom2Gedcomx.java:157)
at org.gedcomx.tools.Gedcom2Gedcomx.main(Gedcom2Gedcomx.java:215)
I updated to pom to use
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-smile</artifactId>
<version>2.10.2</version>
It worked..
As I understand the documentation, this is the only way to convert a GEDCOM file into GEDCOM-X structure. If I am missing something please let me know how to convert my GEDCOM into GEDCOM-X structure.
If this is the only method then please update this POM / Libraries / Source to work with versions of Java beyond 1.6.
Thanks. Andy Askey
It would be nice if users didn't have to run a command-line utility to use this.
Even better? Maybe a Java Web Start entry point.
I ran the GeditCom GEDCOM Torture Test file through gedcom5-conversion and got 314 errors from a 2161-line (pretty small!) Gedcom5 file.
In addition to the unsupported tags described in the README, I found the following weren't processed:
*::ADDR
NAME::SPFX
DEAT::CAUSE
*::TYPE (Silent: No warning emitted except for TITL::TYPE and REFN::TYPE but REFN is documented as unsupported )
INDI::FAMC
PLAC::FORM
*::AGNC
SUBM
ANCI
DESI
The TYPE lines were the only silent ones I detected, but the comparison was done by eye, and only checked PERSON1 (which has one of every event type on it).
The Gedcom5-converter takes a Gedcom5 Date tag
2 DATE 31 DEC 1965
and produces a date structure having only a gxc:original string element
<gxc:date>
<gxc:original>31 DEC 1965</gxc:original>
</gxc:date>
The GedcomX conceptual model, paragraph 5.2, specifies both an original string value and a parsed FormalValue, and includes the Gedcom 5.5 date format as "recognized". Gedcom5-converter should parse the Gedcom 5.5 date string and create the FormalValue element.
I cloned a new copy, then ran mvn install which fails as follows:
C:\Code\genealogy\gedcom5-conversion>mvn install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.gedcomx:gedcom5-conversion:jar:1.0.1.M1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 66, column 15
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 75, column 15
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ line 92, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building gedcom5-conversion 1.0.1.M1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.gedcomx:gedcomx-fileformat:jar:1.0.0.M1 is missing, no dependency information available
[WARNING] The POM for org.folg.gedcom:gedcom:jar:1.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.474s
[INFO] Finished at: Thu May 12 17:04:40 BST 2016
[INFO] Final Memory: 5M/415M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project gedcom5-conversion: Could not resolve dependencies for project org.gedcomx:gedcom5-conversion:jar:1.0.1.M1-SNAPSHOT: T
he following artifacts could not be resolved: org.gedcomx:gedcomx-fileformat:jar:1.0.0.M1, org.folg.gedcom:gedcom:jar:1.1: Failure to find org.gedcomx:gedcomx-f
ileformat:jar:1.0.0.M1 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval o
f central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
I tested the conversion tool by using the torture test files (http://www.geditcom.com/gedcom.html) and found that the file links are not parsed correctly. The file entries are simply missing.
It would be a good enhancement to not only read the entries correctly, but also add the linked resources to the archive.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.