Loading TOC...

sem.store

sem.store(
   [options as String[]],
   [query as cts.query?]
) as sem.store

Summary

The sem:store function defines a set of criteria, that when evaluated, selects a set of triples to be passed in to sem:sparql(), sem:sparql-update(), or sem:sparql-values() as part of the options argument. The sem:store constructor queries from the current database's triple index, restricted by the options and the cts:query argument (for instance, "triples in documents matching this query").

This function is a built-in.

Parameters
options Options as a sequence of string values. Available options are:
"any"
Values from any fragment should be included.
"document"
Values from document fragments should be included.
"properties"
Values from properties fragments should be included.
"locks"
Values from locks fragments should be included.
"checked"
Word positions should be checked when resolving the query.
"unchecked"
Word positions should not be checked when resolving the query.
"size=number of MB"
The maximum size of the memory used to cache inferred triples. This defaults to the default inference size set for the app-server. If the value provided is bigger than the maximum inference size set for the App Server, an error is raised [XDMP-INFSIZE].
"no-default-rulesets"
Don't apply the database's default rulesets to the sem:store.
"locking=read-write/write"
read-write: Read-lock documents containing triples being accessed, write-lock documents being updated; write: Only write-lock documents being updated. Default is locking=read-write. Locking is ignored in query transaction.
query Only include triples in fragments selected by the cts:query. The triples do not need to match the query, but they must occur in fragments selected by the query. The fragments are not filtered to ensure they match the query, but instead selected in the same manner as "unfiltered" cts:search operations. If a string is entered, the string is treated as a cts:word-query of the specified string.

Usage Notes

Only one of "any", "document", "properties", or "locks" may be specified in the options parameter. If none of "any", "document", "properties", or "locks" are specified and there is a $query parameter, then the default is "document". If there is no $query parameter then the default is "any".

Options for "any", "document", "properties", "locks", "checked", or "unchecked" must be specified as part of sem:store, not as part of sem:sparql, sem:sparql-update, or sem:sparql-values.

Example

var sem = require("/MarkLogic/semantics.xqy");

sem.store(null, cts.wordQuery("Alfa Romeo"));
=>
Returns a sem:store() containing all of the triples that exist in documents
that match a query for "Alfa Romeo".

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.