manoj viswanadha | 21 Jul 13:14 2014
Picon

[MarkLogic Dev General] JSON issue with REST API

Hi all,

I am facing some issue with json response using ML-7 REST API.

I am using tranformations using REST API options to convert xml to json. In ML-6 i am able the get the pure json response but in ML-7 i am getting JSON response as string. Because of that double quotes (" ") its not coming as perfect json response. Is there any way to escape these double quotes in ML-7.

expected-result:

{name : "testing"}


result in ML-7 rest API: 

"{name:"testing"}"


Thanks,
Manoj Viswanadha
Cognizant Technology Solutions
Hyderabad.


 
<div><div dir="ltr">Hi all,<div><br></div>
<div>I am facing some issue with json response using ML-7 REST API.</div>
<div><br></div>
<div>I am using tranformations using REST API options to convert xml to json. In ML-6 i am able the get the pure json response but in ML-7 i am getting JSON response as string. Because of that double quotes (" ") its not coming as perfect json response. Is there any way to escape these double quotes in ML-7.</div>
<div><br></div>
<div>expected-result:</div>
<div><br></div>
<div>{name : "testing"}</div>
<div><br></div>
<div><br></div>
<div>result in ML-7 rest API:&nbsp;</div>
<div><br></div>
<div>"{name:"testing"}"</div>
<div><br></div>
<div><br></div>
<div>Thanks,</div>
<div>Manoj Viswanadha</div>
<div>Cognizant Technology Solutions</div>
<div>Hyderabad.</div>
<div><br></div>
<div><br></div>
<div>&nbsp;</div>
</div></div>
Harry Bakken | 18 Jul 17:34 2014
Picon

[MarkLogic Dev General] Documentation/Examples for cts:count-aggregate

Is there anyone out there that can point me to some good examples/use cases or documentation for cts:count-aggregate() and even cts:aggregate()?

The API doc is sort of vague, but I think one or both of these functions can help me with a problem I am trying to solve. I haven't been able to figure out exactly how, though.

Thanks in advance,
Harry


<div><div dir="ltr">Is there anyone out there that can point me to some good examples/use cases or documentation for cts:count-aggregate() and even cts:aggregate()?<div><br></div>
<div>The API doc is sort of vague, but I think one or both of these functions can help me with a problem I am trying to solve. I haven't been able to figure out exactly how, though.</div>
<div><br></div>
<div>Thanks in advance,</div>
<div>Harry</div>
<div><br></div>
<div><br></div>
</div></div>
Sujith | 17 Jul 17:20 2014
Picon

[MarkLogic Dev General] MD5 - Hash Question

What is the default encoding that ML uses for xdmp:quote(). 

There is a daily job that loads hadoop ( Cloudera Dist ) with the files that we have in ML using mlcp. Now we want to compare if both of them are in Sync, so we are using md5 hash for validation. Initially we provided Hadoop with our Hash and they came back saying that it didn't match with their data. After doing some analysis we figured out that we should explicitly specify the encoding as UTF-8   option in xdmp:quote as Java Program on their end is doing the same. 

(: The Hash that didnot match :) 

xquery version "1.0-ml";

xdmp:md5(xdmp:quote(fn:doc("/sample.xml") ) 



In other words what would be the default encoding xdmp:quote uses ( My assumpotion is that by Default ML saves Data as UTF-8 encoding is no encoding is specified and while it retrieves the documents the same would be used. ) 


(: the Hash that Match :)

xquery version "1.0-ml";

xdmp:md5(xdmp:quote(fn:doc("/sample.xml"),<options xmlns="xdmp:quote">

      <output-encoding>utf-8</output-encoding>

      <omit-xml-declaration>yes</omit-xml-declaration>

    </options>))


Any insight is very much appreciated. 


--
Thanks & Regards
SujithMaram


<div><div dir="ltr">What is the default encoding that ML uses for xdmp:quote().&nbsp;<div><br></div>
<div>There is a daily job that loads hadoop ( Cloudera Dist ) with the files that we have in ML using mlcp. Now we want to compare if both of them are in Sync, so we are using md5 hash for validation. Initially we provided Hadoop with our Hash and they came back saying that it didn't match with their data. After doing some analysis we figured out that we should explicitly specify the encoding as UTF-8 &nbsp; option in xdmp:quote as Java Program on their end is doing the same.&nbsp;</div>

<div><br></div>
<div>(: The Hash that didnot match :)&nbsp;</div>
<div>
<p class="MsoNormal">xquery version "1.0-ml";</p>
<p class="MsoNormal">xdmp:md5(xdmp:quote(fn:doc("/sample.xml") )&nbsp;</p>
<p class="MsoNormal">

<br></p>
<p class="MsoNormal"><br></p>
</div>
<div>In other words what would be the default encoding xdmp:quote uses ( My assumpotion is that by Default ML saves Data as UTF-8 encoding is no encoding is specified and while it retrieves the documents the same would be used. )&nbsp;</div>

<div><br></div>
<div><br></div>
<div>(: the Hash that Match :)</div>
<div><br></div>
<div>
<p class="MsoNormal">xquery version "1.0-ml";</p>

<p class="MsoNormal">xdmp:md5(xdmp:quote(fn:doc("/sample.xml"),&lt;options
xmlns="xdmp:quote"&gt;</p>

<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;output-encoding&gt;utf-8&lt;/output-encoding&gt;</p>

<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;omit-xml-declaration&gt;yes&lt;/omit-xml-declaration&gt;</p>

<p class="MsoNormal">&nbsp;&nbsp;&nbsp; &lt;/options&gt;))</p>
</div>
<div><br></div>
<div>Any insight is very much appreciated.&nbsp;</div>
<div><br></div>
<div><br></div>
<div>-- <br><div dir="ltr">Thanks &amp; Regards<br>SujithMaram<br><br><br>
</div>
</div>
</div></div>
Jakob Fix | 15 Jul 19:30 2014
Picon

[MarkLogic Dev General] how to tune marklogic efficiently?

Hello,

we're running MarkLogic 7.0-3 in a production environment (although it's Windows 2012 ...), with 8Gb of RAM and only few data (think megabytes rather than gigabytes). not all of the memory is even used, and we wonder how to get ML to make use of all of what's available. even though only about 2Gb are used by ML, we get XDMP-EXPNTREECACHEFULL errors, and yes, we've seen [1].

As an example, in the Admin UI we see the possbility to change this value, but there is no guidance as to what the ratio should be between the data in the database, the required expanded tree cache and the overall memory.

This is just one case where we are confronted with all the values of the different caches (list, compressed tree, expanded tree, triple and its interaction with other configuration parameters such as indexes, lexicons etc.).

So, basically I guess my question is where can we learn more about the correct use of these parameters? I couldn't see a free online class for this, and the query tuning guide's sections on caches [2] and other more low-level parameters are rather succinct.

<div><div dir="ltr">Hello,<br><br><div>we're running MarkLogic 7.0-3 in a production environment (although it's Windows 2012 ...), with 8Gb of RAM and only few data (think megabytes rather than gigabytes). not all of the memory is even used, and we wonder how to get ML to make use of all of what's available. even though only about 2Gb are used by ML, we get XDMP-EXPNTREECACHEFULL errors, and yes, we've seen [1].</div>

<div><br></div>
<div>As an example, in the Admin UI we see the possbility to change this value, but there is no guidance as to what the ratio should be between the data in the database, the required expanded tree cache and the overall memory.<br>
</div>
<div><br></div>
<div>This is just one case where we are confronted with all the values of the different caches (list, compressed tree, expanded tree, triple and its interaction with other configuration parameters such as indexes, lexicons etc.).</div>

<div><br></div>
<div>So, basically I guess my question is where can we learn more about the correct use of these parameters? I couldn't see a free online class for this, and the query tuning guide's sections on caches&nbsp;[2]&nbsp;and other more low-level parameters are rather succinct.</div>

<div><br></div>
<div><div><div>
<div>cheers,<br>Jakob.</div>
<div><br></div>
<div>[1]&nbsp;<a href="https://help.marklogic.com/Knowledgebase/Article/View/9/0/resolving-xdmp-expntreecachefull-errors">https://help.marklogic.com/Knowledgebase/Article/View/9/0/resolving-xdmp-expntreecachefull-errors</a>&nbsp;</div>

</div></div></div>
<div>[2]&nbsp;<a href="http://docs.marklogic.com/guide/performance/perftune#id_56362">http://docs.marklogic.com/guide/performance/perftune#id_56362</a><br>
</div>
</div></div>
"neil bradley" | 15 Jul 10:55 2014
Picon

[MarkLogic Dev General] Is fn prefix now optional in library modules?

Hi,

For a long time I have written XQuery code in MarkLogic and seen error
messages whenever I forgot to add the “fn:” prefix to XPath functions
within library modules.

Recently (since moving to ML 7 I believe) I have not seen those
errors, so I just thought I was getting better at remembering to add
the prefix.

But then my code was run on an ML 6 instance, a number of the old
errors appeared, revealing that I was still occasionally forgetting
the prefix.

So is it the case that ML 7 is simply become tolerant of missing fn:
prefixes in library modules? If so, is there a way to return to the
“strict” mode so that I know my code will run on ML 6?

Thanks,

Neil.
_______________________________________________
General mailing list
General <at> developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
cory cardio | 13 Jul 23:14 2014
Picon

[MarkLogic Dev General] finally ready to customize

hello,

  Was hoping to get some help on customizing an app. I built the app with app builder on CentOS 6.5 VM. It's deployed and looks great, but now I am ready to mess with JS & CSS.

  I've combed some tutorials and the docs for app extension and webdav, but I am unable to get cadaver installed on the centOS instance. I successfully downloaded the application/ dir using wget. ( I noticed I had custom/app.js and custom/app.js<bunch-of-numbers>. ? )

  I edited the app.js and tried to use curl to put it back into the webdav/database. I receive "Method not allowed".

  How can I smooth out this process?

Thank you
c
<div><div dir="ltr">
<div>
<div>
<div>
<div>hello, <br><br>
</div>&nbsp; Was hoping to get some help on customizing an app. I built the app with app builder on CentOS 6.5 VM. It's deployed and looks great, but now I am ready to mess with JS &amp; CSS. <br><br>
</div>&nbsp; I've combed some tutorials and the docs for app extension and webdav, but I am unable to get cadaver installed on the centOS instance. I successfully downloaded the application/ dir using wget. ( I noticed I had custom/app.js and custom/app.js&lt;bunch-of-numbers&gt;. ? )<br><br>
</div>&nbsp; I edited the app.js and tried to use curl to put it back into the webdav/database. I receive "Method not allowed". <br><br>
</div>&nbsp; How can I smooth out this process? <br><br>Thank you<br>c<br>
</div></div>
Tim | 12 Jul 20:20 2014
Picon

[MarkLogic Dev General] Strict validation error encountered in ML7 but not in ML6

Hi Folks,

 

When I run strict validation of a document against a schema using MarkLogic 6.0-2 (which has been running consistently and without a problem for years), it passes validation, but when I run strict validation using the same document at the same URI with the same schema using MarkLogic 7.0-2.3, it complains about a missing sub-element in an element list.

 

Have there been any changes to strict validation in ML7 or any similar errors reported?

 

Thank you!

 

Tim Meagher

 

<div><div class="WordSection1">
<p class="MsoNormal"><span>Hi Folks,<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>When I run strict validation of a document against a schema using MarkLogic 6.0-2 (which has been running consistently and without a problem for years), it passes validation, but when I run strict validation using the same document at the same URI with the same schema using MarkLogic 7.0-2.3, it complains about a missing sub-element in an element list.<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Have there been any changes to strict validation in ML7 or any similar errors reported?<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Thank you!<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Tim Meagher<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
</div></div>
Tim | 12 Jul 05:49 2014
Picon

[MarkLogic Dev General] How to get counts of combinations of attributes?

I have a record with 3 attributes each with a range index of type xs:string associated with it:

 

Link1

Link2

Link3

 

Each record can contain any combination of links:

 

None

Link1-only

Link2-only

Link3-only

Link1-and-Link2

Link1-and-Link3

Link2-and-Link3

All

 

Using the index on each link attribute I want to get a count of the total number of records for each link combination.

 

Any ideas using the existing indexes?

 

Much appreciated!

 

Tim Meagher

 

<div><div class="WordSection1">
<p class="MsoNormal"><span>I have a record with 3 attributes each with a range index of type xs:string associated with it:<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Link1<p></p></span></p>
<p class="MsoNormal"><span>Link2<p></p></span></p>
<p class="MsoNormal"><span>Link3<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Each record can contain any combination of links:<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>None<p></p></span></p>
<p class="MsoNormal"><span>Link1-only<p></p></span></p>
<p class="MsoNormal"><span>Link2-only<p></p></span></p>
<p class="MsoNormal"><span>Link3-only<p></p></span></p>
<p class="MsoNormal"><span>Link1-and-Link2<p></p></span></p>
<p class="MsoNormal"><span>Link1-and-Link3<p></p></span></p>
<p class="MsoNormal"><span>Link2-and-Link3<p></p></span></p>
<p class="MsoNormal"><span>All<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Using the index on each link attribute I want to get a count of the total number of records for each link combination.<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Any ideas using the existing indexes?<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Much appreciated!<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Tim Meagher<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
</div></div>
Timothy Pearce | 9 Jul 22:12 2014

[MarkLogic Dev General] Marklogic Write Profiling

Is there a way to profile what file operations happen during a given query? Much like there is the profile you
can run which says time taken per query, I'm interested in getting a file I/O record. Importantly it's
where/when the data inside the file stands are being changed is in question.

The premise of the issue is, the backup solution is doing a i/o transaction log and replaying it to a remote
storage, so any extraneous writes can balloon this log, and the goal is to identify if such writes are
happening. There is a selection process which tags certain documents into collections, and these
initial queries may return thousands of documents within the marklogic DB, but only tags a select number.
The amount of data changes going to the backup is much larger than the expected for this operation, and thus
the need to identify if a query function is writing to the files inside the db which it should not.

Currently running Marklogic Server Enterprise Edition 5.0.
If this functionality has been added in a newer version, that would be useful to be a solution.

Thanks,
Tim

Nothing in this message is intended to constitute an electronic signature unless a specific statement to
the contrary is included in this message. Confidentiality Note: This message is intended only for the
person or entity to which it is addressed. It may contain confidential and/or proprietary material. Any
review, transmission, dissemination or other use, or taking of any action in reliance upon this message
by persons or entities other than the intended recipient is prohibited. If you received this message in
error, please contact the sender and delete it from your computer.
William Sawyer | 7 Jul 23:27 2014
Picon

[MarkLogic Dev General] Limit Active Sessions per user.

What is the best way to make it so a user can't be logged in more than once or twice?  Is there a way to invalidate sessions when a login happens?  I have tried changing the app server setting "concurrent request limit" with no success.

Thanks,
-Will



<div><div dir="ltr">What is the best way to make it so a user can't be logged in more than once or twice? &nbsp;Is there a way to invalidate sessions when a login happens? &nbsp;I have tried changing the app server setting&nbsp;"concurrent request limit" with no success.<div>
<br>
</div>
<div>Thanks,</div>
<div>-Will<br><br><br><br>
</div>
</div></div>
Sudheer Yalaverthi | 7 Jul 22:05 2014
Picon

[MarkLogic Dev General] How does locking works on a document with multiple fragments?

Hi,


I have a document with below structure. and it is saved under URI '/{runlevel}/{userid}/jobs.xml'

<joblist>
     <job>
            <id>1</id>
            .
            .
     </job>
     <job>
             <id>2</id>
             .
             .
      </job>
      .
      .
</joblist>


Each job element is a fragment as I have fragment root defined for the Job element. 
I am retrieving specific job element using cts:search and then trying to update the element.

let $job := cts:search(/joblist/job, cts:and-query(cts:document-query('/runlevel/userid/jobs.xml'), cts:element-range-query(xs:QName('id'), '=', '1'))))

return if($job) 
          then xdmp:node-replace($node, element job {....}) 
          else ()

My question is does the above query locks the entire document under URI  '/{runlevel}/{userid}/jobs.xml' or does it specifically lock the fragment that is picked in the search query?



Thanks,
Sudheer Yalaverthi
<div><div dir="ltr">Hi,<div><br></div>
<div><br></div>
<div>I have a document with below structure. and it is saved under URI '/{runlevel}/{userid}/jobs.xml'</div>
<div><br></div>
<div>&lt;joblist&gt;</div>
<div>&nbsp; &nbsp; &nbsp;&lt;job&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;id&gt;1&lt;/id&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .</div>
<div>&nbsp; &nbsp; &nbsp;&lt;/job&gt;</div>
<div>&nbsp; &nbsp; &nbsp;&lt;job&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;id&gt;2&lt;/id&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.</div>
<div>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.</div>
<div>&nbsp; &nbsp; &nbsp; &lt;/job&gt;</div>
<div>&nbsp; &nbsp; &nbsp; .</div>
<div>&nbsp; &nbsp; &nbsp; .<br clear="all"><div>&lt;/joblist&gt;</div>
<div><br></div>
<div><br></div>
<div>Each job element is a fragment as I have fragment root defined for the Job element.&nbsp;</div>
<div>I am retrieving specific job element using cts:search and then trying to update the element.</div>
<div><br></div>
<div>let $job := cts:search(/joblist/job, cts:and-query(cts:document-query('/runlevel/userid/jobs.xml'), cts:element-range-query(xs:QName('id'), '=', '1'))))</div>
<div><br></div>
<div>return if($job)&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; then xdmp:node-replace($node, element job {....})&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else ()</div>
<div><br></div>
<div>My question is does the above query locks the entire document under URI &nbsp;'/{runlevel}/{userid}/jobs.xml' or does it specifically lock the fragment that is picked in the search query?</div>
<div><br></div>
<div><br></div>
<div><br></div>
<div dir="ltr">Thanks,<div>Sudheer Yalaverthi</div>
</div>
</div>
</div></div>

Gmane