OntoDL Core Cncepts: Directives vs. Statements

Aus CTS2-LE
Zur Navigation springen Zur Suche springen

The OntoDL interpreter passes multiple times through a MS Word document:

  1. The OntoDL tokenizer analyzes the document, detects the parts that must be processed by OntoDL and splits these parts of the document into a set of OntoDL commands and parameters. During this pass all OntoDL directives within the document are executed.
  2. The OntoDL object manager parses through the token sequence and builds up the defined hierarchy of OntoDL objects. It registers all object names within their definition scopes so that concept relationships defined at the beginning of a document may even refer to concepts that are defined at the end of the document. During this pass the syntax of all OntoDL statements is checked. Errors and warnings are written to an error log.
  3. The OntoDL parser analyzes all OntoDL statements, sets object properties, resolves object references and loads missing information from the terminology server. The result of this processing step is a set of code system definitions based on the OntoDL internal information model.
  4. The OntoDL FHIR converter takes this representations of the defined code systems and transforms them into an information model that complies to the FHIR ValueSet resource definition (and the defined CTS2-LE extensions to this definition).
  5. The OntoDL XML Writer takes the FHIR ValueSet resources and writes these to the filesystem as XML files (that comply to the FHIR XML binding).

The OntoDL language provides 2 kinds of commands:

  • OntoDL Directives are interpreted by the tokenizer. Most directives are linked with style sheets and direct the tokenizer how to process a paragraph of text that is formatted with this style sheet. It is important to notice that directives only manipulate the text of the document; directives do not "know" anything about OntoDL objects. All OntoDL Directives start with a hash-sign (#).
  • OntoDL Statements are interpreted by the parser. Statements define and manipulate OntoDL objects and are used to set up the defined code systems. Some Directives (e.g. #heading) are used to define objects, too. Nevertheless, all the OntoDL tokenizer does on these Directives is to internally manipulate the document in a way that these directives are replaced by the corresponding OntoDL statements.

Generally spoken, OntoDL Statements provide all the OntoDL functionality but look ugly within a document. The only use for OntoDL Directives is to hide away the OntoDL statements by manipulating the text in a way that these statements can be generated out of style sheets and text templates. In the example above, the Directive

#heading 1 codesystem .Name ( .URI )

does not much more than to translate the Überschrift-1-formatted Text "Body Parts (http://sample.com/bodyparts)" into a sequence of OntoDL Statements:

define codesystem(Body Parts) {
set (Body Parts).URI = (http://sample.com/bodyparts)
}