Skip to content

Commit b17b143

Browse files
committed
Fix doc formatting for schema-init-strategies CTR
Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
1 parent 0cb87d3 commit b17b143

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

docs/schema/schema-init-strategies.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ file path to `schema.init.json.file` or directly insert JSON schema into
3131
Schema defined via JSON must be a deserialized JSON version of
3232
`org.janusgraph.core.schema.json.definition.JsonSchemaDefinition` class where top
3333
level object elements will be the following:
34+
3435
- `vertexLabels`
3536
- `edgeLabels`
3637
- `propertyKeys`
@@ -46,6 +47,7 @@ or mixed indexes.
4647
#### JSON Vertex Label Definition
4748

4849
Each vertex label object consists of the following keys:
50+
4951
- `label` - `string` datatype. (**Required**)
5052
- `staticVertex` - `boolean` datatype.
5153
- `partition` - `boolean` datatype.
@@ -54,6 +56,7 @@ Each vertex label object consists of the following keys:
5456
#### JSON Edge Label Definition
5557

5658
Each edge label object consists of the following keys:
59+
5760
- `label` - `string` datatype. (**Required**)
5861
- `multiplicity` - `string` datatype. Allowed values: `MULTI`, `SIMPLE`, `ONE2MANY`, `MANY2ONE`, `ONE2ONE`.
5962
- `unidirected` - `boolean` datatype.
@@ -62,6 +65,7 @@ Each edge label object consists of the following keys:
6265
#### JSON Property Key Definition
6366

6467
Each property key object consists of the following keys:
68+
6569
- `key` - `string` datatype. (**Required**)
6670
- `className` - `string` datatype. This must be a full class path of the selected property datatype. For example, `java.lang.String`, `java.lang.Long`,`org.janusgraph.core.attribute.Geoshape`. (**Required**)
6771
- `cardinality` - `string` datatype. Allowed values: `SINGLE`, `LIST`, `SET`.
@@ -70,17 +74,19 @@ Each property key object consists of the following keys:
7074
#### JSON Composite Index Definition
7175

