Skip to content

Commit 68ce88e

Browse files
Adding multilingual documentation (#203)
1 parent 2943fed commit 68ce88e

File tree

1 file changed

+51
-21
lines changed

1 file changed

+51
-21
lines changed

guides/reference-guides/schema.md

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ The `@schema` keyword specifies the default URI expansion to use for all element
132132

133133
### @documentation
134134

135-
`@documentation` specifies documentation global to the entire schema. See the `@documentation` section in the previous [context object](schema.md#code-the-context-object) example. The documentation section contains the keywords:
135+
`@documentation` specifies documentation global to the entire schema. See the `@documentation` section in the previous [context object](schema.md#code-the-context-object) example. The `@documentation` tag can be a single value, or it can be a list with each element having an additional `@langugage` tag. The `@language` tag must have an IANA language code, and this will be used to select appropriate descriptions when internationalising the schema.
136+
137+
The documentation section contains the keywords:
136138

137139
#### @title
138140

@@ -158,9 +160,35 @@ If you would like to add arbitrary JSON structured metadata to a schema, you can
158160
}
159161
```
160162

161-
## Class keywords
163+
#### @language
164+
165+
If you use the `@language` code, specific documentation results can appear in different circumstances depending on the users language preferences.
166+
167+
An example of the `@language` tag for a context is as follows:
168+
169+
```json
170+
{ "@base": "terminusdb:///data/",
171+
"@schema": "terminusdb:///schema#",
172+
"@type": "@context",
173+
"@documentation" : [{
174+
"@language" : "en",
175+
"@title" : "Example Schema",
176+
"@description" : "This is an example schema. We are using it to demonstrate the ability to display information in multiple languages about the same semantic content.",
177+
"@authors" : ["Gavin Mendel-Gleason"]
178+
},
179+
{ "@language" : "ka",
180+
"@title" : "მაგალითი სქემა",
181+
"@description" : "ეს არის მაგალითის სქემა. ჩვენ ვიყენებთ მას, რათა ვაჩვენოთ ინფორმაციის მრავალ ენაზე ჩვენების შესაძლებლობა ერთი და იმავე სემანტიკური შინაარსის შესახებ.",
182+
"@authors" : ["გავინ მენდელ-გლისონი"]
183+
}
184+
],
185+
"xsd" : "http://www.w3.org/2001/XMLSchema#"
186+
}
187+
```
188+
189+
## Document definition keywords
162190

163-
A class definition includes several properties, and the keywords, prefixed `@`, describing class behavior.
191+
A document definition includes several properties, and the keywords, prefixed `@`, describing class behavior.
164192

165193
### @type
166194

@@ -177,6 +205,8 @@ If you would like to add arbitrary JSON structured metadata to a class, you can
177205
"name" : "xsd:string" }
178206
```
179207

208+
The three varieties of document are described below:
209+
180210
#### Class
181211

182212
`Class` designates a standard class document. It contains the definition of several properties and keywords describing various class attributes. An example of a class, and an instance of the class:
@@ -641,21 +671,21 @@ The `@comment` is the class description.
641671
The `@properties` keyword is a JSON object with pairs of the form:
642672

643673
```json
644-
{on
674+
{
645675
"property_1" : "description_1",
646-
676+
647677
...
648678

649-
"property_n" : "description_n"
679+
"property_n" : "description_n"
650680
}
651681
```
652682

653683
or with properties pointingn to JSON objects, as:
654684

655685
```json
656-
{
686+
{
657687
"property_1" : { "@label" : "description_1", "@comment" : "comment_1" },
658-
688+
659689
...
660690

661691
"property_n" : { "@label" : "description_2", "@comment" : "comment_2" }
@@ -671,39 +701,39 @@ or with properties pointingn to JSON objects, as:
671701
```json
672702
{
673703
"@type" : "@context",
674-
"@documentation" :
704+
"@documentation" :
675705
{
676706
"@title" : "The Ref schema",
677707
"@description" : "This is the Ref schema. It gives a specification for storage of references, branches and commits in our commit graph.",
678-
"@authors" :
708+
"@authors" :
679709
[
680-
"Gavin Mendel-Gleason",
710+
"Gavin Mendel-Gleason",
681711
"Matthijs van Otterdijk"
682712
]
683713
},
684714
"@base" : "terminusdb://ref/data/",
685715
"@schema" : "http://terminusdb.com/schema/ref#",
686716
"layer" : "http://terminusdb.com/schema/layer#",
687717
"layer_data" : "terminusdb://layer/data/",
688-
"xsd" : "http://www.w3.org/2001/XMLSchema#"
718+
"xsd" : "http://www.w3.org/2001/XMLSchema#"
689719
}
690-
{
720+
{
691721
"@id" : "layer:Layer",
692722
"@type" : "Class",
693-
"@documentation" :
723+
"@documentation" :
694724
{
695725
"@comment" : "A layer object which has the identifier used in storage.",
696-
"@properties" :
697-
{
698-
"layer:identifier" : "The layer identifier."
726+
"@properties" :
727+
{
728+
"layer:identifier" : "The layer identifier."
699729
}
700730
},
701731
"@base" : "layer_data:Layer_",
702-
"@key" :
703-
{
704-
"@type" : "ValueHash"
732+
"@key" :
733+
{
734+
"@type" : "ValueHash"
705735
},
706-
"layer:identifier" : "xsd:string"
736+
"layer:identifier" : "xsd:string"
707737
}
708738
```
709739

0 commit comments

Comments
 (0)