Difference between revisions of "Gramps XML"
m (→Gramps XML Resources) |
(→See also) |
||
(107 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
− | {{languages| | + | {{languages|Gramps XML}} |
− | ''' | + | '''Gramps XML''' is the '''Extensible Markup Language ''' ([http://en.wikipedia.org/wiki/XML XML]) format designed for storing Gramps data. The goal is to have a fully portable, human- and machine-readable XML format so that the data can be read and written without any loss. In addition, XML format allows for smaller files (if '''compressed''') and for using the version control system for tracking the changes (if '''uncompressed'''). |
− | The reason XML is not used by | + | The reason XML is not used by Gramps as the working database ("internal") format is performance, specifically memory considerations. |
==Gramps XML Resources== | ==Gramps XML Resources== | ||
− | Starting with XML 1.0 | + | {{man note|Starting with Gramps XML 1.0|Each revision of Gramps XML has its own resource page, with references to that version's [https://en.wikipedia.org/wiki/Document_type_definition DTD] and [https://en.wikipedia.org/wiki/RELAX_NG RELAX NG] schema.<br />The resource pages are listed at [https://www.gramps-project.org/xml/ https://www.gramps-project.org/xml/].}} |
− | + | {| class="wikitable sortable" | |
+ | !Gramps release | ||
+ | !XML schema | ||
+ | !Imports XML schema | ||
+ | !Database schema | ||
+ | !Imports database schema | ||
+ | !Example | ||
+ | !Changes/Note | ||
+ | |- | ||
+ | | master | ||
+ | | no change against 5.2 yet | ||
+ | | >= 1.0.0 - best 1.7 | ||
+ | | 20 | ||
+ | | 13-20 | ||
+ | | Unreleased <br />[{{Code Browser}}/tree/master/example/gramps/example.gramps example.gramps] | ||
+ | | Unreleased | ||
+ | |} | ||
− | For versions of Gramps earlier than 3.1.1 refer to the table to decide which version to use to import a specific version of the | + | {{man note|Note|Commencing with Gramps 3.1.2 all official versions of Gramps XML files can be imported. However, a warning will be given on import of 1.0.0 XML.[http://sourceforge.net/p/gramps/mailman/message/23262334/]<br /><br />'''Note:''' For versions of Gramps earlier than 3.1.1 refer to and the consult the table below to decide which version to use to import a specific version of the XML.}} |
− | {| | + | {| class="wikitable sortable" |
!Gramps release | !Gramps release | ||
− | !XML | + | !XML schema |
− | !Imports XML | + | !Imports XML schema |
+ | !Database schema | ||
+ | !Imports database schema | ||
!Example | !Example | ||
+ | !Changes/Note | ||
+ | |- | ||
+ | | 5.2.x | ||
+ | | 1.7.0 - 1.7.1 | ||
+ | | >= 1.0.0 - 1.7 | ||
+ | | 20 | ||
+ | | 13-20 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps52/example/gramps/example.gramps] | ||
+ | | | ||
+ | * DB-API (SQLite) is default backend | ||
+ | * BSDDB only for conversions to SQLite | ||
+ | |- | ||
+ | | 5.1.x | ||
+ | | 1.7.0 - 1.7.1 | ||
+ | | >= 1.0.0 - 1.7 | ||
+ | | 19 | ||
+ | | 13-19 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps51/example/gramps/example.gramps] | ||
+ | | | ||
+ | * DB-API (SQLite) is default backend | ||
+ | * BSDDB is Legacy backend | ||
+ | |- | ||
+ | | 5.0.x | ||
+ | | 1.7.0 - 1.7.1 | ||
+ | | >= 1.0.0 - 1.7 | ||
+ | | 19 | ||
+ | | 13-19 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps50/example/gramps/example.gramps] | ||
+ | | | ||
+ | * Database backends become plugins | ||
+ | * BSDDB is default, convert default handle (metadata) to str | ||
+ | * DB-API (SQLite) is tested as viable replacement | ||
+ | |- | ||
+ | | 4.2.x | ||
+ | | 1.7.0 - 1.7.1 | ||
+ | | >= 1.0.0 - 1.7 | ||
+ | | 18 | ||
+ | | 13-18 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps42/example/gramps/example.gramps] | ||
+ | | | ||
+ | * Added PlaceNames (with Date and Language) Place | ||
+ | |- | ||
+ | | 4.1.x | ||
+ | | 1.6.0 | ||
+ | | >= 1.0.0 - best 1.5.1 | ||
+ | | 17 | ||
+ | | 13-17 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps41/example/gramps/example.gramps] | ||
+ | | | ||
+ | * added Tags to Event, Place, Repository, Source, and Citation | ||
+ | * Source/Citation.data became SourceAttributes | ||
+ | * added optional support for checksum on Media object | ||
+ | * added PlaceRef and Place Hierarchies | ||
+ | |- | ||
+ | |4.0.x | ||
+ | |1.5.0 - 1.5.1 | ||
+ | | >= 1.0.0 - best 1.4.0 | ||
+ | |16 | ||
+ | |13-16 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps40/example/gramps/example.gramps] | ||
+ | | - | ||
|- | |- | ||
− | |3.3.x | + | |3.4.x |
+ | |1.5.0 - 1.5.1 | ||
+ | | >= 1.0.0 - best 1.4.0 | ||
+ | |16 | ||
+ | |13-16 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps34/example/gramps/example.gramps] | ||
+ | | | ||
+ | * Citations support | ||
+ | * Gramps XML is now idempotent[http://en.wikipedia.org/wiki/Idempotence].{{bug|4365}} | ||
+ | * Exporter does not change records order any more, making it easier to look at differences between versions/revisions. | ||
+ | |- | ||
+ | |3.3.x | ||
|1.4.0 | |1.4.0 | ||
| >= 1.0.0 - best 1.3.0 | | >= 1.0.0 - best 1.3.0 | ||
− | | | + | |15 |
− | |- | + | |13-15 (3.3.1) |
+ | |[{{Code Browser}}/tree/maintenance/gramps33/example/gramps/example.gramps] | ||
+ | | | ||
+ | * Added new field "locality" to the Place schema | ||
+ | * Added surnames to the Name schema (surnames is a list of surnames / prefix and patronymic are moved to the surname) | ||
+ | * Replaced Markers with Tags ( marker removed from all / tags added to Person, Media, Family, and Notes) | ||
+ | * Transaction | ||
+ | * Merging | ||
+ | * Improvements on Import/Export file formats (vcard, gedcom, xml) | ||
+ | * [[Gramps_3.3_Wiki_Manual_-_What%27s_new%3F#Database Changes]] | ||
|- | |- | ||
|3.1.x | |3.1.x | ||
|1.3.0 | |1.3.0 | ||
| >= 1.0.0 - best 1.1.0 | | >= 1.0.0 - best 1.1.0 | ||
− | |[ | + | |14 |
+ | |13-14 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps31/example/gramps/example.gramps] | ||
+ | | | ||
+ | * Added lat/long to places | ||
|- | |- | ||
|3.0.x | |3.0.x | ||
|1.2.0 | |1.2.0 | ||
| >= 1.1.0 | | >= 1.1.0 | ||
− | |[ | + | |13-14 (depends on version) |
+ | | [https://gramps.discourse.group/t/import-convert-old-database/3768/ 9-14 (3.0.4)] | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps30/example/gramps/example.gramps] | ||
+ | | | ||
+ | * added newyear to Dates | ||
+ | * Replace plain text with StyledText in Notes | ||
|- | |- | ||
|2.2.x | |2.2.x | ||
|1.1.0-1.1.4 | |1.1.0-1.1.4 | ||
| >= 0.0.0 | | >= 0.0.0 | ||
− | |[ | + | |9-12 (depends on version) |
+ | |5-12 (2.2.10) | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps22/example/gramps/data.gramps] | ||
+ | | | ||
+ | |- | ||
+ | | 2.0.6-10 | ||
+ | | 1.0.0 | ||
+ | | >= 0.0.0 | ||
+ | | 8 | ||
+ | | 1-8 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps22/example/gramps/data.gramps] | ||
+ | | | ||
+ | |- | ||
+ | | 2.0.5 | ||
+ | | 1.0.0 | ||
+ | | >= 0.0.0 | ||
+ | | 7 | ||
+ | | 1-7 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps22/example/gramps/data.gramps] | ||
+ | | | ||
|- | |- | ||
− | |2.0. | + | | 2.0.1-4 |
− | |1.0.0 | + | | 1.0.0 |
| >= 0.0.0 | | >= 0.0.0 | ||
− | |[ | + | | 6 |
+ | | 1-6 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps22/example/gramps/data.gramps] | ||
+ | | | ||
+ | |- | ||
+ | | 2.0.0 | ||
+ | | 1.0.0 | ||
+ | | >= 0.0.0 | ||
+ | | 5 | ||
+ | | 1-5 | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps20/gramps2/example/gramps/data.gramps] | ||
+ | | * changed name formats | ||
|- | |- | ||
|1.0.x | |1.0.x | ||
|no official version (0.0.0) | |no official version (0.0.0) | ||
| - | | - | ||
− | |[ | + | | |
+ | | | ||
+ | |[{{Code Browser}}/tree/maintenance/gramps10/example/gramps/data.gramps] | ||
+ | |(Install [https://github.com/gramps-project/gramps/releases/tag/v2.2.10 Gramps 2.2.10] to import and convert old beta Gramps XML backups - see [[Gramps_Old_database]] & issue {{bug|6129}}) | ||
|- | |- | ||
|0.0.x | |0.0.x | ||
Line 52: | Line 193: | ||
| Unsupported | | Unsupported | ||
| Unsupported | | Unsupported | ||
+ | | | ||
+ | | Unsupported | ||
+ | | | ||
|} | |} | ||
+ | |||
+ | {{man note|Note:|To convert an old Gramps XML file you could use VirtualBox or Vmware and the old lgenealogy images from:<br><code>http://ftp.gwdg.de/pub/linux/gramps/</code>}} | ||
+ | |||
===DTD generation=== | ===DTD generation=== | ||
Tool like [http://xml2dtd.sourceforge.net/ xml2dtd] could help people not familiar with DTD grammar by generating a DTD file from a XML file. New content on Gramps XML could be tested with the tool and be merged on current Gramps DTD. | Tool like [http://xml2dtd.sourceforge.net/ xml2dtd] could help people not familiar with DTD grammar by generating a DTD file from a XML file. New content on Gramps XML could be tested with the tool and be merged on current Gramps DTD. | ||
+ | |||
===RELAX NG generation=== | ===RELAX NG generation=== | ||
Tools like [http://code.google.com/p/jing-trang/ trang] or [http://people.apache.org/~andyc/neko/doc/dtd/index.html NekoDTD] could help to convert a Gramps DTD file to a RELAX NG file. | Tools like [http://code.google.com/p/jing-trang/ trang] or [http://people.apache.org/~andyc/neko/doc/dtd/index.html NekoDTD] could help to convert a Gramps DTD file to a RELAX NG file. | ||
− | Some others tools and up-to-date informations | + | Some others tools and up-to-date informations are listed on this [http://www.relaxng.org/ page]. |
==Validating Gramps XML file== | ==Validating Gramps XML file== | ||
Line 64: | Line 212: | ||
xmllint --noout filename.gramps | xmllint --noout filename.gramps | ||
− | If the Gramps XML file does not validate | + | {{man warn|If the Gramps XML file does not validate|this indicates an error in either the DTD or the XML Writer.<br>'''Please file the bug report at https://gramps-project.org/bugs/ in that case.'''}} |
==Parsing Gramps XML file== | ==Parsing Gramps XML file== | ||
− | * [[Xsl|XSLT]] scripts: [http://www.gramps-project.org/grampsExhibit/0.0. | + | * [[Xsl|XSLT]] scripts: [http://www.gramps-project.org/grampsExhibit/0.0.2/grampsexhibit.xsl gramps exhibit] (Michiel Nauta), [[media:Ancestors.xsl.gz|Ancestors.xsl]], [[media:Birthday.xsl.gz|Birthday.xsl]] (Gramps 1.x), [[media:Tellico.tar.gz|Tellico scripts]], [[Addon:Lxml Gramplet|lxml gramplet]], [http://sourceforge.net/mailarchive/message.php?msg_id=28108782 Print Notes], etc ... see [[media:Xpaths.gz|XPaths]]. |
− | * A [http:// | + | * A [http://svn.code.sf.net/p/gramps-addons/code/trunk/contrib/DescendantsLines/ft.py sample of standalone script] (Adam Sampson) which parses a Gramps XML file for drawing a family tree. |
− | * [ | + | * [[Other_genealogy_tools#Gramps-php-exporter|Gramps-php-exporter]] |
* A [http://sourceforge.net/projects/joomlagen/ Joomla! component/module] for uploading the Gramps XML database and for showing genealogical information and overviews. | * A [http://sourceforge.net/projects/joomlagen/ Joomla! component/module] for uploading the Gramps XML database and for showing genealogical information and overviews. | ||
− | * [http://www.phpgedview.net PhpGedView] supports output to Gramps XML file | + | * [http://www.phpgedview.net PhpGedView] supports [http://phpgedview.svn.sourceforge.net/viewvc/phpgedview/trunk/phpGedView/includes/classes/class_grampsexport.php simple output to Gramps XML file format] for the Clippings Cart and has an option to download entire Gedcom in Gramps XML form as well as being able to retrieve raw data from the SOAP web service in Gramps XML format. Still a [http://sourceforge.net/projects/phpgedview/forums/forum/185166/topic/5177979 partial support on version 4.3.0]. |
− | * [http:// | + | * [http://wikipedia.org/wiki/Greasemonkey Greasemonkey] scripts (Michiel Nauta) |
− | * ... | + | * GrampsXMLview was a number of PHP scripts in combination with a Gramps XML database (Sjoerd van Staveren). [https://web.archive.org/web/20120220103003/http://www.gramps.van-staveren.net/ 2012 www.gramps.van-staveren.net Internet Archive] |
+ | * [https://github.com/claws/gramps2gource gramps2gource] for blurring the line between Genealogy and Software Configuration Management visualisation. | ||
+ | * [https://betty.readthedocs.io/latest/index.html Betty] generates a ready-to-publish static website from Gramps XML genealogy archives | ||
==See also== | ==See also== | ||
+ | * [https://gramps.discourse.group/t/auxiliary-xml-format-documentation/2800 Auxiliary XML files in Gramps]: | ||
+ | :.gramps/: | ||
+ | :* report_options.xml - report settings: | ||
+ | :* books.xml - Books | ||
+ | :* tool_options.xml | ||
+ | :* [[Calendar_tools_holidays#format_of_holidays.xml|holidays.xml]] - holiday sets or country calendars | ||
+ | :* recent-files-gramps.xml - | ||
+ | :* fan_chart.xml | ||
+ | :* place_formats.xml | ||
+ | :.gramps//gramps52/ | ||
+ | :* custom_filters.xml - filters | ||
* [[Generate XML]] | * [[Generate XML]] | ||
+ | * Tutorial: [[Customize_reports_with_XML_tool|Customize reports with XML tool]] | ||
* [[GEDCOM]] | * [[GEDCOM]] | ||
+ | * [[Gramps and GEDCOM]] | ||
+ | * [[Database_Formats]] | ||
+ | * wiki "Just Solve the File Format Problem" - [http://fileformats.archiveteam.org/wiki/Genealogical_data Genealogical data] file formats | ||
+ | * [[Gramps Old database]] | ||
+ | * [[Previous releases of Gramps]] | ||
[[Category:Developers/Reference]] | [[Category:Developers/Reference]] | ||
[[Category:Developers/General]] | [[Category:Developers/General]] |
Latest revision as of 04:14, 13 March 2024
Gramps XML is the Extensible Markup Language (XML) format designed for storing Gramps data. The goal is to have a fully portable, human- and machine-readable XML format so that the data can be read and written without any loss. In addition, XML format allows for smaller files (if compressed) and for using the version control system for tracking the changes (if uncompressed).
The reason XML is not used by Gramps as the working database ("internal") format is performance, specifically memory considerations.
Contents
Gramps XML Resources
Starting with Gramps XML 1.0 Each revision of Gramps XML has its own resource page, with references to that version's DTD and RELAX NG schema. |
Gramps release | XML schema | Imports XML schema | Database schema | Imports database schema | Example | Changes/Note |
---|---|---|---|---|---|---|
master | no change against 5.2 yet | >= 1.0.0 - best 1.7 | 20 | 13-20 | Unreleased example.gramps |
Unreleased |
Note Commencing with Gramps 3.1.2 all official versions of Gramps XML files can be imported. However, a warning will be given on import of 1.0.0 XML.[1] |
Gramps release | XML schema | Imports XML schema | Database schema | Imports database schema | Example | Changes/Note |
---|---|---|---|---|---|---|
5.2.x | 1.7.0 - 1.7.1 | >= 1.0.0 - 1.7 | 20 | 13-20 | [2] |
|
5.1.x | 1.7.0 - 1.7.1 | >= 1.0.0 - 1.7 | 19 | 13-19 | [3] |
|
5.0.x | 1.7.0 - 1.7.1 | >= 1.0.0 - 1.7 | 19 | 13-19 | [4] |
|
4.2.x | 1.7.0 - 1.7.1 | >= 1.0.0 - 1.7 | 18 | 13-18 | [5] |
|
4.1.x | 1.6.0 | >= 1.0.0 - best 1.5.1 | 17 | 13-17 | [6] |
|
4.0.x | 1.5.0 - 1.5.1 | >= 1.0.0 - best 1.4.0 | 16 | 13-16 | [7] | - |
3.4.x | 1.5.0 - 1.5.1 | >= 1.0.0 - best 1.4.0 | 16 | 13-16 | [8] | |
3.3.x | 1.4.0 | >= 1.0.0 - best 1.3.0 | 15 | 13-15 (3.3.1) | [10] |
|
3.1.x | 1.3.0 | >= 1.0.0 - best 1.1.0 | 14 | 13-14 | [11] |
|
3.0.x | 1.2.0 | >= 1.1.0 | 13-14 (depends on version) | 9-14 (3.0.4) | [12] |
|
2.2.x | 1.1.0-1.1.4 | >= 0.0.0 | 9-12 (depends on version) | 5-12 (2.2.10) | [13] | |
2.0.6-10 | 1.0.0 | >= 0.0.0 | 8 | 1-8 | [14] | |
2.0.5 | 1.0.0 | >= 0.0.0 | 7 | 1-7 | [15] | |
2.0.1-4 | 1.0.0 | >= 0.0.0 | 6 | 1-6 | [16] | |
2.0.0 | 1.0.0 | >= 0.0.0 | 5 | 1-5 | [17] | * changed name formats |
1.0.x | no official version (0.0.0) | - | [18] | (Install Gramps 2.2.10 to import and convert old beta Gramps XML backups - see Gramps_Old_database & issue 6129) | ||
0.0.x | beta software (0.0.0) | Unsupported | Unsupported | Unsupported |
Note: To convert an old Gramps XML file you could use VirtualBox or Vmware and the old lgenealogy images from: |
DTD generation
Tool like xml2dtd could help people not familiar with DTD grammar by generating a DTD file from a XML file. New content on Gramps XML could be tested with the tool and be merged on current Gramps DTD.
RELAX NG generation
Tools like trang or NekoDTD could help to convert a Gramps DTD file to a RELAX NG file. Some others tools and up-to-date informations are listed on this page.
Validating Gramps XML file
To validate the Gramps XML file against its DTD, use xmllint program (comes with the libxml2-utils package):
xmllint --noout filename.gramps
If the Gramps XML file does not validate this indicates an error in either the DTD or the XML Writer. |
Parsing Gramps XML file
- XSLT scripts: gramps exhibit (Michiel Nauta), Ancestors.xsl, Birthday.xsl (Gramps 1.x), Tellico scripts, lxml gramplet, Print Notes, etc ... see XPaths.
- A sample of standalone script (Adam Sampson) which parses a Gramps XML file for drawing a family tree.
- Gramps-php-exporter
- A Joomla! component/module for uploading the Gramps XML database and for showing genealogical information and overviews.
- PhpGedView supports simple output to Gramps XML file format for the Clippings Cart and has an option to download entire Gedcom in Gramps XML form as well as being able to retrieve raw data from the SOAP web service in Gramps XML format. Still a partial support on version 4.3.0.
- Greasemonkey scripts (Michiel Nauta)
- GrampsXMLview was a number of PHP scripts in combination with a Gramps XML database (Sjoerd van Staveren). 2012 www.gramps.van-staveren.net Internet Archive
- gramps2gource for blurring the line between Genealogy and Software Configuration Management visualisation.
- Betty generates a ready-to-publish static website from Gramps XML genealogy archives
See also
- .gramps/:
- report_options.xml - report settings:
- books.xml - Books
- tool_options.xml
- holidays.xml - holiday sets or country calendars
- recent-files-gramps.xml -
- fan_chart.xml
- place_formats.xml
- .gramps//gramps52/
- custom_filters.xml - filters
- Generate XML
- Tutorial: Customize reports with XML tool
- GEDCOM
- Gramps and GEDCOM
- Database_Formats
- wiki "Just Solve the File Format Problem" - Genealogical data file formats
- Gramps Old database
- Previous releases of Gramps