marklogic

Searching semantically tagged documents in MarkLogic

与世无争的帅哥 提交于 2019-12-11 09:07:30
问题 Can any one please point me to some simple examples of semantic tagging and querying semantically tagged documents in MarkLogic ? I am fairly new in this area,so some beginner level examples will do. 回答1: When you say "semantically tagged" do you mean regular XML documents that happen to have some triples in them? The discussion and examples at http://docs.marklogic.com/guide/semantics/embedded are pretty good for that. Start by enabling the triple index in your database. Then insert a test

How to Replace multiple nodes of XML in one go ? DATA HUB FRAMEWORK

落花浮王杯 提交于 2019-12-11 08:44:57
问题 I am having several documents in STAGING DB. Based on a condition i need to check if the document with same ID exist in FINAL. If it does then i need to replace the multiple nodes of document from STAGING to FINAL and then insert it. DOC from STAGING- <root> <ID>1</ID> <value1>India</value1> <value2>USA</value2> <value3>Russia</value3> <value4>Srilanka</value4> <value5>Europe</value5> <value6>Antartica</value6> <value7>Spain</value7> </root> DOC from FINAL- <root> <ID>1</ID> <value1></value1>

Marklogic - highlighting cts:element-attribute-range-query output

心已入冬 提交于 2019-12-11 08:42:50
问题 i am doing a cts:element-attribute-range-query and the results from it is working fine. But highlighting is not working for the output result. When i referred the search guide http://developer.marklogic.com/pubs/4.2/books/search-dev-guide.pdf i could see that cts:element-attribute-*-query outputs will not be suitable for cts:highlight function. I am using Marklogic 4.2. My application greatly depends on this highlighted output, Is there any way i can highlight the result output of cts:element

How to update nodes in a different Database or how to update external nodes ?- XDMP-UPEXTNODES

喜你入骨 提交于 2019-12-11 08:13:54
问题 I am trying to update a document in a different Database then my current DB. But it is giving me the below error- XDMP-UPEXTNODES: xdmp:node-replace(fn:doc("/C:/Users/Downloads/abc.csv-0-2")/*:envelope/*:root/*:Status, <Status>1000</Status>) -- Cannot update external nodes I am using the below code- let $temp := for $i in $result let $error := $i/*:envelope/*:ErrorMessage let $status := $i/*:envelope/*:Status return if(fn:exists($i) eq fn:true()) then ( xdmp:invoke-function( function() { xdmp

Implement For Loop in Marklogic Javascript?

落爺英雄遲暮 提交于 2019-12-11 07:55:56
问题 I can get all the URIs of the documents in a collection by using below XQuery: for $doc in fn:collection("transform") return xdmp:node-uri($doc) But, when I tried to implement this in a Javascript module in MarkLogic, it is getting only last document in the database collection. 'use strict'; declareUpdate() var docs = fn.collection("transform"); for(var doc of docs) { xdmp.nodeUri(doc) } It is not giving all the URIs in the collection, but rather it's only returning the last URI of the

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

MarkLogic node.js api - group by and sort by count

ぃ、小莉子 提交于 2019-12-11 06:34:51
问题 In a relational db you'd have something like "select name, count(1) as c from mytable group by name order by c desc". Basically I want to count how many records contain each name value and get the ones with highest counts first. Is there a way to do a similar thing in Marklogic using the Node.js API? 回答1: Something like this should work: var marklogic = require('marklogic'); var my = require('./my-connection.js'); var db = marklogic.createDatabaseClient(my.connInfo); var vb = marklogic

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:

How data is loaded and managed by a MarkLogic cluster

China☆狼群 提交于 2019-12-11 06:15:00
问题 I would like to enquire on how data is loaded into this clusters, do I load data separately into each node manually? Or is marklogic able to manage and transfer data among the cluster itself so all I need to do is to load data into a single node? For marklogic to understand and balanced the data between certain forests/databases is there a certain requirement? Such as a need for the forest and database to share the same name or the XDBC server to share the same port number? Finally, I would

MarkLogic - getting distinct values

旧时模样 提交于 2019-12-11 06:09:40
问题 I have a database containing XML documents that look roughly as such: <document> <question_item> <question>What is your name?</question> </question_item> <question_item> <question>What is your address?</question> </question_item> ... </document> I want to be able to take a search term and then return a distinct list of questions where that term is found e.g. searching for "name" with the data above, would return one result, "What is your name?". I have successfully implemented this with fn