7276
Each composite index object consists of the following keys:
77+
7378
- `name` - `string` datatype. (**Required**)
7479
- `typeClass` - `string` datatype. Full class path of the datatype of an indexed element. Allowed values: `org.apache.tinkerpop.gremlin.structure.Vertex`, `org.apache.tinkerpop.gremlin.structure.Edge`. (**Required**)
7580
- `indexOnly` - `string` datatype. Vertex or Edge label.
7681
- `unique` - `boolean` datatype.
7782
- `consistency` - `string` datatype. Allowed values: `DEFAULT`, `LOCK`, `FORK`.
7883
- `keys` - an array of objects representing `org.janusgraph.core.schema.json.definition.index.JsonIndexedPropertyKeyDefinition` (see definition below after indexes definition). These are used index keys. (**Required**)
79-
- `inlinePropertyKeys` - an array of property keys to be inlined into the composite index. Currently supported for vertex composite indexes only. See [documentation](./schema/index-management/index-performance.md#inlining-vertex-properties-into-a-composite-index) for more information about this feature.
84+
- `inlinePropertyKeys` - an array of property keys to be inlined into the composite index. Currently supported for vertex composite indexes only. See [documentation](./index-management/index-performance.md#inlining-vertex-properties-into-a-composite-index) for more information about this feature.
8085

8186
#### JSON Mixed Index Definition
8287

8388
Each mixed index object consists of the following keys:
89+
8490
- `name` - `string` datatype. (**Required**)
8591
- `typeClass` - `string` datatype. Full class path of the datatype of an indexed element. Allowed values: `org.apache.tinkerpop.gremlin.structure.Vertex`, `org.apache.tinkerpop.gremlin.structure.Edge`. (**Required**)
8692
- `indexOnly` - `string` datatype. Vertex or Edge label.
@@ -90,6 +96,7 @@ Each mixed index object consists of the following keys:
9096
#### JSON Vertex-Centric Edge Index Definition
9197

9298
Each vertex-centric edge index object consists of the following keys:
99+
93100
- `name` - `string` datatype. (**Required**)
94101
- `propertyKeys` - an array of strings (each value has `string` datatype). These are the Edge properties which will be used for the index. (**Required**)
95102
- `order` - `string` datatype. Allowed values: `asc`, `desc`.
@@ -99,6 +106,7 @@ Each vertex-centric edge index object consists of the following keys:
99106
#### JSON Vertex-Centric Property Index Definition
100107

101108
Each vertex-centric property index object consists of the following keys:
109+
102110
- `name` - `string` datatype. (**Required**)
103111
- `propertyKeys` - an array of strings (each value has `string` datatype). These are the meta-properties which will be used for the index. (**Required**)
104112
- `order` - `string` datatype. Allowed values: `asc`, `desc`.
@@ -107,17 +115,20 @@ Each vertex-centric property index object consists of the following keys:
107115
#### JSON Definition of Property Keys defined in Composite and Mixed indexes (`keys`)
108116

109117
Each property key object defined as `keys` representation of composite or mixed index consists of the following keys:
118+
110119
- `propertyKey` - `string` datatype. (**Required**)
111120
- `parameters` - an array of objects representing `org.janusgraph.core.schema.json.definition.JsonParameterDefinition`. These are optional parameters to let index know of additional configurations for the property key. (See description below)
112121

113122
#### JSON Definition of Parameters defined in Property Keys for Composite and Mixed indexes (`parameters`)
114123

115124
Each parameter is a configuration for to let underlying index backend configure relative properties better. Each such parameter consists of the following keys:
125+
116126
- `key` - `string` datatype. (**Required**)
117127
- `value` - `string` datatype. (**Required**)
118128
- `parser` - `string` datatype. This must be a full class pass of the parser which will be used to parse `value` of the parameter or a pre-defined shortcut. This parser must implement `org.janusgraph.core.schema.json.parser.JsonParameterParser` interface and have a parameterless constructor. If none is provided then `string` parser is used by default.
119129

120130
Pre-defined `parser` shortcuts:
131+
121132
- `string` - doesn't change `value` and uses it as is (`String` datatype).
122133
- `enum` - replaces the provided string (defined as `<full class path>.<enum option>`) to actual enum value.
123134
For example, if `value` has a string `org.janusgraph.core.schema.Mapping.STRING` it will be replaced to actual `STRING` enum,
@@ -393,6 +404,7 @@ Following the rules above (defined in `JSON Schema Format`) an example of JSON s
393404

394405
Currently, JSON schema initialization flow is simple and doesn't include any schema update or schema migration features.
395406
The flow is split on multiple phases:
407+
396408
1) Creation of simple elements: `PropertyKey`, `VertexLabel`, `EdgeLabel`.
397409
2) Creation of indices: Composite indexes, Vertex-centric Edge indexes, Vertex-centric Property indexes, Mixed indexes.
398410
3) Indexes activation phase (configured via `schema.init.json.indices-activation`).
@@ -430,5 +442,6 @@ JsonSchemaInitStrategy.initializeSchemaFromString(graph, "{ \"vertexLabels\": [
430442

431443
Also, there are additional `initializeSchemaFromFile` and `initializeSchemaFromString` methods where it's possible to
432444
provide all configuration options directly instead of fetching them from the configuration of the graph:
445+
433446
- `initializeSchemaFromFile(JanusGraph graph, boolean createSchemaElements, boolean createSchemaIndices, IndicesActivationType indicesActivationType, boolean forceRollBackActiveTransactions, boolean forceCloseOtherInstances, long indexStatusTimeout, String jsonSchemaFilePath)`
434447
- `initializeSchemaFromString(JanusGraph graph, boolean createSchemaElements, boolean createSchemaIndices, IndicesActivationType indicesActivationType, boolean forceRollBackActiveTransactions, boolean forceCloseOtherInstances, long indexStatusTimeout, String jsonSchemaString)`

0 commit comments

Comments
 (0)