Showing posts with label STEMMA. Show all posts
Showing posts with label STEMMA. Show all posts

Thursday, 17 December 2020

STEMMA Latest

 

If you are involved in the software representation of family history then you might justifiably ask what happened to STEMMA.


STEMMA is a private project to look at the digital representation of micro-history, including but not limited to family history. Work on it commenced in 2011, and the first specification appeared online in 2012. Primary goals were a distancing from the ubiquitous "build your family tree" notion of genealogy, avoidance of the use of trees as "wardrobes of hangers" upon which all and sundry can be placed, and a stemming the software trend of digesting everything to name-value pairs (usually described as "facts").

Its significance in relation to recent work by both FHISO and FamilySearch is low because it still treads a quite different path. It is not interested only in people, or in biological lineage, and its wider choice of historical subjects (including places, groups, and animals) has allowed software to leverage their similarities and orthogonality, such as hierarchical relationships and the handling of multiple names.

STEMMA does not use a database, which means that it is its own import/export format, and so is better-suited to long-term data storage because it does not require a separate backup format. More than this, though, a STEMMA file can be considered a "non-sequential document". Opening a STEMMA attachment will begin with a prescribed landing page, but the choice of where to navigate to from that page is a decision to be made by the reader. There is no sequential or hierarchical ordering of any pages, but there are many internal semantic links that can be followed based on some conscious rationale, and these might uncover lineage relationships (including trees), images, places, maps, or even narrative — all of which are integral parts of the data.

It is shocking that so few products accommodate narrative text, either for documenting the research process, authored works, story telling, memories, documenting biographical details, or for the transcription of old documents; and I do not know whether to laugh or cry when I hear software people still talking about programmatically generating text to lace together their recorded "facts". Software does not "understand" your research process, and should merely help you with its organisation and analysis. Human beings do not understand computer-speak and should not be presented with whatever it is that software people think is so convenient for their endeavours. Text is here to stay, and it should be an essential component of your data!

The latest public version of STEMMA is still V4.1, although a number of small changes in specification and direction have occurred internally. Little work has taken place on the informational sub-model that was to support a dynamic research process (see Our Days of Future Passed — Part I, and its follow-up parts II and III), but a spin-off of the associated experimentation was the SVG Family-Tree Generator (SVG-FTG) that is now a separate product, and soon to get a major upgrade. Work has focused, instead, on the conclusional sub-model, and one of the changes involves place hierarchies.

STEMMA recognises that places are not the same as point locations that can be given specific coordinates. Even if such a point is relaxed to be a closed polygon (say for describing the boundary of a town or village) or an open polygon (say for mapping a street, noting that European streets are rarely straight), then a place still has an identity that is independent of its location or its name(s). Boundaries and names may change over time, but a place is still a place. Originally, it was hoped that each place would have a unique parent place that was appropriate to the nature of the hierarchy. For instance, that an administrative place would have an administrative parent, or an ecclesiastical place would have an ecclesiastical parent, but the reality is too messy. The difference between geographical and administrative relationships can be vague, especially when including local administration in additional to national administration. As a result, each place is now deemed to have a single (but time-dependent) canonical parent, but the hierarchy is no longer of a specific type (i.e. it may vary depending upon the level in the hierarchy). The scheme still makes use of related entity linkages to connect items across hierarchies, such as registration districts (for civil registration of births) to ecclesiastical parishes (for baptisms), but the whole field remains challenging.

The only other project that I am aware of that is treading a similar path is the History Research Environment (HRE) that began in 2016. This has an incorporated not-for-profit UK company, History Research Environment Ltd, although work seems to be centred more in Australia. It comprises an open-source project to "create a free platform-independent application for the serious amateur or professional historical researcher", and was still under development at the time of writing. The main similarity with STEMMA is in the focus towards general history, and their tagline is "Towards a history of almost anything". It will be very interesting to see if they can muster commercial success in a field that might be considered specialist, and which high-profile genealogical advertising blatantly ignores.

The STEMMA project now has to share my efforts with the SVG-FTG (and other tools such as MetaProxy) as well as the publishing of my first book — not genealogy, but more on that another time.

