Geert Josten | 28 May 10:31 2016

Re: [MarkLogic Dev General] Regarading REST API

On CentOS/RedHat you do: yum install curl


Or in general, look here: https://curl.haxx.se/download.html

Cheers,
Geert

From: akshay gupta
Date: Saturday, May 28, 2016 at 9:58 AM
To: Geert Josten
Subject: Re: [MarkLogic Dev General] Regarading REST API

thanx greet..

how can i install curl.exe into my machine.


————————————————————————————————
On Friday, May 27, 2016 4:14 PM, Geert Josten wrote:


Hi Akshay,

These answers weren’t of any help?


Cheers,
Geert


Hi 

I want to install REST API in my local machine.In my machine Mrklogic is server is install.Please tell me how and where I can install REST API console.

Regards
Akshay Gupta


<div>
<div>On CentOS/RedHat you do: yum install curl</div>
<div><br></div>
<div>For Windows this seems to provide answers:&nbsp;<a href="http://stackoverflow.com/questions/9507353/how-do-i-install-set-up-and-use-curl-on-a-windows">http://stackoverflow.com/questions/9507353/how-do-i-install-set-up-and-use-curl-on-a-windows</a>
</div>
<div><br></div>
<div>Or in general, look here:&nbsp;<a href="https://curl.haxx.se/download.html">https://curl.haxx.se/download.html</a>
</div>
<div><br></div>
<div>Cheers,</div>
<div>Geert</div>
<div><br></div>
<span>
<div>
<span>From: </span>akshay gupta<br><span>Date: </span>Saturday, May 28, 2016 at 9:58 AM<br><span>To: </span>Geert Josten<br><span>Subject: </span>Re: [MarkLogic Dev General] Regarading REST API<br>
</div>
<div><br></div>
<div>
<div>
<div>
<div dir="ltr"><span>thanx greet..</span></div>
<div dir="ltr"><span><br></span></div>
<div dir="ltr"><span>how can i install curl.exe into my machine.</span></div>
<div class="qtdSeparateBR"><br></div>
</div>
</div>
</div>
</span>
<div><br></div>
<div>&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;</div>
<span>
<div>
<div>
<div>
<div class="yahoo_quoted">
<div>
<div>
<div dir="ltr">On Friday, May 27, 2016 4:14 PM, Geert Josten wrote:<br>
</div>
<br><br><div class="y_msg_container">
<div>
<div>
<div>Hi Akshay,</div>
<div><br clear="none"></div>
<div>These answers weren&rsquo;t of any help?</div>
<div><br clear="none"></div>
<div><a rel="nofollow" shape="rect" target="_blank" href="http://stackoverflow.com/questions/37469976/from-where-rest-api-is-downloaded?utm_source=twitterfeed&amp;utm_medium=twitter">http://stackoverflow.com/questions/37469976/from-where-rest-api-is-downloaded?utm_source=twitterfeed&amp;utm_medium=twitter</a></div>
<div><br clear="none"></div>
<div>Cheers,</div>
<div>Geert</div>
<div><br clear="none"></div>
<span></span>
<div class="yiv6220546561yqt2917958009">
<div>
<span>From: </span>&lt;<a rel="nofollow" shape="rect" ymailto="mailto:general-bounces@..." target="_blank" href="mailto:general-bounces@...">general-bounces@...</a>&gt; on behalf
 of akshay gupta &lt;<a rel="nofollow" shape="rect" ymailto="mailto:guptaakshay3254@..." target="_blank" href="mailto:guptaakshay3254 <at> yahoo.com">guptaakshay3254@...</a>&gt;<br clear="none"><span>Reply-To: </span>akshay gupta &lt;<a rel="nofollow" shape="rect" ymailto="mailto:guptaakshay3254@..." target="_blank" href="mailto:guptaakshay3254@...">guptaakshay3254 <at> yahoo.com</a>&gt;, MarkLogic Developer Discussion &lt;<a rel="nofollow" shape="rect" ymailto="mailto:general@..." target="_blank" href="mailto:general@...">general <at> developer.marklogic.com</a>&gt;<br clear="none"><span>Date: </span>Friday, May 27, 2016 at 12:23 PM<br clear="none"><span>To: </span>"<a rel="nofollow" shape="rect" ymailto="mailto:general@..." target="_blank" href="mailto:general@...">general@...logic.com</a>" &lt;<a rel="nofollow" shape="rect" ymailto="mailto:general@..." target="_blank" href="mailto:general <at> developer.marklogic.com">general@...</a>&gt;<br clear="none"><span>Subject: </span>[MarkLogic Dev General] Regarading REST API<br clear="none">
</div>
<div><br clear="none"></div>
<div>
<div>
<div>
<div>Hi&nbsp;</div>
<div><br clear="none"></div>
<div dir="ltr">I want to install REST API in my local machine.In my machine Mrklogic is server is install.Please tell me how and where I can install REST API console.</div>
<div dir="ltr"><br clear="none"></div>
<div dir="ltr">Regards</div>
<div dir="ltr">Akshay Gupta</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</span>
</div>
akshay gupta | 27 May 12:23 2016
Picon

[MarkLogic Dev General] Regarading REST API

Hi 

I want to install REST API in my local machine.In my machine Mrklogic is server is install.Please tell me how and where I can install REST API console.

Regards
Akshay Gupta
<div><div>
<div>Hi&nbsp;</div>
<div><br></div>
<div dir="ltr">I want to install REST API in my local machine.In my machine Mrklogic is server is install.Please tell me how and where I can install REST API console.</div>
<div dir="ltr"><br></div>
<div dir="ltr">Regards</div>
<div dir="ltr">Akshay Gupta</div>
</div></div>
Kari Cowan | 23 May 20:40 2016

[MarkLogic Dev General] How to handle very large xml file to prevent com.marklogic.xcc.exceptions.XQueryException: Time limit exceeded

There must be a better way to do this.  My script works fine when it’s loading a document that is not very large, but occassionally one of the docs is massive (13Mb on one of my error issues), and when that happens, in my application I get an error like:

com.marklogic.xcc.exceptions.XQueryException: Time limit exceeded

 

The script is basically getting a uri, reading it back and comparing the ‘firmname’ nodes (there can be many in the same document), and if it differs in the shortlist.xml, we change it to what that file says it should be.

 

The problem with my large file – there’s over 72,000 lawfirms it’s trying to compare

 

This is my script – anyone have a suggestion of a better way to accomplish what I am attempting?

 

 

 

xquery version "1.0-ml";

declare namespace html = "http://www.w3.org/1999/xhtml";

 

declare variable $uri as xs:string external;

let $uri := try { ($uri) } catch ($e) { "" }

(: let $uri:="/olympus/pacer-xml/9739715_3:15-cv-01221" :)

 

let $xml_doc:=fn:doc("/olympus/data-utils/standard_firmnames_shortlist.xml")

 

for $this_uri in "$uri"

let $doc := fn:doc($uri)

let $pacer_doc:=$doc

 

for $firms in $pacer_doc//(counsel|party)

  let $theOrigFirmname:= $firms/originalFirmname         

  let $theFirmname:= $firms/firmname

  let $translation:= $xml_doc//firmname[.=$theOrigFirmname]/../translation/text()

 

 

for $firm in $pacer_doc

return if( fn:exists($translation) and fn:exists($theFirmname) and ($translation ne $theFirmname ) ) then

(

  fn:concat("CHANGING FIRMNAME: ",$theFirmname, " TO STANDARD FIRMNAME TRANSLATION: ",$translation, " IN URI: " ,$uri),

  xdmp:log(fn:concat("Olympotomus Changed Firmname: ",$theFirmname, " in URI: " ,$uri)),

  xdmp:node-replace($theFirmname,<firmname>{$translation}</firmname>) 

 )

