Difference between revisions of "Gramps XML"

From Gramps
Jump to: navigation, search
m (See also: Gramps)
(Parsing Gramps XML file)
(23 intermediate revisions by 3 users not shown)
Line 11: Line 11:
 
!XML version  
 
!XML version  
 
!Imports XML version
 
!Imports XML version
 +
!Database
 
!Example
 
!Example
 
!Changes/Note
 
!Changes/Note
 
|-
 
|-
| Trunk
+
| trunk/master/unstable
| Unreleased ''1.6''<br />[http://svn.code.sf.net/p/gramps/code/trunk/data/grampsxml.dtd grampsxml.dtd]
+
| no change against 4.1 yet
| Unreleased <br />''>= 1.0.0 - best 1.5.0''
+
| >= 1.0.0 - best 1.5.1
| Unreleased <br />[http://svn.code.sf.net/p/gramps/code/trunk/example/gramps/example.gramps example.gramps]
+
| 17
 +
| Unreleased <br />[{{Code Browser}}ci/master/tree/example/gramps/example.gramps example.gramps]
 
| Unreleased  
 
| Unreleased  
 
|}
 
|}
Line 29: Line 31:
 
!XML version  
 
!XML version  
 
!Imports XML version
 
!Imports XML version
 +
!Database
 
!Example
 
!Example
 
!Changes/Note
 
!Changes/Note
 +
|-
 +
| 4.1.x
 +
| 1.6.0
 +
| >= 1.0.0 - best 1.5.1
 +
| 17
 +
|[{{Code Browser}}ci/maintenance/gramps41/~/tree/example/gramps/example.gramps]
 +
|added Tags to Event, Place, Repository, Source, and Citation<br />
 +
Source/Citation.data became SourceAttributes<br />
 +
added optional support for checksum on Media object<br />
 +
added PlaceRef and Place Hierarchies<br />
 +
|-
 +
|4.0.x
 +
|1.5.0 - 1.5.1
 +
| >= 1.0.0 - best 1.4.0
 +
|16
 +
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps40/example/gramps/example.gramps]
 +
| -
 
|-
 
|-
 
|3.4.x
 
|3.4.x
|1.5.0
+
|1.5.0 - 1.5.1
 
| >= 1.0.0 - best 1.4.0
 
| >= 1.0.0 - best 1.4.0
 +
|16
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps34/example/gramps/example.gramps]
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps34/example/gramps/example.gramps]
 
|Citations support<br />
 
|Citations support<br />
Line 43: Line 64:
 
|1.4.0
 
|1.4.0
 
| >= 1.0.0 - best 1.3.0
 
| >= 1.0.0 - best 1.3.0
 +
|15
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps33/example/gramps/example.gramps]
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps33/example/gramps/example.gramps]
 
|[http://www.gramps-project.org/wiki/index.php?title=Gramps_3.3_Wiki_Manual_-_What%27s_new%3F#Database Changes]
 
|[http://www.gramps-project.org/wiki/index.php?title=Gramps_3.3_Wiki_Manual_-_What%27s_new%3F#Database Changes]
Line 49: Line 71:
 
|1.3.0
 
|1.3.0
 
| >= 1.0.0 - best 1.1.0
 
| >= 1.0.0 - best 1.1.0
 +
|15
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps31/example/gramps/example.gramps]
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps31/example/gramps/example.gramps]
 
|
 
|
Line 55: Line 78:
 
|1.2.0
 
|1.2.0
 
| >= 1.1.0
 
| >= 1.1.0
 +
|14
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps30/example/gramps/example.gramps]
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps30/example/gramps/example.gramps]
|
+
| added newyear to Dates<br />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
 +
|
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps22/example/gramps/data.gramps]
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps22/example/gramps/data.gramps]
 
|
 
|
Line 67: Line 92:
 
|1.0.0
 
|1.0.0
 
| >= 0.0.0
 
| >= 0.0.0
 +
