marklogic

Does MarkLogic provides schematron support?

谁说我不能喝 提交于 2020-01-14 03:17:12
问题 I am using MarkLogic 8.0-8 version. Is it possible to validate an XML using schematron? Please help me with an example. 回答1: Yes, as of MarkLogic 9.0.7, there is built-in support for Schematron. http://docs.marklogic.com/schematron To use the schematron XQuery library module as part of your own XQuery module, include the following lines in your XQuery prolog: import module namespace schematron = "http://marklogic.com/xdmp/schematron" at "/MarkLogic/schematron/schematron.xqy"; For more

MarkLogic 10 - managed document throwing exception on dls:document-checkout-update-checkin

邮差的信 提交于 2020-01-07 09:37:09
问题 I have managed document named 123456.xml and I am trying to update it with dls library function as below, declare variable $uri:= "/abc/123456_xml_versions/1-123456.xml"; dls:document-is-managed($uri), dls:document-checkout-update-checkin($uri, $xml, 'Update', fn:true()) Above script snip is throwing below exception, [1.0-ml] DLS-DOCUMENTVERSION: (err:FOER0000) Cannot update or checkout document version /abc/123456_xml_versions/1-123456.xml This is an existing migration operation of the

MarkLogic - XQuery - cts:element-range-query using variable length sequence or map

血红的双手。 提交于 2020-01-07 04:14:31
问题 I have a collection of 100,000 records structured like this: <record> <pk>1</pk> <id>1234</id> </record> <record> <pk>2</pk> <id>1234</id> </record> <record> <pk>3</pk> <id>5678</id> </record> <record> <pk>4</pk> <id>5678</id> </record> I have setup a range index on id. I want to write a query in XQuery that will allow me to pass in a variable length sequence or map of id's and get back out all the records with those id's. It needs to be such that I can pass in any number of id's. Also, it

BIND values from Documents to a SPARQL Variable (MarkLogic)

杀马特。学长 韩版系。学妹 提交于 2020-01-06 07:01:26
问题 I am currently trying to see if it's possible to extract a certain value from a document and bind it to a variable in SPARQL For example if i have such a document in MarkLogic. /person/John <person_data> <name>John</name> <age>25</age> </person_data> using this data I attempted various ways to bind it such as using XPath in sem:sparql as shown below xquery version "1.0-ml"; import module namespace sem = "http://marklogic.com/semantics" at "/MarkLogic/semantics.xqy"; sem:sparql(' PREFIX fn :

BIND values from Documents to a SPARQL Variable (MarkLogic)

跟風遠走 提交于 2020-01-06 07:01:10
问题 I am currently trying to see if it's possible to extract a certain value from a document and bind it to a variable in SPARQL For example if i have such a document in MarkLogic. /person/John <person_data> <name>John</name> <age>25</age> </person_data> using this data I attempted various ways to bind it such as using XPath in sem:sparql as shown below xquery version "1.0-ml"; import module namespace sem = "http://marklogic.com/semantics" at "/MarkLogic/semantics.xqy"; sem:sparql(' PREFIX fn :

MarkLogic - Query Options with extract-document-data

不想你离开。 提交于 2020-01-06 03:47:27
问题 MarkLogic version 9.0-6.2 I am trying to extract a portion of the envelope (example given below) using extract-document-data in Query options. { "envelope": { "headers": { "audit": { "created-by": "admin", "last-updated-by": "*******" } }, "instance": { "UserId": "Test1", "UserName":"TestName" "Phones":[ { "PhoneType":"Home", "PhoneNum":"18009897800" }, { "PhoneType":"Cell", "PhoneNum":"1239897800" } ] } } } My requirement is just to return UserId and UserName. So I tried below code in

MarkLogic - query for documents where a specific json property is not defined

会有一股神秘感。 提交于 2020-01-05 07:13:18
问题 I'm using ML8. I have a bunch of json documents in the database. Some documents have a certain property "summaryData", something like: { ...(other stuff)... summaryData: { count: 100, total: 10000, summaryDate: (date value) } } However, not all documents have this property. I'd like to construct an SJS query to retrieve those documents that don't have this property defined. If it was SQL, I guess the equivalent would be something like "WHERE summaryData IS NULL" I wasn't sure what to search

Why is MarkLogic Definitely Storing Invalid Characters in XML Documents?

∥☆過路亽.° 提交于 2020-01-05 04:56:06
问题 I have found that it is possible to store invalid XML characters in XML documents in the MarkLogic database, which causes problems when I try to update the text in a document when it involved needing to quote and unquote the XML data. I now have example code that prove that invalid data can be stored. You can run this from Query Console, and you will get an error when trying to unquote the quotes string, due to the quoted string containing "&#14;", which was produced from the XML stored in

XQuery get Random Text from a List

纵然是瞬间 提交于 2020-01-05 03:30:11
问题 Suppose I have a list of 100 String Element and I want to get 50 of these random Text string to be returned Randomly. I try to do this: let $list := ("a","b",..."element number 100") return xdmp:random(100) This query return one string, I want to return back 50 strings that are distinct from each other. 回答1: Easiest to order by xdmp:random() and limit to the first 50: (for $x in (1 to 100) order by xdmp:random() return $x )[1 to 50] 回答2: xdmp:random() (as well as xdmp:elapsed-time() ) return

MarkLogic v1/transactions create by REST API

ぃ、小莉子 提交于 2020-01-04 14:27:20
问题 I have been trying to create a transaction via the MarkLogic REST API (/v1/transactions) using the Developer guidance here: https://docs.marklogic.com/REST/POST/v1/transactions When I try to call the transaction REST service to create a new transaction (I am using CURL), then I receive the following HTTP Response: curl -X POST -d "" -i --anyauth --user user:password http://localhost:7010/v1/transactions HTTP/1.1 401 Unauthorized WWW-Authenticate: Digest realm="public", ... Content-type: