使用什么数据库结构来存储 GEDCOM 信息?

发布于 2024-09-19 08:11:08 字数 30 浏览 1 评论 0原文

使用什么数据库结构来存储 GEDCOM 信息?

What database structure to use to store GEDCOM information?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一曲琵琶半遮面シ 2024-09-26 08:11:08

如果您使用 GEDCOM 解析器将 GEDCOM 数据加载到程序中的数据结构中,则应该设计一个数据库结构,以便轻松地将内部数据表示映射到关系数据库表示。

例如,如果您使用 java,则可以使用 gedcom4j 将数据加载/写入 java 对象图,以便在需要导入/导出功能时使用。该数据在内部存储在 java 对象图中,然后可以使用 JPA 或 Hibernate 或 JDO 将其保存到您选择的数据库中......数据库方案与对象图匹配得越紧密,这将更容易,但您可以配置如果你想要一个不同的结构......只会使映射变得更加复杂。

当然,如果您只想将 GEDCOM 数据保存在数据库中而不解释它,那么将整个文件保存在一个大对象中的 bigtext 结构对我来说是有意义的......假设您有多个文件并且只想保留它作为内容。

If you are using a GEDCOM parser to load GEDCOM data into data structures in your program, you should design a database structure that easily maps your internal data representation to a relational database representation.

If you are using java, for example, you could use gedcom4j to load/write the data into a java object graph for when you need import/export capability. That data is stored in a java object graph internally, which can then be persisted using JPA or Hibernate or JDO to a database of your choice...which will be easier the more closely the database scheme matches the object graph, but you can configure that to a different structure if you want one...just makes the mapping a bit more complex.

Of course, if you just want to hold GEDCOM data in a database without interpreting it, a bigtext structure to hold the entire file in one large object makes the sort sense to me...assuming you have multiple files and just want to keep it as content.

北方。的韩爷 2024-09-26 08:11:08

将 GEDCOM 行单独存储在数据库中似乎毫无意义,您不会获得使用数据库的任何优势。 Māris 是正确的,但是 255 就足够了,因为根据 GEDCOM 规范,255 是线路长度的硬性限制。 (草案 5.5.1 规范第 11 页)。

正确的方法是使用现有的 GEDCOM 解析器(例如 gedcom.net)或创建您自己的解析器(这并不像许多示例那样简单),然后将其插入数据库中。查看 http://sqlitetoolsforrootsmagic4.wikispaces.com/,其中包含有关 RootsMagic 使用的架构的信息。

Storing the GEDCOM lines individual in a database seems kind of pointless you won't get any advantage of using a database. Māris is correct however that 255 would be enough as 255 is a hard limit on line length according to the GEDCOM specification. (page 11 of the draft 5.5.1 spec) .

The correct method would be to use an existing GEDCOM parser (such as gedcom.net) or create your own (which isn't as simple as many examples make out) that will then insert into a database. Take a look at http://sqlitetoolsforrootsmagic4.wikispaces.com/ which contains information on the schema used by RootsMagic.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文