Loading TOC...

es functions

The table below lists all the es built-in functions (in this namespace: http://marklogic.com/entity-services).

You can also view these functions broken down by category:

This module contains the Entity Services API, which enables you to define logical entity-relationship models and instantiate them for use in your applications. For details, see the Entity Services Developer's Guide.

To use the es module as part of your own XQuery module, include the following line in your XQuery prolog:

import module namespace es = "http://marklogic.com/entity-services" at "/MarkLogic/entity-services/entity-services.xqy";

The library namespace prefix es is not predefined in the server.

24 functions
Function name Description
es:add-attachments A utility function used by generated code to add one or more nodes to an instance as attachments.
es:copy-attachments A utility function used in a generated version translator module to copy attachment data from a source instance to a destination instance.
es:database-properties-generate Generate a database configuration artifact from a basic model.
es:extract-array Convert one or more source nodes into an array by invoking a function on each of the elements.
es:extraction-template-generate Generate a Template Driven Extraction (TDE) template you can use to render entity instance data into rows for querying with the Optic API or SQL.
es:init-instance A utility function used by generated code to initialize an instance data structure with data common across all entities of a given type, such as a type indicator.
es:init-source Return the root node of an entity instance or document.
es:init-translation-source A utility function used in a generated version translator module to initialize the context for converting instances from one version to another.
es:instance-converter-generate Generate an XQuery library module containing stub code for converting source data to entity instances.
es:instance-from-document Extract an in-memory entity instance from its envelope document as a map:map () .
es:instance-get-attachments Extract attachments from an entity service document.
es:instance-json-from-document Extract an entity instance from its envelope document, as JSON.
es:instance-xml-from-document Extract a canonical entity instance from its envelope document, as XML.
es:model-from-xml Create a basic model from an XML model descriptor, without validating the input descriptor for correctness.
es:model-get-test-instances Generate entity instances of each entity type in a basic model.
es:model-to-xml Serialize a basic model as an XML element.
es:model-validate Validates an entity services model descriptor.
es:optional Add a key-value pair to a map, if the value exists, and return the modified input map.
es:pii-generate Generate an Element Level Security configuration artifact for controlling access to entity properties designated as PII in the model.
es:schema-generate Generate an XSD schema that can be used to validate instance data.
es:search-options-generate Generate a set of query options that can be used to query your entity instances using several MarkLogic server-side and client APIs.
es:serialize-attachments A utility function used to serialize the attachments on an instance into either JSON or XML envelopes.
es:version-translator-generate Generate a module that can be used to translate instances conforming to one version of a model into instances conforming to another version
es:with-namespace A utility function used to decorate an XML instance with namespace information during extraction.