Introduction

One goal of Real Semantics is the unification of document management, ontology management, database management and source code control. If you're working on a complex domain, it's critical to split many hairs very precisely. This is straightforward if we build those definitions into an ontology, document those definitions with authoritative texts, and then link ontology and instance data to source code and other artifacts that execute these defintions.

As much as possible, Real Semantics breaks with the common practice of using textual template languages to generate documents (including software code and configuration files) and instead relies on internal representations that let us operate on documents with meaningful operations. The image below illustrates the process. Real Semantics incorporates HTML documents (as well as data and other documents) by converting HTML into parse trees and then operating on them with meaningful operators. This makes it possible to break HTML documents into components and then put those components together in a different way. In one example, for instance, a Real Semantics application could read an HTML document from a file, extract content from it, and display that content in a template defined by an ordinary HTML file (with no special markup) embedded as a resource in the application.

HTML 5, by formalizing the treatment of imperfectly formed documents, makes it possible for libraries such as JSoup to process HTML in a structure-preserving style similar to how XML documents are commonly processed. Instead of embedding template variables as done with PHP, Freemarker, Handlebars, and other common template systems, Real Semantics applications refer to locations in HTML documents via class and id attributes as well as CSS selectors. Data can be merged with HTML by writing conventional procedural code or by applying matching rules.