else (

  fn:concat("...Evaluated and did not change Firmname: ",$theFirmname, " in URI: " ,$uri),

  xdmp:log(fn:concat("Olympotomus Evaluated and did not change a Firmname: ",$theFirmname, " in URI: " ,$uri))

  )

ALM, an information and intelligence company, provides customers with critical news, data, analysis, marketing solutions and events to successfully manage the business of business. 

 

Customers use ALM solutions to discover new ideas and approaches for solving business challenges, connect to the right professionals and peers to move business forward, and compete to win through access to data, analytics and insight. ALM serves a community of over six million business professionals seeking to discover, connect and compete in highly complex industries. Learn more at www.alm.com

<div>
<div class="WordSection1">
<p class="MsoNormal">There must be a better way to do this.&nbsp; My script works fine when it&rsquo;s loading a document that is not very large, but occassionally one of the docs is massive (13Mb on one of my error issues), and when that happens, in my application I
 get an error like:<p></p></p>
<p class="MsoNormal">com.marklogic.xcc.exceptions.XQueryException: Time limit exceeded<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">The script is basically getting a uri, reading it back and comparing the &lsquo;firmname&rsquo; nodes (there can be many in the same document), and if it differs in the shortlist.xml, we change it to what that file says it should be.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">The problem with my large file &ndash; there&rsquo;s over 72,000 lawfirms it&rsquo;s trying to compare<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">This is my script &ndash; anyone have a suggestion of a better way to accomplish what I am attempting?<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">xquery version "1.0-ml";<p></p></p>
<p class="MsoNormal">declare namespace html = "http://www.w3.org/1999/xhtml";<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">declare variable $uri as xs:string external;<p></p></p>
<p class="MsoNormal">let $uri := try { ($uri) } catch ($e) { "" }<p></p></p>
<p class="MsoNormal">(: let $uri:="/olympus/pacer-xml/9739715_3:15-cv-01221" :)<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">let $xml_doc:=fn:doc("/olympus/data-utils/standard_firmnames_shortlist.xml")<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">for $this_uri in "$uri"<p></p></p>
<p class="MsoNormal">let $doc := fn:doc($uri)<p></p></p>
<p class="MsoNormal">let $pacer_doc:=$doc<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">for $firms in $pacer_doc//(counsel|party) <p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;let $theOrigFirmname:= $firms/originalFirmname&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <p></p></p>
<p class="MsoNormal">&nbsp; let $theFirmname:= $firms/firmname<p></p></p>
<p class="MsoNormal">&nbsp; let $translation:= $xml_doc//firmname[.=$theOrigFirmname]/../translation/text()<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">for $firm in $pacer_doc<p></p></p>
<p class="MsoNormal">return if( fn:exists($translation) and fn:exists($theFirmname) and ($translation ne $theFirmname ) ) then<p></p></p>
<p class="MsoNormal">(<p></p></p>
<p class="MsoNormal">&nbsp; fn:concat("CHANGING FIRMNAME: ",$theFirmname, " TO STANDARD FIRMNAME TRANSLATION: ",$translation, " IN URI: " ,$uri),
<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;xdmp:log(fn:concat("Olympotomus Changed Firmname: ",$theFirmname, " in URI: " ,$uri)),
<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;xdmp:node-replace($theFirmname,&lt;firmname&gt;{$translation}&lt;/firmname&gt;)&nbsp;
<p></p></p>
<p class="MsoNormal">&nbsp;)<p></p></p>
<p class="MsoNormal">else (<p></p></p>
<p class="MsoNormal">&nbsp; fn:concat("...Evaluated and did not change Firmname: ",$theFirmname, " in URI: " ,$uri),<p></p></p>
<p class="MsoNormal">&nbsp; xdmp:log(fn:concat("Olympotomus Evaluated and did not change a Firmname: ",$theFirmname, " in URI: " ,$uri))<p></p></p>
<p class="MsoNormal">&nbsp; )<p></p></p>
</div>

