marklogic-8

How to query a graph of documents of different types at once in Marklogic?

独自空忆成欢 提交于 2019-12-23 04:52:56
问题 Background I'm using NoSql database supporting graphs for the first time. It is a huge medical application handling thousands of patients. It is a greenfield project and we as a team are struggling with our persistence layer. We don't know how relationships should be represented and if we should use Triples to handle queries involving huge amount of data. We are using Java API . Data structure Imagine that there are 3 types of JSON documents in our Marklogic database: Patient, Event, File

Marklogic scheduled backups failing

北城余情 提交于 2019-12-13 17:30:56
问题 We are currently using scheduled backups to have daily database backups. We are observing many problems in taking backups from past few days. The backup process executes for several hours but didn't get completed. We also had a look at the logs, but there is nothing mentioned for scheduled backup. We have following questions - By any means, can we make it more consistent and stop such things? Is there a way to get some kind of notification/email after the certain time if scheduled backup isn

Expanded tree cache full error need to tune the query

假如想象 提交于 2019-12-13 00:39:49
问题 Description: $enumValues will have sequence of strings that I have to look into $assetSubGroup will have a element value from XML (for loop) i.e string that I have to match in above maintained sequence If match is not, I have to hold few element values and return. All three of my attempts below are giving me expanded tree cache full errors. There are ~470000 assets i.e XML I'm querying. How can I tune these queries to avoid expanded tree cache errors? approach 1: let $query-name := "get-asset

Marklogic (Nodejs API) - Search documents that match 2 (or more) conditions in object array attribute

非 Y 不嫁゛ 提交于 2019-12-12 18:17:23
问题 My documents are stored in JSON in marklogic like this (I remove useless attributes for my case): { documentId: '', languages: [{ locale: 'en_UK', content: { translated: 'true', } }, { locale: 'de_DE', content: { translated: 'false', } }, {...}], } edit: It seem that my 'useless' attributes cause some problems. Here my detailed object. { documentId: '', /* 4 attrs */, languages: [{ locale: 'en_UK', attr: '', content: { /* 14 attrs */, translated: true, /* 2 or 4 attrs */, } }, { locale: 'de

Marklogic: Data do not comply with query

旧街凉风 提交于 2019-12-12 05:36:15
问题 Environment: NodeJS client, Marklogic 8 server. The query from NodeJS is: var query = qb.where( qb.directory('/root/dir/'), qb.scope( qb.property('sources'), qb.value('brand','MyBrand') ) ); The translated query is: { "whereClause": { "query": { "queries": [ { "directory-query": { "uri": [ "/root/dir/" ] } }, { "container-query": { "json-property": "sources", "value-query": { "json-property": "brand", "text": [ "MyBrand" ] } } } ] } }, "queryType": "structured", "queryFormat": "json" } The

path index is recognized by cts:path-reference when xpath contains namespace prefix

最后都变了- 提交于 2019-12-12 05:15:11
问题 If an element exists more than one places in a XML. Then it was difficult to sort the data on a particular element (by default docs will be sorted on the first element). I was able to solve this problem by defining a path-index and passing it to cts:path-reference query. But if the xpath contains a namespace prefix(namespace is defined for the xml) then cts:path-reference is not able to find the defined path-index . I am getting the below error. SEARCH-BADORDERBY: (err:FOER0000) Indexes are

How to do Selective Sorting by Attribute based on associated Value of Element or other Attribute in MarkLogic

人盡茶涼 提交于 2019-12-11 18:23:38
问题 Requirement: Resolve directly through Index, don't want to open the documents (Hence, Not considering FLOWR expression). Search results return a list of purchase order documents The purchase order may or may not have a line-item (for purposes of example) There can be thousands of line items for a purchase order, each with a different type There will only be 1 line-item for a type (no duplicates within the purchase order) For sorting: Based on one of the many types selected by user at the time

Marklogic - How to assign dynamic variable in Xquery

房东的猫 提交于 2019-12-11 14:44:07
问题 I have tried below mentioned XQuery . declare variable $path as xs:string :="D:\Mongo\"; let $uri :="/MJ/1932/Vol1/Part1/387.xml" let $x := fn:normalize-space(fn:replace($uri,"/"," ")) for $i in fn:tokenize($x, " ") let $j := fn:concat($path,$i) return($j) Actual output D:\Mongo\MJ D:\Mongo\1932 D:\Mongo\Vol1 D:\Mongo\Part1 D:\Mongo\387.xml Expected output D:\Mongo\MJ D:\Mongo\MJ\1932 D:\Mongo\MJ\1932\Vol1 D:\Mongo\MJ\1932\Vol1\Part1 D:\Mongo\MJ\1932\Vol1\Part1\387.xml Please Suggest me , how

search xmls which do not have particular element in marklogic

眉间皱痕 提交于 2019-12-11 07:28:07
问题 Let's assume I have inserted the below xml in the DB. <root> <name>Dixit</name> <entry> <vol>1212</vol> <title>title1</title> <isbn> <value>123456</value> </isbn> </entry> <entry> <vol>1212</vol> <title>title1</title> </entry> </root> How can I write a cts query which will return me the <entry> nodes with <vol> as 1212 & <title> as title1 & should not have <isbn> element. For the above xml the output should be. <entry> <vol>1212</vol> <title>title1</title> </entry> 回答1: One would normally use

How do I specify options in the SPARQL REST endpoint for MarkLogic?

有些话、适合烂在心里 提交于 2019-12-11 06:33:31
问题 When I query the SPARQL endpoint for marklogic, I am trying to specify the optimize option: /v1/graphs/sparql?options=optimize%3D2 This results in a 400 error: REST-INVALIDPARAM: (err:FOER0000) Invalid parameter: No configured options: optimize=2" What is the correct syntax to specify this and other options? Related: How can I optimize a SPARQL query that returns optional properties? 回答1: See reference for GET /v1/graphs/sparql. There is an "optimize" parameter you can specify. For example: