Difference between revisions of "Changes to Metadata"

From DrawShield Documentation
(Created page with "==Stages in Drawing Shields== In creating heraldic images DrawShield goes through several stages: # Parse the blazon to create an Abstract Syntax Tree (AST) # Draw an SVG representation of the blazon, based on the AST # (optionally) convert the SVG to a different image format The AST is an XML based data structure conforming to a custom schema called BlazonML. ==The MetaData== Metadata ("data about data") in DrawShield comes from several sources: * Debugging inform...")
 
m
Line 26: Line 26:
==Problems with the Original Approach==
==Problems with the Original Approach==


Although this approach did "work" it raised a number of issues:
* It increased the size of the SVG files, sometimes doubling the required amount of data
* Although programs like Inkscape did handle and pass through the blazonML data other programs may have had problems with this "non-standard" SVG content
* All types of metadata, whatever their purpose, were lumped together in the same place (see below)
* When the data *was* needed it was awkward to access, requiring browser developer tools or an XML aware editor
In reality, the metadata has several different functions and "belongs" in different places:
* The parsing errors belong in the AST, since this is a representation of the ''blazon'', so errors in blazon itself should be included in that representation. These also need to be made easily available to the user as errors.
* Artist Credits belong with (or ideally, inside) the ''image'' of the blazon, in whatever format the user requested
* Problems with drawing the image need to be easily available to the user as warnings.
* The debug information is mostly of interest to developers, although some of it can be useful for a more detailed textual analysis


[[Category:Discussion]]
[[Category:Discussion]]

Revision as of 19:04, 3 October 2023

Stages in Drawing Shields

In creating heraldic images DrawShield goes through several stages:

  1. Parse the blazon to create an Abstract Syntax Tree (AST)
  2. Draw an SVG representation of the blazon, based on the AST
  3. (optionally) convert the SVG to a different image format

The AST is an XML based data structure conforming to a custom schema called BlazonML.

The MetaData

Metadata ("data about data") in DrawShield comes from several sources:

  • Debugging information to aid in problem solving
  • Parsing errors (where the blazon is not understood, or has errors)
  • Drawing errors (if the program understands the blazon, but is unable to draw what is requested)
  • Artist credits to acknowledge the source of the images used in creating the final heraldic image

Original MetaData Handling

Originally, as the DrawShield program works through the various processing stages metadata is added to the AST, for example as <message> elements with an attribute to show the category of metadata.

As the AST is held in XML format we can include all of this in the same SVG that we create for the heraldic image, since that is also XML data (technically, the SVG <metadata> element can contain %ANY% other elements, so we just include the whole of the AST, including all of our own metadata)

Problems with the Original Approach

Although this approach did "work" it raised a number of issues:

  • It increased the size of the SVG files, sometimes doubling the required amount of data
  • Although programs like Inkscape did handle and pass through the blazonML data other programs may have had problems with this "non-standard" SVG content
  • All types of metadata, whatever their purpose, were lumped together in the same place (see below)
  • When the data *was* needed it was awkward to access, requiring browser developer tools or an XML aware editor

In reality, the metadata has several different functions and "belongs" in different places:

  • The parsing errors belong in the AST, since this is a representation of the blazon, so errors in blazon itself should be included in that representation. These also need to be made easily available to the user as errors.
  • Artist Credits belong with (or ideally, inside) the image of the blazon, in whatever format the user requested
  • Problems with drawing the image need to be easily available to the user as warnings.
  • The debug information is mostly of interest to developers, although some of it can be useful for a more detailed textual analysis