<div>
<p></p>
<p class="MsoNormal"><span>ALM,
an information and intelligence company, provides customers with critical news,
data, analysis,&nbsp;marketing solutions and events to successfully manage the
business of business.&nbsp;</span><p></p></p> <p class="MsoNormal"><span>&nbsp;</span><p></p></p> <p class="MsoNormal"><span>Customers
use ALM solutions to discover new ideas and approaches for solving business
challenges, connect to the right professionals and peers to move business
forward, and compete to win through access to data, analytics and insight. ALM
serves a community of over six million business professionals seeking to
discover, connect and compete in highly complex industries. Learn more at <a href="www.alm.com">www.alm.com</a>.&nbsp;</span><p></p></p>
</div>
</div>
Sebastien Vige | 18 May 17:14 2016

[MarkLogic Dev General] Banking - ml vs ms sql (or oracle) | performance story

Team,
We are battling with a dev team. We need to show them ML is faster than MSSQL.

In which user story (banking or other) can we reference / present a factual performance gain ?

This will help us to convince our prospect.

Our use cases are CRM web app fueled by ML as well as a mini tradestore.

Any input welcome !

Tx 

Seb


Kind Regards

Sebastien

Envoyé de mon iPhone
_______________________________________________
General mailing list
General <at> developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general
Florent Georges | 18 May 09:13 2016

[MarkLogic Dev General] JavaScript: add node to a JSON document

Hi,

I am sure I am missing something simple here...  I am trying to add an
object node to a JSON doc stored in the database using JavaScript.
But all examples and documentation I can find are about either JavaScript
manipulating XML nodes, or XQuery manipulating JSON documents.

Especially, in XQuery, one can use object-node {} to construct an object
node.  Which in turn can be used with e.g. xdmp:node-insert-child().
But if I try the following in JavaScript:

    xdmp.nodeInsertChild(
        fn.doc(uri).next().value.root.foo,
        { three: [ 'tres', 3, 'trois' ] });

then I get the following error:

    [javascript] XDMP-CHILDUNNAMED: xdmp.nodeInsertChild(
        fn.head(xdmp.unpath("fn:doc('...')/foo")),
            {"three":["tres", 3, "trois"]})
        -- Object nodes cannot have unnamed children

Any idea what (quite obvious I presume) I am missing?

Regards,

--

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
Will Thompson | 17 May 20:09 2016

[MarkLogic Dev General] POST multiple documents in a single request

Is there a recommended method of posting multiple documents to a ML endpoint in one request? Maybe this is a
more general HTTP question, but I have tried several permutations of curl options, and unfortunately the
only one that works on the ML side involves joining the documents together into a single payload with
multiple root elements:

curl -u user:pass -k -X POST \
  -H "Content-Type: text/xml" \
  -d '<Document>Document 1</Document><Document>Document 2</Document>' \
  https://localhost:1234/my-endpoint

And in XQuery, the sequence of <Document> elements is retrieved by xdmp:get-request-body()/node(). But
this can't be right, can it?

-Will
Anthony Coates | 16 May 10:51 2016

Re: [MarkLogic Dev General] sem.sparql: get bound placeholders in the result

Classification: Public

Hi Florent.  Would it be a problem to just call the query (multiple times) with a single subject for each of the
different subjects that you want, and then combine the results?

Cheers, Tony.

-----Original Message-----
From: general-bounces@...
[mailto:general-bounces@...] On Behalf Of
Florent Georges
Sent: 15 May 2016 12:42
To: MarkLogic Developer Discussion <general@...>
Subject: [MarkLogic Dev General] sem.sparql: get bound placeholders in the result

Hi,

Using `sem.sparql()`, it is possible to bind a SPARQL placeholder to an array, to serve as many
alternatives to the placeholder in the triples pattern.  For instance, the following query:

    require('/MarkLogic/semantics').sparql(
       'SELECT * WHERE { ?s ?p ?o }',
       { 's': [ sem.iri('#1'), sem.iri('#2') ] })

returns the predicates and values for al triples with the subject equal to either `#1` or `#2`.

