OwS Style Sheet Directive: heading: Unterschied zwischen den Versionen

Aus CTS2-LE
Zur Navigation springen Zur Suche springen
(Linking MS Word Sections and Definition Scopes)
(Examples)
Zeile 157: Zeile 157:
 
== Examples ==
 
== Examples ==
  
<hr>
+
Within the context of the tutorial examples and hints for using the #heading directive are given in these lessons:
{|style="background:#fcfcfc"
+
* [[OwS Tutorial: Mapping Concept Hierarchies onto Word Sections|Using Heading Styles]]: some general information and examples
|- style="background:#e8e8e8"
+
* [[OwS Tutorial: Defining Custom Types|Defining Custom Types]]: example for using the #heading directive for creating objects of a custom type
! style="text-align:left; width:6em" | Style Sheet !! &nbsp;&nbsp;&nbsp;&nbsp; !! style="text-align:left; width:35em" | Text !! &nbsp;&nbsp;&nbsp;&nbsp; !! style="text-align:left" | ''Comment''
 
|- style="vertical-align:top"
 
| OwS|| ||style="background:#f4f6f6"| <span style="font-family:Courier;font-size:110%">#heading 2 codesystem .Name ( .URI)</span>|| || Level 2 chapters are terminology definitions. The heading gives the name of the terminology and (in parentheses) the URI of the terminology.
 
|- style="vertical-align:top"
 
| OwS|| ||style="background:#f4f6f6"| <span style="font-family:Courier;font-size:110%">#heading 3-4 concept .Display ( .Name )</span>|| || Level 3 sections are concept definitions within the terminology that coresponds to the superordinate level 2 chapter. Level 4 sections define subconcepts within the concepts defined by level 3 section. Level 3 and 4 headlines provide the display text of a concept together with its code (in parentheses).
 
|- style="vertical-align:top"
 
| Überschrift 2|| ||style="background:#f4f6f6"| <span style="font-family:Arial;font-size:120%">'''Clinics and Wards  (http://hospital.com/clinics)'''</span>|| || A terminology "Clinics and Wards" is defined. The definition scope of the codesystem objects reaches until the end of the level-2 chapter.
 
|- style="vertical-align:top"
 
| Überschrift 3|| ||style="background:#f4f6f6"| <span style="font-family:Arial;font-size:110%">'''Cardiologic Clinic, Prof. Smyth (cardiologic clinic) '''</span>|| || A concept "cordiologic clinic" is defined. The definiton scope of this concept reaches until the end of the level-3 section.
 
|- style="vertical-align:top"
 
| Überschrift 4|| ||style="background:#f4f6f6"| &nbsp;&nbsp;&nbsp;<span style="font-family:Arial;font-size:100%">'''''Cardiologic care ward for Women and Children (ward 51.1) '''''</span>|| || A concept "ward 51.1" is defined as a subconcept of "cardiologic clinic".
 
|- style="vertical-align:top"
 
| Überschrift 4|| ||style="background:#f4f6f6"| &nbsp;&nbsp;&nbsp;<span style="font-family:Arial;font-size:100%">'''''Cardiologic care ward for Intensive Care (ward 51.2) '''''</span>|| ||
 
|- style="vertical-align:top"
 
| Überschrift 3|| ||style="background:#f4f6f6"| <span style="font-family:Arial;font-size:110%">'''Orthopedic Clinic, Prof. Miller (orthopedic clinic) '''</span>|| || Another concept within the terminology "Clinics and Wards". This concept sets up a new definition scope within the definition scope of "Clinics and Wards".
 
|- style="vertical-align:top"
 
| Überschrift 4|| ||style="background:#f4f6f6"| &nbsp;&nbsp;&nbsp;<span style="font-family:Arial;font-size:100%">'''''Orthopedic care ward for knee and hip patients (ward 52.1)'''''</span>|| ||
 
|}
 
<hr>
 

Version vom 30. Dezember 2016, 12:07 Uhr

Syntax

HeadingDirective := #heading Level TypeName Mask  
| #heading Level
Level := [1-9](-[1-9])?


