Kapoor, Pragya | 22 Jul 12:36 2016

[MarkLogic Dev General] xdmp:spawan giving Time limit exceeded error

Hi,


The below code is giving me time limit exceeded error.



let $docListExtra := fn:doc("/misc/Extra.xml")/Extra
let $metaUris := cts:uri-match("/metadata/*.xml")

for $metaUri in $metaUris

       return 
          xdmp:spawn("spawn-walk.xqy", 
                (xs:QName("metaUri"),$metaUri, xs:QName("docListExtra"), $docListExtra),            
                <options xmlns="xdmp:eval">
                  <result>true</result>
                  <priority>higher</priority>                
                </options>))


In spawn.xqy:

xquery version "1.0-ml";

declare variable $metaUri as xs:string external;
declare variable $docListExtra external;

let $metaDoc := fn:doc($metaUri)
let $uri := fn:replace($metaUri,"/metadata/",'/docs/')
let $extraDoc := $docListExtra/Document[ID/text() = $uri]


(:Adding agreement type :)
let $d :=fn:concat($metaDoc/Document/x/text(),"-",$metaDoc/Document/y/text())

  
return 

(xdmp:node-insert-child($metaDoc/Document,<a>{fn:data($extraDoc//CustomMetadata/Field[ <at> ID = "a"])}</a>),

xdmp:node-insert-child($metaDoc/Document,<b>{fn:data($extraDoc//CustomMetadata/Field[ <at> ID = "b"])}</b>),
xdmp:node-insert-child($metaDoc/Document,<c>{fn:data($extraDoc//CustomMetadata/Field[ <at> ID = "c"])}</c>),
xdmp:node-insert-child($metaDoc/Document,<d>{$d}</d>),
xdmp:node-replace($metaDoc/Document/ID,<DocId>{$metaDoc/Document/ID/text()}</DocId>)
)

Please let me know, if I am doing something in incorrect manner.

Thanks
Pragya

"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
<div>
<div>
<p>Hi,</p>
<p><br></p>
<p>The below code is giving me time limit exceeded error.</p>
<p><br></p>
<p></p>
<div><br></div>
<div>let $docListExtra := fn:doc("/misc/Extra.xml")/Extra</div>
<div>let $metaUris := cts:uri-match("/metadata/*.xml")</div>
<div><br></div>
<div>for $metaUri in $metaUris</div>
<div><br></div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;return&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xdmp:spawn("spawn-walk.xqy",&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (xs:QName("metaUri"),$metaUri, xs:QName("docListExtra"), $docListExtra), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;options xmlns="xdmp:eval"&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;result&gt;true&lt;/result&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;priority&gt;higher&lt;/priority&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/options&gt;))</div>
<br><p></p>
<p><br></p>
<p>In spawn.xqy:</p>
<p></p>
<div>xquery version "1.0-ml";</div>
<div><br></div>
<div>declare variable $metaUri as xs:string external;</div>
<div>declare variable $docListExtra external;</div>
<div><br></div>
<div>let $metaDoc := fn:doc($metaUri)</div>
<div>let $uri := fn:replace($metaUri,"/metadata/",'/docs/')</div>
<div>let $extraDoc := $docListExtra/Document[ID/text() = $uri]</div>
<div><br></div>
<div><br></div>
<div>(:Adding agreement type :)</div>
<div>let $d :=fn:concat($metaDoc/Document/x/text(),"-",$metaDoc/Document/y/text())</div>
<div><br></div>
<div>&nbsp;&nbsp;</div>
<div>return&nbsp;</div>
<div><br></div>
<div>(xdmp:node-insert-child($metaDoc/Document,&lt;a&gt;{fn:data($extraDoc//CustomMetadata/Field[ <at> ID = "a"])}&lt;/a&gt;),</div>
<div><br></div>
<div>xdmp:node-insert-child($metaDoc/Document,&lt;b&gt;{fn:data($extraDoc//CustomMetadata/Field[ <at> ID = "b"])}&lt;/b&gt;),</div>
<div>xdmp:node-insert-child($metaDoc/Document,&lt;c&gt;{fn:data($extraDoc//CustomMetadata/Field[ <at> ID = "c"])}&lt;/c&gt;),</div>
<div>xdmp:node-insert-child($metaDoc/Document,&lt;d&gt;{$d}&lt;/d&gt;),</div>
<div>xdmp:node-replace($metaDoc/Document/ID,&lt;DocId&gt;{$metaDoc/Document/ID/text()}&lt;/DocId&gt;)</div>
<div>)</div>
<div><br></div>
<div>Please let me know, if I am doing something in incorrect manner.</div>
<div><br></div>
<div>Thanks</div>
<div>Pragya</div>
<br><p></p>
</div>
"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and
 destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
</div>
udaya.chillara | 15 Jul 08:46 2016

Re: [MarkLogic Dev General] Need Technical Support


Hello Team,

We are new to MarkLogic DB and we are analysing it to use in our project which is programmed in scala .We have downloaded the MarkLogic 7 trial version but are unable to create a rest API instance.

We tried to insert a document but we are unable to come forward. Can you please assist us technically to get started.


Thanks
Udaya


From: general-bounces <at> developer.marklogic.com <general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org> on behalf of general-request-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org <general-request <at> developer.marklogic.com>
Sent: Friday, July 15, 2016 12:12 PM
To: Udaya Laxmi Chillara (MFG & Tech)
Subject: Welcome to the "General" mailing list
 
** This mail has been sent from an external source **

Welcome to the General-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org mailing list!

To post to this list, send your email to:

  general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

General information about the mailing list is at:

  http://developer.marklogic.com/mailman/listinfo/general
developer.marklogic.com
This is a general mailing list for all things MarkLogic related. To see the collection of prior postings to the list, visit the General Archives.



If you ever want to unsubscribe or change your options (eg, switch to
or from digest mode, change your password, etc.), visit your
subscription page at:

  http://developer.marklogic.com/mailman/options/general/udaya.chillara%40wipro.com


You can also make such adjustments via email by sending a message to:

  General-request-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

with the word `help' in the subject or body (don't include the
quotes), and you will get back a message with instructions.

You must know your password to change your options (including changing
the password, itself) or to unsubscribe.  It is:

  marklogic

Normally, Mailman will remind you of your developer.marklogic.com
mailing list passwords once every month, although you can disable this
if you prefer.  This reminder will also include instructions on how to
unsubscribe or change your account options.  There is also a button on
your options page that will email your current password to you.
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
<div>
<div>
<p><br></p>
<span></span>
<div>
Hello Team,</div>
<div>
<br>
</div>
<div>
We are new to MarkLogic DB and we are analysing it to use in&nbsp;our project which is programmed in scala&nbsp;.We have downloaded the MarkLogic 7 trial&nbsp;version but are unable to create a rest API instance.</div>
<div>
<br>
</div>
<div>
We tried to insert a document but we are unable to come forward.&nbsp;Can you please assist us technically to get started.</div>
<div>
<br>
</div>
<div>
<br>
</div>
<div>
Thanks</div>
<div>
Udaya</div>
<span></span><br><br><div>
<div>
<div dir="ltr">From: general-bounces <at> developer.marklogic.com &lt;general-bounces@...&gt; on behalf of general-request@... &lt;general-request <at> developer.marklogic.com&gt;<br>Sent: Friday, July 15, 2016 12:12 PM<br>To: Udaya Laxmi Chillara (MFG &amp; Tech)<br>Subject: Welcome to the "General" mailing list
<div>&nbsp;</div>
</div>
</div>
<span>
<div class="PlainText">** This mail has been sent from an external source **≤br><br>
Welcome to the General@... mailing list!<br><br>
To post to this list, send your email to:<br><br>
&nbsp; general@...<br><br>
General information about the mailing list is at:<br><br>
&nbsp; <a href="http://developer.marklogic.com/mailman/listinfo/general">
http://developer.marklogic.com/mailman/listinfo/general</a>
<div>
<table cellspacing="0"><tr valign="top">
<td colspan="2">
<div></div>
<div>
<a href="http://developer.marklogic.com/mailman/listinfo/general" target="_blank">General Info Page - developer.marklogic.com</a>
</div>
<div>
developer.marklogic.com</div>
<div>
This is a general mailing list for all things MarkLogic related. To see the collection of prior postings to the list, visit the General Archives.</div>
</td>
</tr></table>
</div>
<br><br><br>
If you ever want to unsubscribe or change your options (eg, switch to<br>
or from digest mode, change your password, etc.), visit your<br>
subscription page at:<br><br>
&nbsp; <a href="http://developer.marklogic.com/mailman/options/general/udaya.chillara%40wipro.com">
http://developer.marklogic.com/mailman/options/general/udaya.chillara%40wipro.com</a><br><br><br>
You can also make such adjustments via email by sending a message to:<br><br>
&nbsp; General-request@...<br><br>
with the word `help' in the subject or body (don't include the<br>
quotes), and you will get back a message with instructions.<br><br>
You must know your password to change your options (including changing<br>
the password, itself) or to unsubscribe.&nbsp; It is:<br><br>
&nbsp; marklogic<br><br>
Normally, Mailman will remind you of your developer.marklogic.com<br>
mailing list passwords once every month, although you can disable this<br>
if you prefer.&nbsp; This reminder will also include instructions on how to<br>
unsubscribe or change your account options.&nbsp; There is also a button on<br>
your options page that will email your current password to you.<br>
</div>
</span>
</div>
</div>
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should
 not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments
 for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
</div>
Kapoor, Pragya | 14 Jul 08:53 2016

[MarkLogic Dev General] XDMP-EXTIME errror

Use Case:


We need to merge two XML files based on common element ID.

DocList.xml with size of 31 MB and other DocListExtra.xml of 8MB


The xquery code is giving Time Limit exceed error.


Code:

import module namespace mem = "http://xqdev.com/in-mem-update"
    at  "/rest-apis/utils/mem.xqy";

let $docList := fn:doc("/misc/DocList.xml")
let $extraList := fn:doc("/misc/DocListExtra.xml")

let $docExtra := 
let $docIDs := $docList//ID/text()
for $doc in $extraList
return 
  $doc//DocumentExtra[./DocumentExtraID/text() = $docIDs]

 for $doc in $docList
 for $each in $docExtra
 let $x := $doc//Document[./ID/text() = $each/DocumentExtraID/text()]
  let $dummy := mem:node-insert-child($x,$each//CustomMetadata)
   return xdmp:save("/data/merged.xml",$dummy)

Please suggest.


Thanks

Pragya

"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
<div>
<div>
<p>Use Case:</p>
<p><br></p>
<p>We need to merge two XML files based on common element ID.</p>
<p><span>DocList.xml with size of 31 MB and other DocListExtra.xml of&nbsp;8MB</span><br></p>
<p><span><br></span></p>
<p><span>The xquery code is giving Time Limit exceed error.</span></p>
<p><span><br></span></p>
<p><span>Code:</span></p>
<p><span></span></p>
<div>import module namespace mem = "http://xqdev.com/in-mem-update"</div>
<div>&nbsp; &nbsp; at &nbsp;"/rest-apis/utils/mem.xqy";</div>
<div><br></div>
<div>let $docList := fn:doc("/misc/DocList.xml")</div>
<div>let $extraList := fn:doc("/misc/DocListExtra.xml")</div>
<div><br></div>
<div>let $docExtra :=&nbsp;</div>
<div>let $docIDs := $docList//ID/text()</div>
<div>for $doc in $extraList</div>
<div>return&nbsp;</div>
<div>&nbsp; $doc//DocumentExtra[./DocumentExtraID/text() = $docIDs]</div>
<div><br></div>
<div>&nbsp;for $doc in $docList</div>
<div>&nbsp;for $each in $docExtra</div>
<div>&nbsp;let $x := $doc//Document[./ID/text() = $each/DocumentExtraID/text()]</div>
<div>&nbsp; let $dummy := mem:node-insert-child($x,$each//CustomMetadata)</div>
<div>&nbsp; &nbsp;return xdmp:save("/data/merged.xml",$dummy)</div>
<br><p></p>
<p>Please<span>&nbsp;suggest.</span></p>
<p><span><br></span></p>
<p><span>Thanks</span></p>
<p><span>Pragya</span></p>
</div>
"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and
 destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
</div>
Geert Josten | 4 Jul 15:40 2016

Re: [MarkLogic Dev General] mlcp and loading multiple files

Hi Hans,

The only other logical conclusion seems to be a bug in mlcp, one I haven’t encountered so far yet though. Are you entitled to support? In that case you can file a bug report with them. Nothing in the ErrorLog about failed inserts?

Cheers,
Geert

From: <general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org> on behalf of Hans Hübner <hans.huebner-fVdAHbEUuFzCENZMoErytg@public.gmane.org>
Reply-To: MarkLogic Developer Discussion <general <at> developer.marklogic.com>
Date: Monday, July 4, 2016 at 12:09 PM
To: MarkLogic Developer Discussion <general-ld4jwAGwUXRXKVOp+u0EsQ@public.gmane.orgrklogic.com>
Subject: Re: [MarkLogic Dev General] mlcp and loading multiple files

Hello Geert,

the URLs that I generate are unique, and that is actually how I found out about the problem in the first place.  In the load transformation, I extract the globally unique identifier that exists for each individual document in the aggregate and use that as part of the URL.  When I ran multiple mlcp processes in parallel, I found some individual documents to be missing.  When I processed the file that contained the missing document with mlcp manually afterwards, it was loaded correctly.

Any other ideas?
Thanks,
Hans

On Mon, Jul 4, 2016 at 9:29 AM, Geert Josten <Geert.Josten-efBvD/aTHCF8UrSeD/g0lQ@public.gmane.org> wrote:
Hi Hans,

My first thought would be that the uris you calculate might not be unique. Did you verify that? You can append xdmp:random() to see if that makes a difference..

Cheers,
Geert

From: <general-bounces <at> developer.marklogic.com> on behalf of Hans Hübner <hans.huebner-fVdAHbEUuFzCENZMoErytg@public.gmane.org>
Reply-To: MarkLogic Developer Discussion <general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org>
Date: Sunday, July 3, 2016 at 7:52 PM
To: MarkLogic Developer Discussion <general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org>
Subject: [MarkLogic Dev General] mlcp and loading multiple files

  let $icn := $doc/TRANSACTION/LOOP2000D/LOOP2200D/TRN/TRN02/text()
  let $uri := concat('/responses/', $icn, '.xml')


_______________________________________________
General mailing list
General-ld4jwAGwUXTgXEvjvSGRgA@public.gmane.orggic.com
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general




--
LambdaWerk GmbH
Oranienburger Straße 87/89
10178 Berlin
Phone: +49 30 555 7335 0
Fax: +49 30 555 7335 99

HRB 169991 B Amtsgericht Charlottenburg
USt-ID: DE301399951
Geschäftsführer:  Hans Hübner



<div>
<div>Hi Hans,</div>
<div><br></div>
<div>The only other logical conclusion seems to be a bug in mlcp, one I haven&rsquo;t encountered so far yet though. Are you entitled to support? In that case you can file a bug report with them. Nothing in the ErrorLog about failed inserts?</div>
<div><br></div>
<div>Cheers,</div>
<div>Geert</div>
<div><br></div>
<span>
<div>
<span>From: </span>&lt;<a href="mailto:general-bounces@...">general-bounces@...</a>&gt; on behalf of Hans H&uuml;bner &lt;<a href="mailto:hans.huebner <at> lambdawerk.com">hans.huebner@...</a>&gt;<br><span>Reply-To: </span>MarkLogic Developer Discussion &lt;<a href="mailto:general@...">general <at> developer.marklogic.com</a>&gt;<br><span>Date: </span>Monday, July 4, 2016 at 12:09 PM<br><span>To: </span>MarkLogic Developer Discussion &lt;<a href="mailto:general@...">general@...rklogic.com</a>&gt;<br><span>Subject: </span>Re: [MarkLogic Dev General] mlcp and loading multiple files<br>
</div>
<div><br></div>
<div>
<div>
<div dir="ltr">Hello Geert,
<div><br></div>
<div>the URLs that I generate are unique, and that is actually how I found out about the problem in the first place.&nbsp; In the load transformation, I extract the globally unique identifier that exists for each individual document in the aggregate and use that
 as part of the URL.&nbsp; When I ran multiple mlcp processes in parallel, I found some individual documents to be missing.&nbsp; When I processed the file that contained the missing document with mlcp manually afterwards, it was loaded correctly.</div>
<div><br></div>
<div>Any other ideas?<br>
Thanks,</div>
<div>Hans</div>
</div>
<div class="gmail_extra">
<br><div class="gmail_quote">On Mon, Jul 4, 2016 at 9:29 AM, Geert Josten <span dir="ltr">
&lt;<a href="mailto:Geert.Josten@..." target="_blank">Geert.Josten@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">
<div>
<div>Hi Hans,</div>
<div><br></div>
<div>My first thought would be that the uris you calculate might not be unique. Did you verify that? You can append xdmp:random() to see if that makes a difference..</div>
<div><br></div>
<div>Cheers,</div>
<div>Geert</div>
<div><br></div>
<span>
<div>
<span>From: </span>&lt;<a href="mailto:general-bounces@..." target="_blank">general-bounces <at> developer.marklogic.com</a>&gt; on behalf of Hans H&uuml;bner &lt;<a href="mailto:hans.huebner@..." target="_blank">hans.huebner@...</a>&gt;<br><span>Reply-To: </span>MarkLogic Developer Discussion &lt;<a href="mailto:general@..." target="_blank">general@...</a>&gt;<br><span>Date: </span>Sunday, July 3, 2016 at 7:52 PM<br><span>To: </span>MarkLogic Developer Discussion &lt;<a href="mailto:general@..." target="_blank">general@...</a>&gt;<br><span>Subject: </span>[MarkLogic Dev General] mlcp and loading multiple files<br>
</div>
<span class="">
<div><br></div>
<div>
&nbsp; let $icn := $doc/TRANSACTION/LOOP2000D/LOOP2200D/TRN/TRN02/text()</div>
<div>
&nbsp; let $uri := concat('/responses/', $icn, '.xml')</div>
<br></span></span>
</div>
<br>
_______________________________________________<br>
General mailing list<br><a href="mailto:General@...">General@...gic.com</a><br>
Manage your subscription at:<br><a href="http://developer.marklogic.com/mailman/listinfo/general" rel="noreferrer" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br><br>
</blockquote>
</div>
<br><br clear="all"><div><br></div>
-- <br><div class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">LambdaWerk GmbH</div>
<div dir="ltr"><span>Oranienburger Stra&szlig;e 87/89</span></div>
<div dir="ltr">
<span>10178 Berlin</span>
<div>
<div>Phone: +49 30&nbsp;<span>555 7335</span>&nbsp;0</div>
</div>
<div>Fax: +49 30&nbsp;<span>555 7335</span>&nbsp;99</div>
<div>
<div><br></div>
<div>
<div>
<span>HRB 169991 B Amtsgericht Charlottenburg</span><br>
</div>
<div><span>USt-ID: DE301399951</span></div>
<div></div>
</div>
<div>Gesch&auml;ftsf&uuml;hrer: &nbsp;Hans H&uuml;bner</div>
<div><br></div>
</div>
<div><a href="http://lambdawerk.com/" target="_blank">http://lambdawerk.com/</a></div>
<div><br></div>
<div><br></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</span>
</div>
Kapoor, Pragya | 4 Jul 09:18 2016

[MarkLogic Dev General] Path Range Query

Hi,


Is there any way by which we can substitue cts:element-word-query( wildcarded)  to path range queries.

Actually, my xml contains same names of elements without any namespace, so I wanted to run path range queries, but the wildcarded option is not present in these queries.


My requirement is to create a query which could work on *term*, term*


Any idea how can I achieve this?


Thanks

Pragya

"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
<div>
<div>
<p>Hi,</p>
<p><br></p>
<p>Is there any way by which we can substitue&nbsp;<span>cts:element-word-query( wildcarded)&nbsp; to path range queries.</span></p>
<p><span>Actually, my xml contains same names of elements without any namespace, so I wanted to run path range queries, but the wildcarded option is not present in these queries.</span></p>
<p><span><br></span></p>
<p><span>My requirement is to create a query which could work on *term*, term*</span></p>
<p><span><br></span></p>
<p><span>Any idea how can I achieve this?</span></p>
<p><span><br></span></p>
<p><span>Thanks</span></p>
<p><span>Pragya</span></p>
</div>
"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and
 destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
</div>
Ron Hitchens | 1 Jul 16:10 2016
Gravatar

[MarkLogic Dev General] XCC (CORB) over Amazon ELB


   We’re having quite a bit of trouble with ELBs in AWS.  There is an ELB in front of the service/app nodes, and
another ELB between them and the three node MarkLogic cluster.

   We’ve had problems with the ELB in front of ML marking nodes down if they are not responsive enough, which
results in 504 responses on calls to ML after that.  We’ve had to crank up the timeouts to fairly high
levels to avoid one slow query from causing subsequent queries to fail.

   That’s annoying but manageable.  What’s really problematic is apparent data corruption when using
XCC, specifically CORB.

   For most calls to MarkLogic, we’re using our bespoke REST interface using URL rewriting on an HTTP
appserver.  We don’t use XCC normally.  But we’re doing some one time batch reprocessing with CORB. 
Pointing CORB at one of the E-nodes works fine.  But if we point it at the ELB (which works fine for the REST
calls) then we randomly get failures like the one below.

   Since I originally wrote XCC, I know that this error message is the result of the data stream being out of sync
with what XCC is expecting to see.  It’s looking for a sub-header in the partitioned response that
describes the XDM type of the next result item.  It’s seeing something else instead.

   Are there known issues with ELBs and XCC/XDBC and/or CORB?  Is there an ELB setting get around this?  I have a
feeling that the ELB may be munging the response in some way that is tripping up XCC.

   Any help appreciated.

=======

INFO: monitoring 1,171,599 tasks
Jun 30, 2016 3:35:23 PM com.marklogic.developer.corb.Manager populateQueue
INFO: received first uri: urn:cambridge.org:id:content-bundle:S0360966900011993:version:1
2016-06-30 15:35:23.454 SEVERE [1] (StreamingResultSequence.next): IOException instantiating
ResultItem 240: Nodes of type 'rsion' are not supported in XCC result sequences
 java.io.IOException: Nodes of type 'rsion' are not supported in XCC result sequences
	com.marklogic.xcc.impl.AbstractResultSequence.nodeFactory(AbstractResultSequence.java:248)
	com.marklogic.xcc.impl.AbstractResultSequence.instantiateResultItem(AbstractResultSequence.java:202)
	com.marklogic.xcc.impl.StreamingResultSequence.next(StreamingResultSequence.java:147)
	com.marklogic.xcc.impl.StreamingResultSequence.next(StreamingResultSequence.java:166)
	com.marklogic.developer.corb.QueryUrisLoader.next(QueryUrisLoader.java:158)
	com.marklogic.developer.corb.Manager.populateQueue(Manager.java:719)
	com.marklogic.developer.corb.Manager.run(Manager.java:472)
	com.marklogic.developer.corb.Manager.main(Manager.java:162)
Jun 30, 2016 3:35:23 PM com.marklogic.developer.corb.Manager stop
INFO: cleaning up
Jun 30, 2016 3:35:23 PM com.marklogic.developer.corb.QueryUrisLoader close
INFO: closing uris session
Jun 30, 2016 3:35:23 PM com.marklogic.developer.corb.Monitor run
SEVERE: interrupted: exiting
java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2088)
	at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
	at java.util.concurrent.ExecutorCompletionService.poll(ExecutorCompletionService.java:202)
	at com.marklogic.developer.corb.Monitor.monitorResults(Monitor.java:96)
	at com.marklogic.developer.corb.Monitor.run(Monitor.java:75)
	at java.lang.Thread.run(Thread.java:745)

2016-06-30 15:35:23.475 WARNING [10] (AbstractRequestController.runRequest): Cannot obtain
connection: null
 java.nio.channels.ClosedByInterruptException
	java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
	sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:659)
	java.nio.channels.SocketChannel.open(SocketChannel.java:189)
	com.marklogic.xcc.impl.SocketPoolProvider.obtainConnection(SocketPoolProvider.java:93)
	com.marklogic.xcc.impl.handlers.AbstractRequestController.runRequest(AbstractRequestController.java:85)
	com.marklogic.xcc.impl.SessionImpl.submitRequestInternal(SessionImpl.java:437)
	com.marklogic.xcc.impl.SessionImpl.submitRequest(SessionImpl.java:432)
	com.marklogic.developer.corb.AbstractTask.invokeModule(AbstractTask.java:233)
	com.marklogic.developer.corb.AbstractTask.call(AbstractTask.java:148)
	com.marklogic.developer.corb.AbstractTask.call(AbstractTask.java:56)
	java.util.concurrent.FutureTask.run(FutureTask.java:266)
	java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	java.util.concurrent.FutureTask.run(FutureTask.java:266)
	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	java.lang.Thread.run(Thread.java:745)
Jun 30, 2016 3:35:23 PM com.marklogic.developer.corb.AbstractTask handleRequestException
WARNING: Encountered ServerConnectionException from Marklogic Server. Retrying attempt 1 after 60
seconds..: null at URI: urn:cambridge.org:id:content-bundle:S0360966900011993:version:1

---
Ron Hitchens {ron <at> overstory.co.uk}  +44 7879 358212

_______________________________________________
General mailing list
General <at> developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general
Hans Hübner | 28 Jun 06:45 2016
Gravatar

[MarkLogic Dev General] Bulk updates (xqsync vs. mlcp)

Hi,

we're planning to use MarkLogic to do regular bulk updates on a larger set of documents (~1 million).  Many of the documents will be unchanged from their previous version, and we'd like to avoid reinserting them as we want to be able to use the point-in-time query feature to track document changes over time.  I've read an old thread in this forum that suggested calculating a checksum over each input document and then only writing it to the database if the previous version's checksum differs.  In that same thread, it was also suggested that xqsync could be used.

Now xqsync apparently was replaced by mlcp, and I can find an indication in the mlcp documentation that it avoids writing unchanged documents.

Can anyone suggest the best way to approach this?

Thanks!
Hans

<div><div dir="ltr">Hi,<div><br></div>
<div>we're planning to use MarkLogic to do regular bulk updates on a larger set of documents (~1 million).&nbsp; Many of the documents will be unchanged from their previous version, and we'd like to avoid reinserting them as we want to be able to use the point-in-time query feature to track document changes over time.&nbsp; I've read an old thread in this forum that suggested calculating a checksum over each input document and then only writing it to the database if the previous version's checksum differs.&nbsp; In that same thread, it was also suggested that xqsync could be used.</div>
<div><br></div>
<div>Now xqsync apparently was replaced by mlcp, and I can find an indication in the mlcp documentation that it avoids writing unchanged documents.</div>
<div><br></div>
<div>Can anyone suggest the best way to approach this?</div>
<div><br></div>
<div>Thanks!<br>Hans<br clear="all"><div><br></div>
</div>
</div></div>
Karthik.Nagarajan2 | 23 Jun 12:18 2016

[MarkLogic Dev General] Customise and override content API's authentication and authorization

Hi,


Is it possible to add an interception script or layer on top of the content API's to do another level of authentication before forwarding the request to MarkLogic server?

I want to authenticate with some external system before the request reaches the ML server.


Thanks,
Karthik
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.
<div>
<div>
<p><span>Hi,</span><br></p>
<div>
<div>
<div>
<p><br></p>
<p>Is it possible to add an interception script or layer on top of the content API's to do another level of authentication before forwarding the request to MarkLogic server?</p>
<p>I want to authenticate with some external system before the request reaches the ML server.</p>
<p><br></p>
<div>
<div>Thanks,<br>
Karthik</div>
</div>
</div>
</div>
</div>
</div>
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original
 message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law,
 this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.
</div>
Stephane.VARIN | 23 Jun 11:19 2016

[MarkLogic Dev General] format:json && extract-document-data

Hi,

 

I am trying to include some document data into my search results, using the following query options:

 

<options xmlns="http://marklogic.com/appservices/search">

    <extract-document-data selected="include">

          <extract-path>/language-version/ language-version-canonical-model/title</extract-path>

          <extract-path>/language-version/ language-version-canonical-model/language</extract-path>

(…)

    </extract-document-data>

</options>

 

Unfortunately, when I ask for json format (using header Accpet: application/json), the extracted element comes as “stringyfied” xml instead of being converted into json as I would have expected:

 

{

  "snippet-format": "snippet",

  "total": 564,

  "start": 1,

  "page-length": 10,

  "selected": "include",

  "results": [

    {

      "index": 1,

      "uri": "ENV/CHEM/NANO(2015)22/ANN5/2",

      "path": "fn:doc(\"ENV/CHEM/NANO(2015)22/ANN5/2\")",

(…)

      "extracted": {

        "kind": "element",

        "content": [

          "<language>En</language>",

          "<title>ZINC OXIDE DOSSIERANNEX 5</title>",

          "<reference>ENV/CHEM/NANO(2015)22/ANN5</reference>",

          "<classification>2</classification>",

          "<modificationDate>2015-04-16T00:00:00.000+02:00</modificationDate>",

          "<subject label_en=\"media\">media</subject>",

          "<subject label_en=\"fish\">fish</subject>",

(…)

        ]

      }

    },

 

Anything I am doing wrong? Is there some configuration options I could tweak to enforce the conversion of xml to json?

 

Cheers,

Stéphane Varin

<div>
<div class="WordSection1">
<p class="MsoNormal">Hi,<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">I am trying to include some document data into my search results, using the following query options:<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><span lang="FR">&lt;options xmlns="http://marklogic.com/appservices/search"&gt;<p></p></span></p>
<p class="MsoNormal"><span lang="FR">&nbsp;&nbsp;&nbsp; </span>&lt;extract-document-data selected="include"&gt;<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;extract-path&gt;/language-version/ language-version-canonical-model/title&lt;/extract-path&gt;<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;extract-path&gt;/language-version/ language-version-canonical-model/language&lt;/extract-path&gt;<p></p></p>
<p class="MsoNormal">(&hellip;)<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp; <span lang="FR">&lt;/extract-document-data&gt;<p></p></span></p>
<p class="MsoNormal">&lt;/options&gt;<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Unfortunately, when I ask for json format (using header Accpet: application/json), the extracted element comes as &ldquo;stringyfied&rdquo; xml instead of being converted into json as I would have expected:<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">{<p></p></p>
<p class="MsoNormal">&nbsp; "snippet-format": "snippet",<p></p></p>
<p class="MsoNormal">&nbsp; "total": 564,<p></p></p>
<p class="MsoNormal">&nbsp; "start": 1,<p></p></p>
<p class="MsoNormal">&nbsp; "page-length": 10,<p></p></p>
<p class="MsoNormal">&nbsp; "selected": "include",<p></p></p>
<p class="MsoNormal">&nbsp; "results": [<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp; {<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "index": 1,<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "uri": "ENV/CHEM/NANO(2015)22/ANN5/2",<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "path": "fn:doc(\"ENV/CHEM/NANO(2015)22/ANN5/2\")",<p></p></p>
<p class="MsoNormal">(&hellip;)<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "extracted": {<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "kind": "element",<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "content": [<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;language&gt;En&lt;/language&gt;",<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;title&gt;ZINC OXIDE DOSSIERANNEX 5&lt;/title&gt;",<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;reference&gt;ENV/CHEM/NANO(2015)22/ANN5&lt;/reference&gt;",<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;classification&gt;2&lt;/classification&gt;",<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;modificationDate&gt;2015-04-16T00:00:00.000+02:00&lt;/modificationDate&gt;",<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;subject label_en=\"media\"&gt;media&lt;/subject&gt;",<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;subject label_en=\"fish\"&gt;fish&lt;/subject&gt;",<p></p></p>
<p class="MsoNormal">(&hellip;)<p></p></p>
<p class="MsoNormal"><span lang="FR">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>]<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp; },<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Anything I am doing wrong? Is there some configuration options I could tweak to enforce the conversion of xml to json?<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Cheers,<p></p></p>
<p class="MsoNormal">St&eacute;phane Varin<p></p></p>
</div>
</div>
fhcj.jansen | 22 Jun 17:47 2016

[MarkLogic Dev General] MLCP import transform and search

Hi,

Is it possible in MLCP IMPORT within a TRANSFORM  to search on the (same) database?

To enrich the data (from same database) I use the transform option.
But in below transformation the raw data is loaded in the database with empty elements a,b and c (structure is ok)
Questions:
- is it possible to do a MLCP IMPORT with a search in a transform (xquery) and get data from same (sub-)database
- or do I have to adjust my security role (Which role do I need, currently I use role admin )
- or  .............


MLCP call:

mlcp.sh import \
       -mode local \
       -host localhost \
       -port $PORT \
       -username $USER \
       -password $PASS \
       -input_file_path /home/cent/Desktop/$SRCS \
       -document_type xml  \
       -input_file_type aggregates \
       -aggregate_record_element record \
       -database Dummy \
       -content_encoding "UTF-8" \
       -namespace http://ml.com/$SRCS \
       -output_collections $COLL \
       -transform_module /src/transform/transform.xqy \
       -transform_namespace http://ml.com/mlcp-transform \
       -transform_param $PARM \
       -tolerate_errors true \
       -xml_repair_level full




/src/transform/transform.xqy:

xquery version "1.0-ml";
module namespace ingest = "http://ml.com/mlcp-transform";
declare function ingest:transform(
  $content as map:map,
  $context as map:map
)
{
  let $doc         := map:get($content, "value")

(: Normally the below search function are more specific based on element values in $doc :)
 
  let $a := cts:search(fn:doc(), cts:collection-query("docs"), "unfiltered")
  let $b := cts:uris((),(),cts:collection-query("docs"))
  let $c := fn:collection("docs")[1]
(: removed transformation part               :)
(:   but $a, $b and $c are empty             :)
(:   Same function in QControl gives results :)  

  let $_1 := <new-record>
                      <raw>{$doc}</raw>
                      <a>{$a}</a>
                      <b>{$b}</b>
                      <c>{$c}</c>
                   </new-record>
  let $_2 := map:put($content, "value", $_1)
  return $content
};



Kind Regards,
Frank Jansen

This message has been sent by ABN AMRO Bank N.V., which has its seat at Gustav Mahlerlaan 10 (1082 PP) Amsterdam, the Netherlands, and is registered in the Commercial Register of Amsterdam under number 34334259.
<div>Hi,
<br><br>Is it possible in MLCP IMPORT within
a TRANSFORM &nbsp;to search on the (same) database?
<br><br>To enrich the data (from same database)
I use the transform option.
<br>But in below transformation the raw
data is loaded in the database with empty elements a,b and c (structure
is ok)
<br>Questions:
<br>- is it possible to do a MLCP IMPORT
with a search in a transform (xquery) and get data from same (sub-)database
<br>- or do I have to adjust my security
role (Which role do I need, currently I use role admin ) 
<br>- or &nbsp;.............
<br><br><br>MLCP call:
<br><br>mlcp.sh import \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-mode local
\
<br>&nbsp; &nbsp; &nbsp; &nbsp;-host localhost
\
<br>&nbsp; &nbsp; &nbsp; &nbsp;-port $PORT
\
<br>&nbsp; &nbsp; &nbsp; &nbsp;-username
$USER \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-password
$PASS \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-input_file_path
/home/cent/Desktop/$SRCS \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-document_type
xml &nbsp;\
<br>&nbsp; &nbsp; &nbsp; &nbsp;-input_file_type
aggregates \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-aggregate_record_element
record \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-database
Dummy \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-content_encoding
"UTF-8" \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-namespace
<a href="http://ml.com/%24SRCS">http://ml.com/$SRCS</a>
\
<br>&nbsp; &nbsp; &nbsp; &nbsp;-output_collections
$COLL \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-transform_module
/src/transform/transform.xqy \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-transform_namespace
<a href="http://ml.com/mlcp-transform">http://ml.com/mlcp-transform</a>
\
<br>&nbsp; &nbsp; &nbsp; &nbsp;-transform_param
$PARM \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-tolerate_errors
true \
<br>&nbsp; &nbsp; &nbsp; &nbsp;-xml_repair_level
full
<br><br><br><br><br>/src/transform/transform.xqy:
<br><br>xquery version "1.0-ml";
<br>module namespace ingest = "<a href="http://ml.com/mlcp-transform">http://ml.com/mlcp-transform</a>";
<br>declare function ingest:transform(
<br>&nbsp; $content as map:map,
<br>&nbsp; $context as map:map
<br>) 
<br>{
<br>&nbsp; let $doc &nbsp; &nbsp; &nbsp;
&nbsp; := map:get($content, "value")
<br><br>(: Normally the below search function
are more specific based on element values in $doc :) 
<br>&nbsp; 
<br>&nbsp; let $a := cts:search(fn:doc(),
cts:collection-query("docs"), "unfiltered")
<br>&nbsp; let $b := cts:uris((),(),cts:collection-query("docs"))
<br>&nbsp; let $c := fn:collection("docs")[1]
<br>(: removed transformation part &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :)
<br>(: &nbsp; but $a, $b and $c are empty
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :)
<br>(: &nbsp; Same function in QControl
gives results :) &nbsp; 
<br><br>&nbsp; let $_1 := &lt;new-record&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;raw&gt;{$doc}&lt;/raw&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a&gt;{$a}&lt;/a&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;b&gt;{$b}&lt;/b&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;c&gt;{$c}&lt;/c&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;&lt;/new-record&gt;
<br>&nbsp; let $_2 := map:put($content,
"value", $_1)
<br>&nbsp; return $content
<br>};
<br><br><br><br>Kind Regards, <br>
Frank Jansen 
<br><br>This message has been sent by ABN AMRO Bank N.V., which has its seat at Gustav Mahlerlaan 10 (1082 PP) Amsterdam, the Netherlands, and is registered in the Commercial Register of Amsterdam under number 34334259.</div>
Rob Walpole | 22 Jun 12:13 2016
Picon
Gravatar

Re: [MarkLogic Dev General] Validation error when loading pipeline with options via Management API

Hi Indy,

Yes I think it's some kind of namespace issue - however we have now found another solution as I realised we don't need file system access to load the pipeline - it can just as easily be loaded from the modules database which we are populating using mlcp.

Thanks again
Rob


On 22 June 2016 at 10:28, Indrajeet Verma <indrajeet.verma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Hi Rob,

I have never tried loading pipeline via APIs however by looking into the error, it seems a namespace error as you can see pipeline is in different namespace and options is with different namespace as per docs.

If possible, could you share your code and I may try to look. If not I am sure some other ML experts can help you on this.

Regards,
Indy

On 22-Jun-2016 2:44 pm, "Rob Walpole" <robkwalpole <at> gmail.com> wrote:
Hi Indy,

Thanks for your reply. Yes we have tried loading the pipeline via the admin UI and it works fine using the format you describe - however we really want to use the management API as the admin UI requires file system access on the server where MarkLogic and this will not always be available to us.

Rob


On 22 June 2016 at 10:05, Indrajeet Verma <indrajeet.verma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi Rob,

Have you tried to load pipeline via admin UI and seeing same error?

I am using ML8.0-4 and below code works with the options however I have loaded pipeline via UI. 

    <state-transition>
        <annotation>
            When a document is zip, 
        </annotation>
        <state>http://marklogic.com/states/initial</state>
        <on-success>http://marklogic.com/states/transformed</on-success>
        <on-failure>http://marklogic.com/states/error</on-failure>
        <execute>
            <condition>
                <module>/MarkLogic/cpf/actions/mimetype-condition.xqy</module>
                <options xmlns="/MarkLogic/cpf/actions/mimetype-condition.xqy">
                    <mime-type>application/zip</mime-type>
                </options>
            </condition>
            <action>
                <module>action/extract-zip.xqy</module>
            </action>
        </execute>
    </state-transition>

Regards,
Indy

On Wed, Jun 22, 2016 at 2:11 PM, Rob Walpole <robkwalpole-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi,

We are trying to load a CPF pipeline via the RESTful Management API and this fails with an invalid node error when there is an options element present within /pipeline-properties/state-transition/execute/condition

The full error message is as follows:

  <status-code>400</status-code>
  <status>Bad Request</status>
  <message-code>MANAGE-INVALIDPAYLOAD</message-code>
  <message>MANAGE-INVALIDPAYLOAD: (err:FOER0000) Payload has errors in structure, content-type or values. XDMP-VALIDATEUNEXPECTED: (err:XQDY0027) validate strict { $pipeline } -- Invalid node: Found pp:options but expected any(lax,!(http://marklogic.com/manage/pipeline/properties))? at fn:doc("")/pp:pipeline-properties/pp:state-transition/pp:execute/pp:condition/pp:options using schema "manage-pipeline-properties.xsd"</message>
</error>

The problem node looks like this:

<condition>
    <module>/MarkLogic/cpf/actions/mimetype-condition.xqy</module>
        <options>
            <mime-type>application/xml</mime-type>
        </options>
</condition>

We have also tried putting the options element in as..

<options xmlns="/MarkLogic/cpf/actions/mimetype-condition.xqy">
    <mime-type>application/xml</mime-type>
</options>

..which is how it is described in the Content Processing Framework Guide but this fails with a different error as follows:

  <status-code>500</status-code>
  <status>Internal Server Error</status>
  <message-code>XDMP-VALIDATEUNEXPECTED</message-code>
  <message>XDMP-VALIDATEUNEXPECTED: (err:XQDY0027) validate strict { $pipeline } -- Invalid node: Found p:options but expected any(lax,!(http://marklogic.com/cpf/pipelines))? at /p:pipeline/p:state-transition/p:execute/p:condition/p:options using schema "pipelines.xsd"</message>
</error>

If we remove the options element the pipeline loads via the API with no problems.

We are using MarkLogic Server Enterprise Edition 8.0-4.2

Many thanks
Rob Walpole

_______________________________________________
General mailing list
General <at> developer.marklogic.com
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general



_______________________________________________
General mailing list
General <at> developer.marklogic.com
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general



_______________________________________________
General mailing list
General <at> developer.marklogic.com
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general


_______________________________________________
General mailing list
General <at> developer.marklogic.com
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general


<div><div dir="ltr">Hi Indy,<div><br></div>
<div>Yes I think it's some kind of namespace issue - however we have now found another solution as I realised we don't need file system access to load the pipeline - it can just as easily be loaded from the modules database which we are populating using mlcp.</div>
<div><br></div>
<div>Thanks again</div>
<div>Rob</div>
<div><br></div>
<div class="gmail_extra">
<br><div class="gmail_quote">On 22 June 2016 at 10:28, Indrajeet Verma <span dir="ltr">&lt;<a href="mailto:indrajeet.verma@..." target="_blank">indrajeet.verma@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">
<p dir="ltr">Hi Rob,</p>
<p dir="ltr">I have never tried loading pipeline via APIs however by looking into the error, it seems a namespace error as you can see pipeline is in different namespace and options is with different namespace as per docs.</p>
<p dir="ltr">If possible, could you share your code and I may try to look. If not I am sure some other ML experts can help you on this.</p>
<p dir="ltr">Regards,<br>
Indy</p>
<div><div>
<div class="gmail_quote">On 22-Jun-2016 2:44 pm, "Rob Walpole" &lt;<a href="mailto:robkwalpole@..." target="_blank">robkwalpole <at> gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote">
<div dir="ltr">Hi Indy,<div><br></div>
<div>Thanks for your reply. Yes we have tried loading the pipeline via the admin UI and it works fine using the format you describe - however we really want to use the management API as the admin UI requires file system access on the server where MarkLogic and this will not always be available to us.</div>
<div><br></div>
<div>Rob</div>
<div><br></div>
<div class="gmail_extra">
<div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"></div></div></div></div></div></div>
<br><div class="gmail_quote">On 22 June 2016 at 10:05, Indrajeet Verma <span dir="ltr">&lt;<a href="mailto:indrajeet.verma@..." target="_blank">indrajeet.verma@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">
<div dir="ltr">Hi Rob,<div><br></div>
<div>Have you tried to load pipeline via admin UI and seeing same error?</div>
<div><br></div>
<div>I am using ML8.0-4 and below code works with the options however I have loaded pipeline via UI.&nbsp;<br>
</div>
<div>
<div><br></div>
<div>
<div>&nbsp; &nbsp; &lt;state-transition&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;annotation&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; When a document is zip,&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/annotation&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;state&gt;<a href="http://marklogic.com/states/initial" target="_blank">http://marklogic.com/states/initial</a>&lt;/state&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;on-success&gt;<a href="http://marklogic.com/states/transformed" target="_blank">http://marklogic.com/states/transformed</a>&lt;/on-success&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;on-failure&gt;<a href="http://marklogic.com/states/error" target="_blank">http://marklogic.com/states/error</a>&lt;/on-failure&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;execute&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;condition&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;module&gt;/MarkLogic/cpf/actions/mimetype-condition.xqy&lt;/module&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;options xmlns="/MarkLogic/cpf/actions/mimetype-condition.xqy"&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mime-type&gt;application/zip&lt;/mime-type&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/options&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/condition&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;action&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;module&gt;action/extract-zip.xqy&lt;/module&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/action&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/execute&gt;</div>
<div>&nbsp; &nbsp; &lt;/state-transition&gt;</div>
</div>
</div>
<div><br></div>
<div>Regards,</div>
<div>Indy</div>
</div>
<div class="gmail_extra">
<br><div class="gmail_quote">
<div><div>On Wed, Jun 22, 2016 at 2:11 PM, Rob Walpole <span dir="ltr">&lt;<a href="mailto:robkwalpole@..." target="_blank">robkwalpole@...</a>&gt;</span> wrote:<br>
</div></div>
<blockquote class="gmail_quote">
<div><div>
<div dir="ltr">Hi,<div><br></div>
<div>We are trying to load a CPF pipeline via the RESTful Management API and this fails with an invalid node error when there is an options element present within /pipeline-properties/state-transition/execute/condition</div>
<div><br></div>
<div>The full error message is as follows:</div>
<div><br></div>
<div>
<div>&lt;error xmlns="<a href="http://marklogic.com/xdmp/error" target="_blank">http://marklogic.com/xdmp/error</a>"&gt;</div>
<div>&nbsp; &lt;status-code&gt;400&lt;/status-code&gt;</div>
<div>&nbsp; &lt;status&gt;Bad Request&lt;/status&gt;</div>
<div>&nbsp; &lt;message-code&gt;MANAGE-INVALIDPAYLOAD&lt;/message-code&gt;</div>
<div>&nbsp; &lt;message&gt;MANAGE-INVALIDPAYLOAD: (err:FOER0000) Payload has errors in structure, content-type or values. XDMP-VALIDATEUNEXPECTED: (err:XQDY0027) validate strict { $pipeline } -- Invalid node: Found pp:options but expected any(lax,!(<a href="http://marklogic.com/manage/pipeline/properties)" target="_blank">http://marklogic.com/manage/pipeline/properties)</a>)? at fn:doc("")/pp:pipeline-properties/pp:state-transition/pp:execute/pp:condition/pp:options using schema "manage-pipeline-properties.xsd"&lt;/message&gt;</div>
<div>&lt;/error&gt;</div>
</div>
<div><br></div>
<div>The problem node looks like this:</div>
<div><br></div>
<div>
<div>&lt;condition&gt;</div>
<div>&nbsp; &nbsp; &lt;module&gt;/MarkLogic/cpf/actions/mimetype-condition.xqy&lt;/module&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;options&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mime-type&gt;application/xml&lt;/mime-type&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/options&gt;</div>
<div>&lt;/condition&gt;</div>
</div>
<div><br></div>
<div>We have also tried putting the options element in as..</div>
<div><br></div>
<div>
<div>&lt;options xmlns="/MarkLogic/cpf/actions/mimetype-condition.xqy"&gt;</div>
<div>&nbsp; &nbsp; &lt;mime-type&gt;application/xml&lt;/mime-type&gt;</div>
<div>&lt;/options&gt;</div>
</div>
<div><br></div>
<div>..which is how it is described in the Content Processing Framework Guide but this fails with a different error as follows:</div>
<div><br></div>
<div>
<div>&lt;error xmlns="<a href="http://marklogic.com/xdmp/error" target="_blank">http://marklogic.com/xdmp/error</a>"&gt;</div>
<div>&nbsp; &lt;status-code&gt;500&lt;/status-code&gt;</div>
<div>&nbsp; &lt;status&gt;Internal Server Error&lt;/status&gt;</div>
<div>&nbsp; &lt;message-code&gt;XDMP-VALIDATEUNEXPECTED&lt;/message-code&gt;</div>
<div>&nbsp; &lt;message&gt;XDMP-VALIDATEUNEXPECTED: (err:XQDY0027) validate strict { $pipeline } -- Invalid node: Found p:options but expected any(lax,!(<a href="http://marklogic.com/cpf/pipelines)" target="_blank">http://marklogic.com/cpf/pipelines)</a>)? at /p:pipeline/p:state-transition/p:execute/p:condition/p:options using schema "pipelines.xsd"&lt;/message&gt;</div>
<div>&lt;/error&gt;</div>
</div>
<div><br></div>
<div>If we remove the options element the pipeline loads via the API with no problems.</div>
<div><br></div>
<div>We are using MarkLogic Server Enterprise Edition 8.0-4.2</div>
<div><br></div>
<div>Many thanks</div>
<span><div>Rob Walpole</div></span>
</div>
<br>
</div></div>_______________________________________________<br>
General mailing list<br><a href="mailto:General@..." target="_blank">General <at> developer.marklogic.com</a><br>
Manage your subscription at:<br><a href="http://developer.marklogic.com/mailman/listinfo/general" rel="noreferrer" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br><br>
</blockquote>
</div>
<br>
</div>
<br>_______________________________________________<br>
General mailing list<br><a href="mailto:General@..." target="_blank">General <at> developer.marklogic.com</a><br>
Manage your subscription at:<br><a href="http://developer.marklogic.com/mailman/listinfo/general" rel="noreferrer" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br><br>
</blockquote>
</div>
<br>
</div>
</div>
<br>_______________________________________________<br>
General mailing list<br><a href="mailto:General@..." target="_blank">General <at> developer.marklogic.com</a><br>
Manage your subscription at:<br><a href="http://developer.marklogic.com/mailman/listinfo/general" rel="noreferrer" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br><br>
</blockquote>
</div>
</div></div>
<br>_______________________________________________<br>
General mailing list<br><a href="mailto:General@..." target="_blank">General <at> developer.marklogic.com</a><br>
Manage your subscription at:<br><a href="http://developer.marklogic.com/mailman/listinfo/general" rel="noreferrer" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br><br>
</blockquote>
</div>
<br>
</div>
</div></div>

Gmane