OntoDL: Unterschied zwischen den Versionen

Aus CTS2-LE
Zur Navigation springen Zur Suche springen
K (About OntoDL)
(OntoDL Core Concepts)
Zeile 13: Zeile 13:
  
 
== OntoDL Core Concepts ==
 
== OntoDL Core Concepts ==
=== OntoDL Objects ===
+
OntoDL is two interpreter languages in one. Under the hood there is a powerful but simple OntoDL Object Language that allows to define arbitrary complex ontologies using a small set of OntoDL statements. You may write OntoDL programs in this language but mostly you will instead rather write some small macros in the OntoDL Macro Language. Such macros define how common means of MS Word like style sheets and heading levels map onto the OntoDL Object Language. E.g. with a one-line-macro you can define that a level-2-headline shall define a ''codesystem'' object in the OntoDL Object Language with the name and URI of the codesystem povided in the headline text.
=== Directives vs. Statements ===
 
  
The OntoDL interpreter passes multiple times through a MS Word document:
+
;[[OntoDL Core Cncepts: Directives vs. Statements|Directives vs. Statements]]
# 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.
+
:Learn more about the two languages that make up OntoDL and how they are interlaced to simplify the definition of ontologies.
# 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.
 
# 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.
 
# 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).
 
# 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
+
=== OntoDL Objects ===
<pre>#heading 1 codesystem .Name ( .URI )</pre>
+
In OntoDL everything is an object that has a name and a type. Depending on its type, an object has various properties defined. E.g. if you want to create a terminology named "Animales", you will define an object "Animals" of type ''codesystem'' and set that object's properties - e.g. a description or a version number - to proper values. Within that terminology you can then define a hierarchy of concept objects, e.g. representing "mamals", "lions", etc. Again each object has properties that can be set to describe the semantics and representation of the object.
does not much more than to translate the ''Überschrift-1''-formatted Text "Body Parts (http://sample.com/bodyparts)" into a sequence of OntoDL Statements:
 
<pre>
 
define codesystem(Body Parts) {
 
set (Body Parts).URI = (http://sample.com/bodyparts)
 
}
 
</pre>
 
  
 
== OntoDL Tutorial ==
 
== OntoDL Tutorial ==

Version vom 11. September 2016, 08:06 Uhr

About OntoDL

OntoDL is a language for defining structured vocabularies - from simple value sets up to complex ontologies. The editor for writing OntoDL programs is MS Word. OntoDL progams are executed by an interpreter that is implemented as a MS Word makro.

While OntoDL commands are embedded into any MS Word document, the specification of a vocabulary is also the documentation of the vocabulary. For making OntoDL look like "normal" MS Word texts, OntoDL commands can be linked to style sheets. The OntoDL interpreter implicitly executes the commands assigned to a style sheet whenever it discovers a line of text within a document that if formatted using this style sheet. By this you can e.g. advise the interpreter to consider headline hierarchies as hierarchies of concepts.

A First Example
This example gives an impression how a typical OntoDL code system definition looks like.
FHIR, CTS2, CTS2-LE and OntoDL
Learn how OntoDL fully builds upon standards and works together with the CTS2-LE terminology server.
Installation and Setup
OntoDL runs from within your MS Word. Make sure you have all required libraries properly installed.

OntoDL Core Concepts

OntoDL is two interpreter languages in one. Under the hood there is a powerful but simple OntoDL Object Language that allows to define arbitrary complex ontologies using a small set of OntoDL statements. You may write OntoDL programs in this language but mostly you will instead rather write some small macros in the OntoDL Macro Language. Such macros define how common means of MS Word like style sheets and heading levels map onto the OntoDL Object Language. E.g. with a one-line-macro you can define that a level-2-headline shall define a codesystem object in the OntoDL Object Language with the name and URI of the codesystem povided in the headline text.

Directives vs. Statements
Learn more about the two languages that make up OntoDL and how they are interlaced to simplify the definition of ontologies.

OntoDL Objects

In OntoDL everything is an object that has a name and a type. Depending on its type, an object has various properties defined. E.g. if you want to create a terminology named "Animales", you will define an object "Animals" of type codesystem and set that object's properties - e.g. a description or a version number - to proper values. Within that terminology you can then define a hierarchy of concept objects, e.g. representing "mamals", "lions", etc. Again each object has properties that can be set to describe the semantics and representation of the object.

OntoDL Tutorial

Defining Terminologies and Concepts

In this section the most important language features of OntoDL are explained. In order to make this more comprehensive, a holistic example will be used that shows how OntoDL can be used to easily define semantics-rich structured terminologies for a hospital.

Defining Custom Properties

  • Defining and Using a Custom Property
  • Using the _parent Property

Using Existing Terminologies

  • Using the CTS2LE Global Object
  • Using Patterns
  • Defining a Value Set

Defining Concept Relationships

  • Defining and using a predicate-object
  • Using default target systems for concept relationships

Using Objects

  • Defining an untyped Object
  • Assigning Objects to Attributes

More Features

  • Defining Obligations
  • Using Defaults
  • Using Hyperlinks for Steering the Tokenizer
  • Synonyms and Fully Specified Names
  • Defining and Using OntoDL Functions
  • Using Globally Defined Objects


OntoDL Language Reference

The OntoDL Syntax consists of three kinds of commands:

  • OntoDL Statements: ...
  • Style Sheet Directives: ...
  • Tokenizer Directives: ...

OntoDL Statements

define
define a new OntoDL object
set
set the value of a named property of an identifiable object
default
set a default value for a named property
--predicate-->
define a concept relationship

All OntoDL Statements build uopn a small set of Base Types.

Style Sheet Directives

OntoDL.StyleName
implicit assignment of a value to the property StyleName within the definiton scope of an OntoDL object
#heading
binding of the scope of a heading to an OntoDL object definition with an implict assignment of values to properties of the defined object
#obligation
trigger the execution of a set of commands and/or directives before or after text of a defined style sheet is processed
#pattern
template-based transformation of a text that is formatted with a defined style sheet

Tokenizer Directives

#goto ... #return
control how the OntoDL tokenizer scans through the document
#package ... #endpackage
define a named subroutine that can be linked to an obligation

OntoDL Object Types

codesystem
object representing the OntoDL definition of an ontology, terminology or value set
system
object representing an externally defined ontology, terminology or value set
concept
object representing a concept (internally or externally defined)
predicate
object representing the definition of a predicate that defines a relationship between two concepts
property
object representing the definition of a property to an object
string
object representing a text, name, URI, etc.
collection
object representing a set of objects

OntoDL System Objects

CTS2LE
system object for configuring how OntoDL interacts with a CTS2LE terminology server
OntoDL
system object for configuring the OntoDL Interpreter
FHIR
system object for controlling how the OntoDL Interpreter transforms your document to a set of FHIR resources