Problem is, the bound placeholder is not part of the result (in this example, `?s`).  The result is an
iterator over objects of the following form:

    { p: "#pred", o: "value" }

So it is not possible to use the result in a way to would need to know which subject each row is attached to
(which I believe is generally the case when binding them to arrays, as opposed to scalar values).

Is there any way to have `sem.sparql()` include bound placeholders in the result?

Regards,

--
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
_______________________________________________
General mailing list
General@...
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general

---
This e-mail may contain confidential and/or privileged information. If you are not the intended
recipient (or have received this e-mail in error) please notify the sender immediately and delete this
e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and
regulatory disclosures and to http://www.db.com/unitedkingdom/content/privacy.htm for
information about privacy.
Gary Vidal | 16 May 02:52 2016
Picon

Re: [MarkLogic Dev General] General Digest, Vol 143, Issue 21

You can bind to an external variable that returns the subject outside the binding like so:

'use strict';
//xdmp.documentInsert("/foo.xml",{"triple" : sem.triple(sem.iri('foo'),sem.iri('hasBar'),sem.iri('bar'))});

var sem = require('/MarkLogic/semantics');
var s0 = { 's0': [ sem.iri('foo')] }
sem.sparql('SELECT * WHERE { ?s ?p ?o  FILTER(?s = ?s0)}',s0)


On Sun, May 15, 2016 at 3:00 PM, <general-request-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org> wrote:
Send General mailing list submissions to
        general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://developer.marklogic.com/mailman/listinfo/general
or, via email, send a message with subject or body 'help' to
        general-request-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

You can reach the person managing the list at
        general-owner-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."


Today's Topics:

   1. sem.sparql: get bound placeholders in the result (Florent Georges)


----------------------------------------------------------------------

Message: 1
Date: Sun, 15 May 2016 13:41:47 +0200
From: Florent Georges <lists <at> fgeorges.org>
Subject: [MarkLogic Dev General] sem.sparql: get bound placeholders in
        the     result
To: MarkLogic Developer Discussion <general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org>
Message-ID:
        <CADyR_r2yxSC__=qmf83eECJH=uasFVz+amdQArAdAQKR75PadA <at> mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi,

Using `sem.sparql()`, it is possible to bind a SPARQL placeholder to
an array, to serve as many alternatives to the placeholder in the
triples pattern.  For instance, the following query:

    require('/MarkLogic/semantics').sparql(
       'SELECT * WHERE { ?s ?p ?o }',
       { 's': [ sem.iri('#1'), sem.iri('#2') ] })

returns the predicates and values for al triples with the subject
equal to either `#1` or `#2`.

Problem is, the bound placeholder is not part of the result (in this
example, `?s`).  The result is an iterator over objects of the
following form:

    { p: "#pred", o: "value" }

So it is not possible to use the result in a way to would need to know
which subject each row is attached to (which I believe is generally
the case when binding them to arrays, as opposed to scalar values).

Is there any way to have `sem.sparql()` include bound placeholders in
the result?

Regards,

--
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


------------------------------

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


End of General Digest, Vol 143, Issue 21
****************************************