|13
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps20/gramps2/example/gramps/data.gramps]
 
|[http://svn.code.sf.net/p/gramps/code/branches/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)
 
| -
 
| -
 +
|
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps10/example/gramps/data.gramps]
 
|[http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps10/example/gramps/data.gramps]
 
|
 
|
Line 78: Line 105:
 
|0.0.x
 
|0.0.x
 
|beta software (0.0.0)
 
|beta software (0.0.0)
 +
| Unsupported
 
| Unsupported
 
| Unsupported
 
| Unsupported
 
| Unsupported
Line 83: Line 111:
 
|}
 
|}
  
To convert an old Gramps XML file you could use VirtualBox or Vmware and the old lgenealogy images from:  
+
Note: To convert an old Gramps XML file you could use VirtualBox or Vmware and the old lgenealogy images from:  
 
  http://ftp.gwdg.de/pub/linux/gramps/
 
  http://ftp.gwdg.de/pub/linux/gramps/
  
Line 104: Line 132:
 
* [[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]], [[Lxml_Gramplet|lxml gramplet]], [http://sourceforge.net/mailarchive/message.php?msg_id=28108782 Print Notes], etc ... see [[media:Xpaths.gz|XPaths]].
 
* [[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]], [[Lxml_Gramplet|lxml gramplet]], [http://sourceforge.net/mailarchive/message.php?msg_id=28108782 Print Notes], etc ... see [[media:Xpaths.gz|XPaths]].
 
* 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.
 
* 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.
* [http://www.gramps.van-staveren.net/ GrampsXMLview] is a number of PHP scripts in combination with a Gramps XML database.
+
* [[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 [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://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://en.wikipedia.org/wiki/Greasemonkey Greasemonkey] scripts (Michiel Nauta)
 
* [http://en.wikipedia.org/wiki/Greasemonkey Greasemonkey] scripts (Michiel Nauta)
 +
* [http://www.gramps.van-staveren.net/ GrampsXMLview] is a number of PHP scripts in combination with a Gramps XML database.
 +
* [https://github.com/claws/gramps2gource gramps2gource] for blurring the line between Genealogy and Software Configuration Management visualisation.
 
* ...
 
* ...
  
Line 113: Line 143:
 
* [[Generate XML]]
 
* [[Generate XML]]
 
* [[GEDCOM]]
 
* [[GEDCOM]]
 +
* [[Gramps and GEDCOM]]
 
* [[Database_Formats]]
 
* [[Database_Formats]]
 
* [[Gramps Old database]]
 
* [[Gramps Old database]]

Revision as of 17:08, 17 August 2014

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.

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. The resource pages are listed at http://www.gramps-project.org/xml/.

Gramps release XML version Imports XML version Database Example Changes/Note
trunk/master/unstable no change against 4.1 yet >= 1.0.0 - best 1.5.1 17 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]

Note: 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 xml, consult the table below.

Gramps release XML version Imports XML version Database Example Changes/Note
4.1.x 1.6.0 >= 1.0.0 - best 1.5.1 17 [2] 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 [3] -
3.4.x 1.5.0 - 1.5.1 >= 1.0.0 - best 1.4.0 16 [4] Citations support

Gramps XML is now idempotent[5].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.0.0 - best 1.3.0 15 [6] Changes
3.1.x 1.3.0 >= 1.0.0 - best 1.1.0 15 [7]
3.0.x 1.2.0 >= 1.1.0 14 [8] added newyear to Dates
Replace plain text with StyledText in Notes
2.2.x 1.1.0-1.1.4 >= 0.0.0 [9]
2.0.x 1.0.0 >= 0.0.0 13 [10] changed name formats
1.0.x no official version (0.0.0) - [11]
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:

http://ftp.gwdg.de/pub/linux/gramps/

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 (2010-09-19) 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. Please file the bug report at http://bugs.gramps-project.org in that case.

Parsing Gramps XML file

See also