The website for STEMMA has recently been moved from Google Sites to neocities.org. This was necessary because the old Google Sites (which was always a little clunky) is being replaced with a new one, and users have been given an ultimatum to convert, but the conversion tools are wholly inadequate for porting my old site across, despite the content being primarily textual. Google have also made a policy decision to provide no HTML editor and no way of importing the HTML of any pre-existing site. Good luck with that! It sounds like it could be another project ready to flounder.

So, the new link for the website is https://parallaxview.co/stemma. The URI http://stemma.parallaxview.co is, as before, reserved for STEMMA namespaces. The legacy URL of http://www.familyhistorydata.parallaxview.co should redirect if still used (once my DNS configurations does what I tell it).

Sunday, 23 April 2017

Transcription Boundaries



We all know about transcription, right … or do we? What are the ultimate goals? What are the limits, and are they inherent ones or self-imposed ones? I’m taking this opportunity to expand on some important transcription breakthroughs in the recent STEMMA V4.1 release.

Transcription Sources
Most people would begin by transcribing textual sources paragraph-by-paragraph, or sometimes line-by-line, dependent upon the actual source. It would quickly become apparent, though, that various scenarios cannot be transcribed directly as literatim text, such as uncertain characters or words, crossed-out text, text inserted or changed, and marginal annotation. What those people then have to do is decide on some form of mark-up to represent those scenarios (see Power of Annotation), but which one?

There are many schemes, ranging from old-style manuscript mark-up[1], through simple ASCII-character mark-up, to full-blown mark-up languages such as TEI (Text-Encoding Initiative). This latter technology, for instance, can represent semi-diplomatic or full diplomatic transcription of textual sources to digital form. Diplomatic transcription might be valuable for preservation but is that what we need for analysis?

Typescript Sources

This should be the easiest of the cases; when given a page of typed text then we might employ OCR to automate the conversion to a digital form. This is all very well if it is perfectly readable, but barely-readable sections, or additional hand-written annotation, would require a mark-up scheme.

And yet there are some subtle, but profoundly important, situations that rarely get mentioned. The presence of different fonts or typefaces in a printed electronic document would be taken for granted as indicating some semantic difference (e.g. a heading, abstract, or a footnote), but what about documents produced on an old-style typewriter? The presence of different typefaces might then indicate that a document was written on different machines at different times. Similarly with the alignment of the lines, or the marginal indent. But how do we indicate that in the digital form?

Suppose that there was a difference in the sophistication of the grammar in different sections, one that might provide a vital clue to different authors. How would that be represented?

A more important question is who would be the beneficiary of those indications? Schemes concerned with preservation will employ software taxonomies to categorise every eventually, but those subtleties — which could be crucial to the analysis and interpretation of a document  by a researcher — would almost certainly be excluded as unimportant in the digital representation.

Manuscript Sources

When transcribing manuscript documents then the points I’ve just raised become much more prominent. Contributions from different authors are generally more obvious because of their handwriting styles, and these obviously need to be distinguished in order to support any analysis, but what about stylistic variations?

Suppose that someone had underlined a word. That would clearly be an indication of emphasis, and the transcriber might represent it using some mark-up language (e.g. <u>word</u>) or some lightweight mark-up language (e.g. __word__), but what if a different word was underlined twice, or more times? This question also applies to text that has been struck-out. My point is that this is an important piece of information to capture, but how much more is required for analysis than for preservation?

As another example, consider if the author had used different coloured inks. James Joyce and Virginia Woolf both used different coloured pens or crayons in their work. Should a mark-up scheme have taxonomies for the basic colours, or all possible shades and hues? Character size and intensity (e.g. from a firm hand) can also be indicative of something. Who would benefit, though, from knowing that one paragraph was in dark green and another in light green: the software or the researcher? Is there a practical limit to the number of important variations that software taxonomies can distinguish, and if so then why do we insist on that route?

Audio Sources

Schemes that deal with audio transcription are generally specialist, and distinct from those related to textual transcription. The main reason is that those stylistic variations multiply exponentially. Not only do the transcriptions have to distinguish between contributions from different speakers, but they also need to indicate such things as speaking quickly/slowly, loudly/softly/whispered, singing, false accents, mimicry, and even different intonation. Schemes for audio transcription try to define taxonomies for these cases — although there will always be cases that aren’t covered — and the area of intonation is treated in a very formal way by linguistic analysis.

There may be cases of unknown words, slang, or strange pronunciations, each of which may need clarifying annotation.

While it is clear that the field is complex, I want to make an argument that there is a broad categorisation of the scenarios that has parallels in textual transcription, and that a single approach can deal with all three transcription source types. First, let’s look at some further complexities for audio.

There may be utterances or sounds from a given contributor that cannot be transcribed directly as text. For instance, a sneeze, cough, sniff, yawn, whistle, laugh, or swallow.

There may be a significant pause in someone’s speech that is important in the context of their words.

There may be any number of gestures or items of non-verbal communication that are equally important to capture within the transcript. For instance, a nod, smile, head-shake, squint, frown, or applause.

There may be instances where different voices — each of which is being transcribed — are overlapping each other, or where there is some untranscribed background contribution.

Conclusion

We can group all the above scenarios into the following broad categories:

  1. Language from different contributors. Distinguishing different hands, voices, etc.
  2. Stylistic differences from any particular contributor. Different emphasis, emotional delivery, typeface, handwriting, etc.
  3. Annotation where explanation or clarification is needed. Examples are unusual words, unknown words, slang, or local pronunciations.
  4. Contributions that cannot be transcribed directly or wholly as text. This includes changes, marginal notes, noises, gestures, and pauses.
  5. Parallel Contributions. This category is specifically related to audio.

STEMMA’s transcription support is designed to make material searchable, but also to support deep analysis. Some of these categories were already catered for in the cases of textual transcription, but supplementing them to cater for the remaining categories implicitly addressed audio transcription too. For instance, the <Alt> and <NoteRef> elements already catered for category #3 and needed no changes. The <Anom> element already represented textual anomalies, and so was extended to address the other anomalies in category #4.

