diff --git a/examples/uni-temporal-project/README.md b/examples/uni-temporal-project/README.md new file mode 100644 index 000000000..4f30f1614 --- /dev/null +++ b/examples/uni-temporal-project/README.md @@ -0,0 +1,20 @@ +This project shows how to deploy a sample uni-temporal config (without lsqt configuration) + +Note that (as of this version), the deployed temporal config cannot be changed except for the temporal collection option properties (refer to https://docs.marklogic.com/temporal:collection-set-options for possible values) + + +Once you have deployed the code, you can insert documents uni-temporally by doing the following + +```javascript +'use strict'; +declareUpdate(); +const temporal = require("/MarkLogic/temporal.xqy"); +const root = + {"tempdoc": + {"content": "content here", + systemStart: null, + systemEnd: null} + }; +temporal.documentInsert("uni-temporal-collection", "doc.json", root); +``` + diff --git a/examples/uni-temporal-project/build.gradle b/examples/uni-temporal-project/build.gradle new file mode 100644 index 000000000..67aa688fe --- /dev/null +++ b/examples/uni-temporal-project/build.gradle @@ -0,0 +1,3 @@ +plugins { + id "com.marklogic.ml-gradle" version "3.0.0" +} \ No newline at end of file diff --git a/examples/uni-temporal-project/gradle.properties b/examples/uni-temporal-project/gradle.properties new file mode 100644 index 000000000..074ed1b72 --- /dev/null +++ b/examples/uni-temporal-project/gradle.properties @@ -0,0 +1,6 @@ +mlHost=localhost +mlAppName=uni-temporal-project +mlRestPort=8400 +mlUsername=admin +mlPassword=admin + diff --git a/examples/uni-temporal-project/src/main/ml-config/databases/content-database.json b/examples/uni-temporal-project/src/main/ml-config/databases/content-database.json new file mode 100644 index 000000000..a02418210 --- /dev/null +++ b/examples/uni-temporal-project/src/main/ml-config/databases/content-database.json @@ -0,0 +1,23 @@ +{ + "database-name": "%%DATABASE%%", + "schema-database": "%%SCHEMAS_DATABASE%%", + "range-element-index": [ + { + "collation": "", + "invalid-values": "reject", + "localname": "systemStart", + "namespace-uri": "", + "range-value-positions": false, + "scalar-type": "dateTime" + } + , + { + "collation": "", + "invalid-values": "reject", + "localname": "systemEnd", + "namespace-uri": "", + "range-value-positions": false, + "scalar-type": "dateTime" + } + ] + } \ No newline at end of file diff --git a/examples/uni-temporal-project/src/main/ml-config/databases/schemas-database.json b/examples/uni-temporal-project/src/main/ml-config/databases/schemas-database.json new file mode 100644 index 000000000..b3c1b3f9e --- /dev/null +++ b/examples/uni-temporal-project/src/main/ml-config/databases/schemas-database.json @@ -0,0 +1,3 @@ +{ + "database-name": "%%SCHEMAS_DATABASE%%" +} \ No newline at end of file diff --git a/examples/uni-temporal-project/src/main/ml-config/temporal/axes/temporal-system-axis.json b/examples/uni-temporal-project/src/main/ml-config/temporal/axes/temporal-system-axis.json new file mode 100644 index 000000000..8a8cd7127 --- /dev/null +++ b/examples/uni-temporal-project/src/main/ml-config/temporal/axes/temporal-system-axis.json @@ -0,0 +1,15 @@ +{ + "axis-name": "system", + "axis-start": { + "element-reference": { + "namespace-uri": "", + "localname": "systemStart" + } + }, + "axis-end": { + "element-reference": { + "namespace-uri": "", + "localname": "systemEnd" + } + } +} \ No newline at end of file diff --git a/examples/uni-temporal-project/src/main/ml-config/temporal/collections/uni-temporal-collection.json b/examples/uni-temporal-project/src/main/ml-config/temporal/collections/uni-temporal-collection.json new file mode 100644 index 000000000..cb23ef50c --- /dev/null +++ b/examples/uni-temporal-project/src/main/ml-config/temporal/collections/uni-temporal-collection.json @@ -0,0 +1,5 @@ +{ + "collection-name": "uni-temporal-collection", + "system-axis": "system", + "option": ["updates-safe"] +} \ No newline at end of file