<div>
<div dir="ltr">You can bind to an external variable that returns the subject outside the binding like so:<div><br></div>
<div>
<div>'use strict';</div>
<div>//xdmp.documentInsert("/foo.xml",{"triple" : sem.triple(sem.iri('foo'),sem.iri('hasBar'),sem.iri('bar'))});</div>
<div><br></div>
<div>var sem = require('/MarkLogic/semantics');</div>
<div>var s0 = { 's0': [ sem.iri('foo')] }</div>
<div>sem.sparql('SELECT * WHERE { ?s ?p ?o &nbsp;FILTER(?s = ?s0)}',s0)</div>
</div>
<div><br></div>
</div>
<div class="gmail_extra">
<br><div class="gmail_quote">On Sun, May 15, 2016 at 3:00 PM,  <span dir="ltr">&lt;<a href="mailto:general-request@..." target="_blank">general-request@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">Send General mailing list submissions to<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general@...om">general@...</a><br><br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.marklogic.com/mailman/listinfo/general" rel="noreferrer" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br>
or, via email, send a message with subject or body 'help' to<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general-request@...klogic.com">general-request@...</a><br><br>
You can reach the person managing the list at<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general-owner@...ogic.com">general-owner@...</a><br><br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of General digest..."<br><br><br>
Today's Topics:<br><br>
&nbsp; &nbsp;1. sem.sparql: get bound placeholders in the result (Florent Georges)<br><br><br>
----------------------------------------------------------------------<br><br>
Message: 1<br>
Date: Sun, 15 May 2016 13:41:47 +0200<br>
From: Florent Georges &lt;<a href="mailto:lists@...">lists <at> fgeorges.org</a>&gt;<br>
Subject: [MarkLogic Dev General] sem.sparql: get bound placeholders in<br>
&nbsp; &nbsp; &nbsp; &nbsp; the&nbsp; &nbsp; &nbsp;result<br>
To: MarkLogic Developer Discussion &lt;<a href="mailto:general <at> developer.marklogic.com">general@...</a>&gt;<br>
Message-ID:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;CADyR_r2yxSC__=qmf83eECJH=<a href="mailto:uasFVz%2BamdQArAdAQKR75PadA@...">uasFVz+amdQArAdAQKR75PadA <at> mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=UTF-8<br><br>
Hi,<br><br>
Using `sem.sparql()`, it is possible to bind a SPARQL placeholder to<br>
an array, to serve as many alternatives to the placeholder in the<br>
triples pattern.&nbsp; For instance, the following query:<br><br>
&nbsp; &nbsp; require('/MarkLogic/semantics').sparql(<br>
&nbsp; &nbsp; &nbsp; &nbsp;'SELECT * WHERE { ?s ?p ?o }',<br>
&nbsp; &nbsp; &nbsp; &nbsp;{ 's': [ sem.iri('#1'), sem.iri('#2') ] })<br><br>
returns the predicates and values for al triples with the subject<br>
equal to either `#1` or `#2`.<br><br>
Problem is, the bound placeholder is not part of the result (in this<br>
example, `?s`).&nbsp; The result is an iterator over objects of the<br>
following form:<br><br>
&nbsp; &nbsp; { p: "#pred", o: "value" }<br><br>
So it is not possible to use the result in a way to would need to know<br>
which subject each row is attached to (which I believe is generally<br>
the case when binding them to arrays, as opposed to scalar values).<br><br>
Is there any way to have `sem.sparql()` include bound placeholders in<br>
the result?<br><br>
Regards,<br><br>
--<br>
Florent Georges<br><a href="http://fgeorges.org/" rel="noreferrer" target="_blank">http://fgeorges.org/</a><br><a href="http://h2oconsulting.be/" rel="noreferrer" target="_blank">http://h2oconsulting.be/</a><br><br><br>
------------------------------<br><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><br>
End of General Digest, Vol 143, Issue 21<br>
****************************************<br>
</blockquote>
</div>
<br>
</div>
</div>
Florent Georges | 15 May 13:41 2016

[MarkLogic Dev General] sem.sparql: get bound placeholders in the result

Hi,

Using `sem.sparql()`, it is possible to bind a SPARQL placeholder to
an array, to serve as many alternatives to the placeholder in the
triples pattern.  For instance, the following query:

    require('/MarkLogic/semantics').sparql(
       'SELECT * WHERE { ?s ?p ?o }',
       { 's': [ sem.iri('#1'), sem.iri('#2') ] })

returns the predicates and values for al triples with the subject
equal to either `#1` or `#2`.

Problem is, the bound placeholder is not part of the result (in this
example, `?s`).  The result is an iterator over objects of the
following form:

    { p: "#pred", o: "value" }

So it is not possible to use the result in a way to would need to know
which subject each row is attached to (which I believe is generally
the case when binding them to arrays, as opposed to scalar values).

Is there any way to have `sem.sparql()` include bound placeholders in
the result?

Regards,

--

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
Gary Larsen | 12 May 16:16 2016

[MarkLogic Dev General] Query console output

After upgrading to version 8 I can’t seem to get the console to output tab characters:

 

                concat($rpt/lookupInfo/packageDisplayPath, '&#9;',
….

 

This is useful for pasting into Excel.  Is this still possible?

 

Thanks,

Gary

 

<div><div class="WordSection1">
<p class="MsoNormal">After upgrading to version 8 I can&rsquo;t seem to get the console to output tab characters:<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>concat</span><span>(</span><span>$</span><span>rpt</span><span>/</span><span>lookupInfo</span><span>/</span><span>packageDisplayPath, </span><span>'&amp;#9;'</span><span>, <br></span>&hellip;.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">This is useful for pasting into Excel.&nbsp; Is this still possible?<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Thanks,<p></p></p>
<p class="MsoNormal">Gary<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
</div></div>
Johan de Boer | 11 May 17:36 2016

[MarkLogic Dev General] Problem "Invalid lexical value" by a strange combination of check and value.

We are using MarkLogic 8.0-4.2 and we sometimes have a problem with "Invalid lexical value" which I will explain in more detail below.

We have stored documents in a database which fulfill a certain schema. In this schema there are defintions for attributes. In these definitions allowable values are given or the pattern which the value should meet.

Our application which uses these documents sometimes gives an error "Invalid lexical value" in very strange circumstances. This happens when we fetch certain elements within a document.

The error is: XDMP-LEXVAL: tei:rilmteidata.versionNumber("heading").

heading: is the value of the attribute 'type' which is present in the element we are fetching.
tei:rilmteidata.versionNumber: according to the schema used is a check on the versionNumber attribute which should have a format of digits separated by dots. But this check with tei:rilmteidata.versionNumber should not be applied here. This is related to a complete other attribute in another element in the document. So it looks like a schema check is combined with a value which make no sense.

This happens only for a very few documents within our database and only within a limited time frame.
During this time frame there are documents having the same schema which do not give any problems when fetchting the relevant elements. After some time all works fine for all documents. Hence we are now not able to reproduce this problem anymore. In the past months we have had this problem twice during a period of a couple of hours.

I do not have an idea what the problem can be.

Has anyone had similar problems? Does anyone have an idea what might be the case here?

Thanks and regards,


Johan de Boer


<div>
<div>
<p></p>
<div>We are using MarkLogic 8.0-4.2 and we sometimes have a problem with "Invalid lexical value" which I will explain in more detail below.<br><br>
We have stored documents in a database which fulfill a certain schema. In this schema there are defintions for attributes. In these definitions allowable values are given or the pattern which the value should meet.<br><br>
Our application which uses these documents sometimes gives an error "Invalid lexical value" in very strange circumstances. This happens when we fetch certain elements within a document.<br><br>
The error is: XDMP-LEXVAL: tei:rilmteidata.versionNumber("heading").<br><br>
heading: is the value of the attribute 'type' which is present in the element we are fetching.<br>
tei:rilmteidata.versionNumber: according to the schema used is a check on the versionNumber attribute which should have a format of digits separated by dots. But this check with tei:rilmteidata.versionNumber should not be applied here. This is related to a
 complete other attribute in another element in the document. So it looks like a schema check is combined with a value which make no sense.<br><br>
This happens only for a very few documents within our database and only within a limited time frame.
<br>
During this time frame there are documents having the same schema which do not give any problems when fetchting the relevant elements. After some time all works fine for all documents. Hence we are now not able to reproduce this problem anymore. In the past
 months we have had this problem twice during a period of a couple of hours.<br><br>
I do not have an idea what the problem can be.<br><br>
Has anyone had similar problems? Does anyone have an idea what might be the case here?</div>
<br><p></p>
<p>Thanks and regards,</p>
<p><br></p>
<p>Johan de Boer</p>
<p><br></p>
</div>
</div>

Gmane