The way that <Anom> was extended set the scene for the other extensions I will describe in a moment. Its existing taxonomy (see the http://stemma.parallaxview.co/anomaly-mode/ namespace) was given extra items of Gesture, Noise, and Pause. Within these, though, the specific gestures and noises are described using text, by and for the researcher, and not by using some limitless software taxonomy.

The STEMMA transcription elements <ts> (typescript sources) and <ms> (manuscript sources) were supplemented by <voice> (audio sources), and each were enhanced to cope with categories #1 and #2. They were extended with new attributes of ‘id’ and ‘scheme’, For instance:

<ms id=’id’ scheme=’scheme’>An example sentence</ms>

What these attributes do is attach a key representing the contributor (e.g. a hand, or a voice) and a specific stylistic variation of that contributor. There are no taxonomies used here since the differentiation and description may be subjective; the differentiation is designed to support analysis, not simply a matter of rendition; and there need to be no constraints.

The last category (#5) is addressed by specific variations of the <voice> element that allow it to be used as a container for multiple contributions.

A small example of an audio transcription employing these features may be found at Dialogue Transcription. The <ts>, <ms>, and <voice> elements are documented at Descriptive Mark-up.

The rationale behind this approach is actually quite a well-known one, although not in this field. In the area of Web mark-up, HTML5 tries to separate structure and content from presentation, the latter being left to something like CSS. For the formatting of Web pages, this avoids cluttering the mark-up describing the structure and content of page information, and ensures a consistent presentational style is applied across the pages. For transcription, it avoids cluttering the mark-up describing the structure and content from various contributors, but leaving complete freedom to the researcher to describe these in narrative as part of their analysis process.




[1] Rarely usable in a computer-based transcription because the old symbol set does not correspond with available symbols in an electronic document.

Wednesday, 19 April 2017

STEMMA V4.1



An original goal of STEMMA was to be able to represent rich-text narrative that could be used for authored works, including essays, memories, and reports. In addition, it aimed to support transcription, including transcribed extracts, which has quite specific requirements of its own.

STEMMA V4.1 has concentrated on its mark-up in these areas and has solved a number of long-standing issues with some novel approaches. Such was the success of the approach to textual transcription that this version also addresses audio transcription as a companion to it. I know of no other system that addresses both of these in a consistent manner, and certainly not when including rich-text authored work and semantic mark-up.

Overview

A goal of HTML5 was to separate structure and content from presentation in Web pages. STEMMA has applied a similar principle to its descriptive mark-up for both authored work and transcription.

STEMMA is not a presentation format. It therefore concerns itself with narrative structure, content, and semantics, but not the finer details of the presentation such as colours and fonts. STEMMA narrative may be transformed into any number of presentational formats for visualisation (e.g. HTML+CSS), and it is in these formats that such things would be configured, including page size, style galleries, choice of footnote/endnote/tablenote indicators, heading and cell formatting in tables, caption position, paragraph separation, styles for semantic elements, and so on.

Unusually, it has also applied this principle to both textual and audio transcription. Identifying the structure and content is more important that the finer details of their style and presentation, and the interpretation of any stylistic differences requires analysis rather than it simply being a display matter. For instance, marking where a manuscript used different colours in different places is more important than the specific colours and shades — that level of detail can be written in narrative for the reviewer rather than trying to use some limitless taxonomy for the software. Similarly with different written styles, which may or may not have been evidence of multiple authors. In a typescript document, it would equally apply to different fonts, font-sizes, ink intensity, marginal alignment, or even usage of grammar; all of these could have a bearing on the analysis of that document.

In audio transcription, this approach simplifies a complex area by giving freedom to the transcriber to detail the different voices, intonations, noises, and gestures.

Authored Work

The functionality of STEMMA’s descriptive mark-up has now evolved to the level where I can automatically generate blog-posts for research articles directly from my internal representation.

In order to demonstrate the new version, I have used the recent 5000-word article entitled Jesson Lesson to generate a fully-worked STEMMA example, available at JessonLesson.xml. This genuine research article included precise layout, transcribed extracts, tabulation, endnotes and tablenotes, and hyperlinked images. Its 47 endnotes included examples of reference-note citations, discursive notes, analytical commentary, and multi-source references — the handling of which was outlined previously at Cite Seeing — but also included examples of conflated citations where details of multiple people are placed in a single note for readability.

It was always a personal goal to produce better quality research articles, and so force STEMMA to address real-world scenarios rather than “desktop scenarios”. As a result of this, STEMMA’s general approach to citations has shifted slightly. Although support of citation-elements — implemented using its Parameter mechanism — has been enhanced, the focus of the computer-readable form is now on correlation and interrogation rather than mere formatting. The number of real-world cases (see list under Citations) is just too great for authored works to delegate formatting entirely to software that acts blindly from mere values. This version, therefore, finds a bridge between preferred hand-crafted forms and computer-readable citation-elements.

Another area that has been enhanced greatly is tables, which now support control over table width, column widths and alignment, captions, and tablenotes (i.e. citations deposited at the foot of a table).

Textual Transcription

The existing <ts> element, used to mark text transcribed from a typescript document, and the <ms> element, used to mark text transcribed from a manuscript document, both have new ‘id’ and ‘scheme’ attributes. These label the respective contributions with user-defined tags — ‘id’ for distinct contributions, such as different authors, and ‘scheme’ for stylistic variations — that can be described separately for the benefit of the reviewer.

For instance:

<NoteRef><Text Class=’Legend’>
bold-blue – text was written with a broad-tipped turquoise felt marker.
</Text></NoteRef>

<ms scheme=’bold-blue’>This section is now out-of-date and is being reworked</ms>

The elements <page>, <col>, <p>, <line>, and <posn> now take SVG-like image coordinates (percentage displacement from top-left image corner) for linking transcription elements to a copy of the original document. One use of this is to support parallel scrolling of image and transcription for the end-user.

The associated image is specified by a preceding <ResourceRef> element identifying a Resource entity using the mode ‘SynchImage’.

Audio Transcription

For audio transcription, the <voice> element provides the analogy to <ts>/<ms>, and it similarly takes ‘id’ and ‘scheme’ attributes. This allows different vocal (or other audio) contributions to be distinguished, and also their intonation, emotional delivery, artificial accents, etc.

Additional features are supported in a way analogous to textual transcription:

  • Anomalous contributions from an individual that cannot be represented as text, including noises, pauses, and gestures – see <Anom>
  • Alternative word meanings, clarifications, or other notes – <Alt> and <NoteRef>, exactly as with textual transcription
  • Time synchronisation – time-stamping with <time>. This is analogous to the <posn> element, and other x/y coordinates, used for textual transcription.

For time-stamping, the associated recording is specified by a preceding <ResourceRef> element identifying a Resource entity using the mode ‘SynchAudio’, analogous to ‘SynchImage’ for images.

As well as marking distinct voices, these features include the ability to mark overlapping contributions and background contributions. An example demonstrating many of these features may be found at Dialogue Transcription.

Change Details

Specific changes to the data model include the following:

  • ‘WhereIn’ attribute added to Citation Parameter definitions. This finally provides the missing criteria necessary for the automatic generation of shortened subsequent reference-note citations. ‘Subst’ attribute added to Citation parameter values in order to override formatting, or provide a substitution for cases on of a value being unavailable.
  • <ParentCitationLnk> now allowed in both <CitationLnk> and <CitationRef> elements in order to create transient chained citations.
  • Quality element, within Source entity, moved inside the Frame element.
  • Review of entries in citation-layer-type namespace.
  • DataControl element of Resource entity supports attribution text.
  • Control of table widths, and individual column widths and alignments.
  • Ability to align images when embedded within narrative.
  • Ability to hyperlink images embedded in narrative.
  • Requirement for enclosing Narrative element dropped for Text elements, except for top-level Narrative entities. Text elements can now be nested.
  • <cb> replaced with <col>, and relationship between paragraphs and columns now reversed (paragraphs now within columns).
  • ResourceRef Mode=SynchImage allows synchronisation between images and transcriptions.
  • Corresponding SVG-x/y coordinates added to elements <page>, <col>, <p>, and <line>. Additional <posn> element defined to associate coordinates with arbitrary text locations.
  • <Page>/<Line> renamed to <page>/><line> and moved alongside <p>/<col> as related to structure and content rather than semantics.
  • Mode=Tablenote attribute supplementing Foonote and Endnote in various places.
  • Text-element Header=boolean attribute replaced with Class=Header | H1 | H2 | H3 | Caption | Footnote | Endnote | Legend | Tablenote.
  • Text-element Class=Caption attribute used in Resource/ResourceRef and tables for generating captions.
  • Text-element Class=Footnote | Endnote | Tablenote attribute used in CitationRef to allow pre-formed (preferred) citations.
  • Deprecated the <Text> attributes Abstract=boolean, Extract=boolean, Manuscript=boolean, and Transcript=boolean..<voice> mark-up added to supplement existing <ts>/<ms> mark-up. <ts>/<ms>/<voice> all enhanced to cope with different hands, voices, fonts, colours, etc.
  • In transcripts of audio recordings, support for multiple voices, overlapping dialogue, intonation, gestures, noises, pauses, timestamps, etc.
  • ResourceRef Mode=SynchAudio allows synchronisation between audio recordings and transcriptions, analogous to SynchImage for textual transcription (above).
  • Complete revision of Mode values for CitationRef element.
  • Relaxation of Date Parameters in order to cover the full range of calendars. One requirement was to represent the date-of-issue for newspaper sources that predated the Julian-to-Gregorian changeover.

Further refinements to this data model are uncertain as it has now achieved the level of stability and functionality that was required for its serious usage.

Saturday, 26 March 2016

Dynamic Genealogical Data



Yes, I will be discussing data models and software issues in this post — sigh! — but hopefully in a manner that may be instructive to those who want to know more. As well as introducing certain important concepts, I want to illustrate some typically tricky decisions that have to be made, before rounding off with a novel way of presenting custom data to the end-user. Know-it-alls who already have a software background can just fast-forward to the “Reporting” section.

Some time ago, I submitted a paper to FHISO on the subject of object models[1] in which I explained their relevance to scripting languages, query languages, and general dynamic data access. Admittedly, this paper was aimed at a software audience, but let’s try and pull it apart to explain what these languages are, and the difference between a data format, a data model, and an object model.

Dynamic Data

Data Model

A data model is a formalised description of the relevant data entities (e.g. person, or place), their properties (e.g. names, sex, coordinates, etc.), and their relationships (e.g. biological lineage, or place of birth). Issues such as indexes and database schemas are not applicable to data models as they are a more abstract definition of the data’s structure, or rather its pattern. But issues such as cardinality (how many items of one type can be related to another), ordinality (the ordering of items related to one instance of another), and optionality (whether an item is mandatory or optional), are relevant.

Let’s consider one aspect of a genealogical data model to help illustrate this point: biological lineage. Every person had one mother and one father, even if they are unidentified; there cannot be more than one of each (ignoring the possibility of donor DNA) but some representations of this will be better than others.

If the parent person entity (e.g. a mother) points to each individual child of hers then it accommodates the erroneous situation where multiple mothers might point to the same child. However, the converse of having each person entity point to their respective mother and father enforces the cardinal integrity of the relationship without having to perform constant error checking.

Entity relationship schemes

It should be noted, here, that the direction of the link makes no difference to the ability to find children-of-a-parent or parents-of-a-child; both can be indexed from either one of the schemes.

So what if you don’t know the father? Well, having a missing father or mother link could easily be recognised as an indication that they are unidentified, but suppose that you have some incomplete details for them? Suppose, for instance, that you don’t know the name of the mother but you have her date of birth. This is where we get into controversial territory, and where I’m going to make a very bold statement. There are many threads that advocate the substitution of underscores, question marks, or some special text such as “Unknown”, “LNU” (Last Name Unknown), etc., for a missing name. In a software context, all of these are absolutely wrong, and not the right way to handle the situation. This is not a personal belief — it is a best-practice in a profession that I have spent decades in. It doesn’t matter who is making those recommendations, and there are no special cases for genealogists.

OK, rant over; now let me clarify this. Ignoring the fact that any alphabetic text may not translate well when sharing your data with someone from a different locale, the choice over which substitution to use for a missing name, or any missing datum, should not be given to the end-user, or even to a specific software product. More than that, good software would represent non-value conditions of a datum, such as unknown, not applicable, or erroneous, in a different domain to real values so that there is zero chance of a clash. For instance, consider the difference in a SQL database between NULL (a special condition in a column) and “NULL” (a normal textual value in a column). Also, the display value by which those special data conditions are represented to the end-user is a choice by the product, and not dictated by the software representation in the corresponding data format or data model.

I appreciate that some software may not follow these best-practices, but it is important to understand why this is bad for everyone. Tamura Jones produced an excellent article in 2013 related to this subject that discussed the impact of using acronyms and other invented values.[2] As I recently commented on one of Randy Seaver’s blogs, “Fake, Fudged, Dummy, and other such ‘special’ values were bad choices even in the 1970s”.

We’ve just looked at some choices in the relationships between two entities, and in the representation of non-value conditions. These cases may provide a basic insight into typical design issues affecting a data model, but what is a data model good for? It allows two products — a producer and a consumer — to agree on the structure of real data being exchanged between them.  When real data is stored in a file (or serialised as bytes for some other purpose, such as transmission over a communications link) then the data format employs a given syntax. That data format is largely irrelevant in comparison to the data model; the GEDCOM data model could be expressed in its own proprietary data format, or in XML, or some other format, and it would be a straightforward mechanical operation to convert from one format to another if they all conform to the same model.

However, such files are a very static way to exchange data, and they have to be loaded into some organised indexed form before they can be interrogated, navigated, or manipulated. One example of such a form is a database, but this is not the only form and genealogical products have other choices (see Do Genealogists Really Need a Database?). The following diagram provides a simplistic depiction of how a program may access indexed data in a disk-resident database or in memory, but other variations will be possible. For instance, a memory-resident index pointing to files on disk, as might be the case with a collection of image files.

Data access

STEMMA deliberately describes its data format as a source format in order to attach extra semantics; this draws from the term source code, as used in programming, in order to emphasise that the data is a definitive source for other forms, whether generated by transformation or by indexing, and not simply an exchange format.

Object Model

A program that accesses a database is constrained by the data-types allowed in its columns, the nature of its indexes, normalisation of its table entities, and the associated query language used to access those tables (mostly but not always SQL). Software that uses a query language directly, rather than having some abstraction layer between it and the target database, may be reducing both its longevity and its portability.

An in-memory index is more efficient and more flexible, and the ever-increasing memory capacity of modern machines means that it is totally practical to have both the data and the index in memory together. But what would the in-memory data look like?

The modern answer to this question is objects. In object orientated programming (OOP), an object is a software entity representing one instance of some real-life entity. For instance, a Person object[3] would represent one named person, and a Place object one named place. Objects of the same type are instantiated (i.e. created) from a template called a class, which defines not only the allowable properties (e.g. names and sex for a person) but also small segments of code, called methods, that may be invoked on the associated objects. For instance, there may be a method to test whether any of the names stored in the current object matches a particular name provided as a parameter. All products utilising that class in its programming would therefore use a consistent algorithm, as implemented by the designer of the associated object model: the set of related classes intended to cooperate in order to deliver access to that data. An object model is not uniquely defined by a given data model, but they do go hand-in-hand; every object model has an underpinning data model. However, whereas a data model talks about entity relationships, it is the object model that talks about actual data linkages, indexes, and issues of efficient data access.

A very important aspect of OOP is software inheritance. This is where one class is derived from another class and allows it to share unchanged portions while overriding others; the intention being to create a new class for a more specialised type of entity. The following is an illustration of how it might be applied to the various subjects of historical research, each level providing specialised classes derived from more generic ones in the previous level.


Software inheritance
In this illustration, the handling of names could be shared for all the subject types, and inherited from the historical-subject base class, whereas the hierarchy for animate subjects (i.e. lineage) would be different from that for inanimate subjects.

We might then redraw the earlier data-access diagram as follows in order to show that the object layer forms an effective abstraction:


Abstracted data access
The program sees the same application programming interface (API), irrespective of whether the data is in local memory, in some database, or even across some network connection. NB: The index associated with the objects would be implicit in their class definitions, and not really a separate entity as implied by this diagram.

I’ve just mentioned access across a network, where your data may be on a separate machine (the server) to that of your program (the client), e.g. in the “cloud”. This is a case for which query languages are well suited. You see, if data server has millions of records available but the program on your client machine only wants to see a handful that satisfy some specific criteria, it would be extremely inefficient to transport all the records up to the client machine, across a typically slow network — much easier to push the criteria down to the server and let software there sort it out. This is effectively what happens when a SQL query is sent to a server hosting a database; the query may be as small as a single line and the returned records would be just the ones of interest. There are other forms of query language, such as MDX for multi-dimensional data queries, and the form of the returned data is highly dependent on the nature of the query.

A scripting language is usually considered to be an interpreted language, meaning one executed directly from its source-code representation — as entered by the programmer — rather than being first compiled into a set of instructions that the machine can execute directly. Because the source has to be parsed before it can be interpreted then there is a performance penalty with them, but their speed of deployment and ease of maintenance make them very useful for small-scale applications. Languages such as JavaScript and VBScript are common examples, but there is little difference from the aforementioned query languages, other than in their intended function. Many database systems even support a mechanism where segments of script can be held as stored procedures that can be invoked later by a special type of query statement. The relevance of this is that when a scripting language has access to an object model then you have a very powerful and flexible means of data access.

Suppose we want to express a custom genealogical query — one not supported intrinsically by our product — to look at all the events in our timeline, then look at all the persons connected to those same events, and then to select just the ones whose name(s) have the token "Jesson" in them. If a standard object model is defined then it doesn’t matter whether we express our query using a standard scripting language or some proprietary one associated with the product.

This example uses a java-like syntax.

Person me = New Person("Tony Proctor", 1956);
for (Event e: me.allEvents()) {
for (Person other: e.allPersons()) {
if (other.nameContains("Jesson")) {
...do something with this other person...
}
}
}

This example uses a VB6-like syntax.

Dim me As New Person
me.setPersonName (“Tony Proctor”)
me.setDateOfBirth (1956)
Dim e As Event
Dim other As Person
For Each e In me.allEvents()
For Each other in e.allPersons()
If (other.nameContains(“Jesson”)) Then
...do something with this other person...
End If
Next other
Next e

The syntax is very different but the essential elements of the object model, such as class names and method names, are the same in the two examples.

So, in summary, irrespective of where the data is coming from (memory, database, or afar), if an object model is available then any processing or queries can be expressed through scripting languages. Furthermore, those segments of code can be pushed down to the data server in order to achieve efficient retrieval in the case of remote data stores.

Citations

One instance where I have found it beneficial to expose an object model was in the processing of citation-elements in order to generate a formatted citation. A citation-element is a discrete datum that can be identified in a citation, such as an author, title, publication date, etc. When a system generates a formatted citation using a citation-template then it takes various citation-element values and inserts them at selected places in a textual template. The onus is on the hosting software to provide the citation-template with all the relevant values, and this can be a heavy burden if it doesn’t have intimate knowledge of the actual template.

Suppose that the citation is required to name the Genealogical Publishing. Co. of Baltimore. How much information should the hosting program pass to the citation-template to let the reader know where that company is? Is a prefix of “Baltimore:” enough, or does it require “Baltimore, Maryland:”, or does it require “Baltimore, Maryland, US:”? Remember that the reader may not be American, and if you think they should know all the US states then would you be aware of all the regions in their country?

The alternative approach is to pass a Place object to the citation-template and allow it to invoke the associated methods to obtain the specific information that it requires for the current template and the current user. The same approach can be applied to other data such as a Person object (allowing access to name-handling methods), or a Date object (allowing the formatting of dates from alternative calendars in short/medium/long/full forms).

Reporting

A more recent application of an object model occurred in STEMMA’s narrative support. The inclusion of a segment of script in a STEMMA table entity allowed it to fetch specific data to populate the cells at the time associated Narrative entity was rendered. This basically meant that a Narrative entity could be used as a report writer (in software terminology) to fetch up-to-date data matching a custom query and to present it along with narrative or other data.

To explain the significance of this, let’s look at the HTML equivalent since it is also possible to dynamically populate an HTML table. Once upon a time, programmers used to do this by injecting new HTML source into the table using the JavaScript document.write() function. For instance:


document.write (“<tr>”);

This allowed, say, the rows and cells of a table to be generated from some data such as the results of a SQL query or the contents of a JavaScript array. This is a very old method, and has acknowledged security risks, as well as performance implications in certain cases. An equivalent way of injecting HTML source is to modify the innerHTML property of a given node. For instance:

node.innerHTML = "<b>Hello World</b>";

A better approach, though, would be use methods provided by the HTML Document Object Model (DOM): the tree of node objects into which an HTML document is compiled. For instance, document.createElement() and node.appendChild(). In the specific case of tables, W3C defined DOM methods such as tbody.insertRow() and tr.insertCell() to help build the table body more easily.

The STEMMA case is slightly different from that of HTML since it does not have an inherent DOM — the contents of a marked-up Narrative entity have to be transformed into some other system for presentation, which might be in an HTML page, a blog page, or a word-processor document — but it does expose a tentative genealogical object model. This means that the STEMMA table entity can specify a segment of script code to call upon that object model and retrieve results for the table contents. It doesn’t do this by dynamically injecting STEMMA source, or by calling on something like the DOM methods to build-up a table; the script populates an object that simply describes the contents of a table — the headings and data cells — and this can be transformed for display in the same manner as a static table would.

What this all means is that the existing support for representing narrative essays, narrative reports, transcriptions, etc., has also become a tool for dynamically reporting on genealogical data. I don’t need to devise some completely separate tool to achieve this, and I also get the benefit of mix-and-match where dynamically generated tables can be embedded in my narrative reports. And just in case anyone hasn’t realised yet, if the underlying data is subsequently modified then I will see the very latest data the next time I view the associated Narrative entity.



[1] Tony Proctor, "Proposal to Create a Standard Run-time Object Model", FHISO Call For Papers, CFPS 9 (http://tech.fhiso.org/cfps/files/cfps19.pdf : accessed 9 Mar 2016);
[2] Tamura Jones, “FNU LNU MNU UNK”, Modern Software Experience, 11 Aug 2013 (http://www.tamurajones.net/FNULNUMNUUNK.xhtml : accessed 9 Mar 2016).
[3] Using capitalisation, here, merely to distinguish software entities from the real-life entities that they are representing.