Description

The #heading directive considers a MS Word chapter or section as an OwS object definition. The #heading directive takes 3 arguments:

argument description
Level The heading levels that trigger the directive. E.g. if "2-4" is provided for this argument, the directive only applies to MS Word headlines which are formatted by style sheets that are registered as level-2, level-3 and level-4 headings.
TypeName The type of the object that shall be created and defined by the headline text and the section/chapter assigned to that headline. As well OwS buildin types as custom types may be devined through the #heading directive.
Mask Pattern that defines how properties of the newly defined object are provided within the headline text.

Defining the Headline Text Pattern

The Mask argument is a sequence of OwS property names and non-interpreted text. Property names shall start with a dot (.) and denote a property that is defined for the object that is to be created. Property names and non-interpreted text shall alternate within the mask. Non-interpreted text shall not include dots (because otherwise the OwS Tokenizer would consider the word following the dot as a property name). The table below gives some examples for valid mask definitions:

mask typename example headline text equivalent to
.Name codesystem Ingredients and Tools
define codesystem (Ingredients and Tools) { ... } 
.Name and Tools codesystem Ingredients and Tools
define codesystem (Ingredients) { ... } 
Ingredients and .Name codesystem Ingredients and Tools
define codesystem (Tools) { ... } 
.Name ( .Display ) concept sugar white (White Sugar)
define concept (sugar white) {
  set .Display = (White Sugar)
  ... 
} 
.Name : .Code ( .Designation[Language=de] ) concept sugar white:37 (Zucker)
define concept (sugar white) {
  set .Code = (37)
  set .Designation[Language=de] = (Zucker)
  ... 
} 

The following restrictions apply:

  • when defining a codesystem, property, predicate or type, the Name-property shall be provided as part of the headline text
  • when defining a concept, either the Name- or the Code-property shall be provided as part of the headline text. If only a Code is provided, the code of the concept is also used as the name of the concept.

Linking MS Word Sections and Definition Scopes

Each object definition has its definition scope. When defining an object through the #heading directive the defined object's definition scope corresponds to the scope of the section that was opened with the heading.

The example below shows this correspondence of MS Word sections/chapters and OwS definition scopes.


Style Sheet   Text   Translates to Comment
OwS
#heading 2 codesystem .Name
The OwS Macro interpreter is advised to generate codesystem definitions from level-2 headings. The text of the respective headlines shall be taken as the value of the codesystem's Name property (which is as well the name of the codesystem).
OwS
#heading 3-4 concept .Name
The OwS Macro interpreter is advised to generate concept definitions from level-3 and level-4 headings. The text of the respective headlines shall be taken as the value of the concept's Name property (which is as well the name of the concept).
OwS
Überschrift 2
Animals
define codesystem (Animals) { We are entering a level-2 chapter within the document. Everything within this chapter is part of the definition scope of the corresponding codesystem definition.
Überschrift 3
Mammals
  define concept (Mammals) { We are entering a level-3 section within the document. Everything within this section is part of the definition scope of the concept named "Mammals".
Überschrift 4
Lion
    define concept (Lion) { We are entering a level-4 section within the document. Everything within this section is part of the definition scope of the concept "Lion". As the level-4 section is within the level-3 section the concept "Lion" is defined within the definition scope oft he concept "Mammals" which makes it a sub-concept of "Mammals".
Überschrift 4
Elephant
    }
    define concept (Elephant) {
The definiton scope of "Lion" is closed due to the beginning of a new level-4 section. The concept "Elephant" is defined within the definition scope of the concept "Mammals" which makes it another sub-concept of this concept.
Überschrift 3
Birds
  } }
  define concept (Birds) {
While beginning a new level-3 section, the definition scopes associated to the open level-4 section ("Elephant") and level-3 section ("Mammals") are closed.
Überschrift 4
Penguin
    define concept (Penguin) {
Standard
} } } The text ends. All open definition scopes ("Penguin", "Birds" and "Animals") are closed.

Examples

Within the context of the tutorial examples and hints for using the #heading directive are given in these lessons: