Cannot create a valid axes in MarkLogic for temporal document upload

26 views Asked by At

I am trying to implement the bitemporal feature of MarkLogic in a MarkLogic database. For that what I understood is we need to upload the documents in a temporal collection. And we have to first create valid and system axes to define the collection.

I am writing this XQuery to create the valid axes, but getting below error. Note that I have defined the range element index in the MarkLogic server already for the Schema Database, the database where I am trying to create the axes.

Query:

xquery version "1.0-ml"; 
import module namespace temporal = "http://marklogic.com/xdmp/temporal" 
    at "/MarkLogic/temporal.xqy";
temporal:axis-create("valid", cts:element-reference(xs:QName("validStart")),
cts:element-reference(xs:QName("validEnd")))

Error:

[1.0-ml] TEMPORAL-NOSCHEMADB: (err:FOER0000) No schema database for temporal resource: valid

Stack Trace In /MarkLogic/temporal.xqy on line 51 In temporal:axis-create("valid", cts:element-reference(fn:QName("","validStart"),("type=dateTime")), cts:element-reference(fn:QName("","validEnd"),("type=dateTime"))) In temporal:axis-create("valid", cts:element-reference(fn:QName("","validStart"),("type=dateTime")), cts:element-reference(fn:QName("","validEnd"),("type=dateTime")))

1

There are 1 answers

1
Mads Hansen On BEST ANSWER

The error is telling you that there is no schema database associated with your content database.

Verify that your content database has a Schema database associated with it. For instance, verifying the "Documents" database Schema:

import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";
admin:database-get-schema-database(admin:get-configuration(), xdmp:database("Documents"))