Re: [MarkLogic Dev General] Strange issue with xdmp:node-delete

2018-01-31 Thread David Ennis
I think that you are getting a deadlock by referencing the element via the red 
and subsequent xpath into the document while in the same transaction trying to 
update the document.

Isolating the read of the document should work. Likewise, you can isolate the 
node-delete as well, but that could have an impact on the way you are expecting 
your transactions to work.


Please try to isolate this line into a separate transaction using 
xdmp:invoke-function()
‘let $doc := fn:doc(db:get-uri-by-rid($rid))/l:expression’
- isolation: different transaction
- update-auto-commit

You may also want to use the ‘prevent-deadlocks’ option to throw an error if 
your code has, in fact, created a deadlock situation.


My theory can be tested by removing the following lines:
let $doc := fn:doc(db:get-uri-by-rid($rid))/l:expression
$doc/l:exportChannels/l:exportChannel[@href = 
$exportlib:channel-rid-i2])/l:precomputedValues

-David


--


From:  on behalf of Lanz 

Reply-To: MarkLogic Developer Discussion 
Date: Wednesday, January 31, 2018 at 7:08 PM
To: MarkLogic Developer Discussion 
Subject: Re: [MarkLogic Dev General] Strange issue with xdmp:node-delete

yes Florent, it returns the doc uri

On Wed, Jan 31, 2018 at 6:53 PM, Florent Georges 
> wrote:
Just in case, you can confirm that the node you are about to delete is indeed 
from a stored document with something like the following :

xdmp:log(fn:document-uri(fn:root($node)))
--
Florent Georges
H2O Consulting
http://h2o.consulting/

On 31 Jan 2018 18:47, "Lanz" 
> wrote:
Hi Mister Florent,

Thks for your answer.
There is no symptom at all: no exception, no specific log, no deletion. When I 
run the 'real' script on QConsole (or Oxygen connected through xdbc to ML), it 
returns the focus after a while (whitout SVC-EXTIME) without any deletion.
I'm trying with a colleague to simplify the script and recreate a readable case 
for everyone.
For now it seems that the sem:sparql combined with sem:store has some 
influences on this behavior

So I will come back soon with a simplified script.
Lanz


On Wed, Jan 31, 2018 at 6:26 PM, Florent Georges 
> wrote:
>
> Salut Lancelot,
>
> I might have missed it, but what is the exact symptom? Any error message? 
> Have you tried the "real" script through QConsole? Any chance you simplify it 
> and post it here? More pairs of eyes might catch something you missed...
>
> Regards,
>
> --
> Florent Georges
> H2O Consulting
> http://h2o.consulting/
>
> On 30 Jan 2018 22:29, "Lanz" 
> > wrote:
>>
>> Hi all,
>>
>> I've got this strange issue with xdmp:node-delete with a node in the 
>> database with Marklogic 8.0-6.3.
>> First when I use xdmp:node-delete on the target node with the above basic 
>> script, it works:
>> 
>> xquery version "1.0-ml";
>> declare namespace html = "http://www.w3.org/1999/xhtml;;
>> declare namespace l="http://www.oecd.org/ns/lambda/schema/;;
>> import module namespace db = "http://www.oecd.org/ns/lambda/app/lib/db; at 
>> "/app/lib/db/db.xqm";
>> import module namespace exportlib = 
>> "http://www.oecd.org/ns/lambda/app/lib/export; at 
>> "/app/lib/export/export.xqm";
>> declare variable $keyName-parent-toc-info as xs:string := 'parent-toc-info';
>> let $rid := 'urn:oecd.org:publications:id:expression:g2g12781'
>> let $doc := fn:doc(db:get-uri-by-rid($rid))/l:expression
>> return
>> (
>> (: display parent node before child node deletion :)
>> $doc/l:exportChannels/l:exportChannel[@href = 
>> $exportlib:channel-rid-i2])/l:precomputedValues
>> ,xdmp:node-delete($doc/l:exportChannels/l:exportChannel[@href = 
>> $exportlib:channel-rid-i2])/l:precomputedValues/l:precomputedValue[@key = 
>> $keyName-parent-toc-info]
>> )
>> 
>> The node 'l:precomputedValues[l:precomputedValue[@key = 
>> $keyName-parent-toc-info]]' is removed from document in database
>>
>> But if I try to do it in the following script (the real script), it does not 
>> work:
>> 1- I populate a map $mapA with ids of eligible documents based on a 
>> sem:sparql query using a sem:store constructor
>> 2- I populate a map $mapB with ids of larger set of documents based on a 
>> sem:sparql query using a sem:store constructor with a 
>> cts:element-attribute-value-query on the element to be deleted 
>> (cts:element-attribute-value-query 
>> (xs:QName('l:precomputedValue'),xs:QName('key'), $keyName-parent-toc-info)) 
>> among other cts:query constructor
>> 3- Then I create a 3rd map based on the difference of the two maps ($mapB - 
>> $mapA)
>> 4- I loop over this map 

Re: [MarkLogic Dev General] Exit query without writing to error log?

2018-01-24 Thread David Ennis
HI Evan,

Hmm. I just did the same test and was surprised. But yes, still logging the 
error seems to match the documentation.. Sorry about that. My only other 
suggestion is: Is there any common code used as some sort of standard 
invoker/router to the rest of your code? If so, that may be the best place to 
put a tray catch and let the rest bubble up to that point.

Regards,
David

--


From: <general-boun...@developer.marklogic.com> on behalf of Evan Lenz 
<e...@evanlenz.net>
Reply-To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Date: Thursday, January 25, 2018 at 1:43 AM
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Subject: Re: [MarkLogic Dev General] Exit query without writing to error log?

Hi David,

Following up on this. I tried the custom error handler, and it appears that the 
errors are not actually caught but just forwarded to the error-handler XQuery. 
The impact of this for me (and which is what I'm trying to address) is that the 
errors are still written to the error log, regardless of whether they are 
handled by a custom error handler. Does this accord with your understanding of 
how it's supposed to work?

Do you have any other ideas for how to prevent the writing to the error log? If 
not, we will probably need to restructure the queries to not throw an XQuery 
error at all and just send the appropriate response code and error message. 
Darn, oh well.

Thanks,
Evan

On Wed, Jan 24, 2018 at 2:45 PM, Evan Lenz 
<e...@evanlenz.net<mailto:e...@evanlenz.net>> wrote:
Thanks, guys. David, the custom error handler is a great idea. I had forgotten 
about this option. We're not currently using it but definitely will soon. It 
will help us move forward without fundamentally changing the structure of many 
queries. It will enable us to wrap a virtual try/catch around everything 
without having to change the code itself. Very helpful!

Thanks again,
Evan


On Wed, Jan 24, 2018 at 4:57 AM, David Ennis 
<david.en...@marklogic.com<mailto:david.en...@marklogic.com>> wrote:
HI.

Further to Florent’s comment, assuming your code is OK with the error bubbling 
up to the top, you can catch them all in a single place and act accordingly  
using a custom error handler. Using this in conjunction with throwing your own 
errors (and handling the code in the top-level handler) can be useful.

https://docs.marklogic.com/guide/app-dev/appserver-control#id_89735

Regards,
David

--


From: 
<general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>>
 on behalf of Florent Georges <li...@fgeorges.org<mailto:li...@fgeorges.org>>
Reply-To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Date: Wednesday, January 24, 2018 at 1:53 PM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Exit query without writing to error log?

Hi Evan,

The error is logged only if it "reaches the top", that is, if it is not caught.

If the error shouldn't behave as such, can't you just catch it before? (and 
yes, potentially return wathever HTTP response you deem appropriate).

Regards,

--
Florent Georges
H2O Consulting
http://h2o.consulting/


On 24 January 2018 at 03:22, Evan Lenz wrote:
Hello,

My client has XQuery parameter-validation code which calls the error() function 
when invalid parameters are supplied. This event gets written to the error log. 
Is there a way to prevent this?

I recognize the best practice is to return a more appropriate HTTP response 
code (than 500) when handling invalid input. I also recognize this is anathema 
to FP. But my question still stands:

Is there a way to interrupt/exit a query without triggering an Error-level log 
message?

Thanks,

Evan Lenz
President, Lenz Consulting Group, Inc.
http://lenzconsulting.com

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


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


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] question about transactions

2018-01-24 Thread David Ennis
Please look up the options for xdmp:eval and note the following options 
explained there:
- transaction-mode
- isolation

Then change your eval to have the following options:
- transaction-mode=update-auto-commit
- isolation = different transaction

Then move the sem:sparql statement below the eval in your main code.

What are you doing here?

You are telling the insert to run as a separate transaction and auto-commit. 
This makes the triples available immediately after the eval is done. Therefore, 
you should run the select in the main code and not the isolated transaction.

Careful with the use of different transactions via eval and invoke. The wrong 
combination can get you into a deadlock.

Regards,
David Ennis

--


From: <general-boun...@developer.marklogic.com> on behalf of Erik Zander 
<erik.zan...@studentlitteratur.se>
Reply-To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Date: Wednesday, January 24, 2018 at 5:35 PM
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Subject: [MarkLogic Dev General] question about transactions

Hi All,

I have a question about I think transactions.

I want to insert some rdf and then query the database, and I want to do this in 
a function so I can call the function and depending on if I have the data in 
Marklogic or not get the data as rdf and insert it.

But my problem is that the following code only returns result second time I 
call it.
I’m thankful for pointers here
Regards
Erik
Code below
==

xquery version "1.0-ml" encoding "utf-8";


import module namespace sem = "http://marklogic.com/semantics;
  at "/MarkLogic/semantics.xqy";
declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#;;

let $wDataRdf :=
http://www.w3.org/1999/02/22-rdf-syntax-ns#;
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#;

  xmlns:wikibase="http://wikiba.se/ontology#;
  xmlns:wd="http://www.wikidata.org/entity/;
  >
http://www.wikidata.org/entity/Q925hhq;>
mup



let $insert :=  xdmp:eval(
'
import module namespace sem = "http://marklogic.com/semantics;
  at "/MarkLogic/semantics.xqy";
declare variable $wDataRdf as node() external;
sem:rdf-insert(sem:rdf-parse($wDataRdf,("rdfxml", 
"graph=http://www.wikidata.org;)))'
,(xs:QName("wDataRdf"), $wDataRdf)
)
return sem:sparql('
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?label WHERE {
   wd:Q925hhq  rdfs:label ?label
   FILTER (langMatches( lang(?label), "SV" ) )
}'
)




___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Exit query without writing to error log?

2018-01-24 Thread David Ennis
HI.

Further to Florent’s comment, assuming your code is OK with the error bubbling 
up to the top, you can catch them all in a single place and act accordingly  
using a custom error handler. Using this in conjunction with throwing your own 
errors (and handling the code in the top-level handler) can be useful.

https://docs.marklogic.com/guide/app-dev/appserver-control#id_89735

Regards,
David

--


From:  on behalf of Florent Georges 

Reply-To: MarkLogic Developer Discussion 
Date: Wednesday, January 24, 2018 at 1:53 PM
To: MarkLogic Developer Discussion 
Subject: Re: [MarkLogic Dev General] Exit query without writing to error log?

Hi Evan,

The error is logged only if it "reaches the top", that is, if it is not caught.

If the error shouldn't behave as such, can't you just catch it before? (and 
yes, potentially return wathever HTTP response you deem appropriate).

Regards,

--
Florent Georges
H2O Consulting
http://h2o.consulting/


On 24 January 2018 at 03:22, Evan Lenz wrote:
Hello,

My client has XQuery parameter-validation code which calls the error() function 
when invalid parameters are supplied. This event gets written to the error log. 
Is there a way to prevent this?

I recognize the best practice is to return a more appropriate HTTP response 
code (than 500) when handling invalid input. I also recognize this is anathema 
to FP. But my question still stands:

Is there a way to interrupt/exit a query without triggering an Error-level log 
message?

Thanks,

Evan Lenz
President, Lenz Consulting Group, Inc.
http://lenzconsulting.com

___
General mailing list
General@developer.marklogic.com
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Unable to set replica forest for data hub using gradle

2018-01-23 Thread David Ennis
I believe the forest replica names need to be unique. You use 
stage-forest-1-Replica twice.


Regards,

David Ennis


From: general-boun...@developer.marklogic.com 
<general-boun...@developer.marklogic.com> on behalf of 
vikas.sin...@cognizant.com <vikas.sin...@cognizant.com>
Sent: 23 January 2018 18:22:10
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Unable to set replica forest for data hub 
using gradle

Hi All,

We have 3 node cluster and want to set 8 forest (3,3,2) on 3 node cluster by 
using gradle . We decided to go with payload driven approach for configuring 
forest on each host as we want.
I am successfully able to configure forest on each host by using below payload.

Example: Payload with 2 forest only
[
 {
  “forest-name”:”stage-forest-1”,
   “host”:host1,
  “database”:test
   },
 {
  “forest-name”:”stage-forest-2”,
   “host”:host1,
  “database”:test
   }
]

Gradle mlDeploy command using perfectly  and setting forest on desired host.

Now I want to set replica of same forest must be created on different host so I 
changed my payload as below.
[
 {
  “forest-name”:”stage-forest-1”,
   “host”:host1,
  “database”:test,
 “forest-replicas”:
   {
 “forest-replica”:
[
 {
  “replica-name”:”stage-forest-1-Replica”,
   “host” : “host2”
  },
{
  “replica-name”:”stage-forest-1-Replica”,
   “host” : “host3”
  }

]
}
   }
]

Using same command gradle mlDeploy

For above pay load I am getting build failure as whenever I am trying to set up 
replica forest .
I am getting below message.

“MANAGE-CONFLICTINGCONFIG” : A conflict has been detected. A forest with the 
name stage-forest-1-Replica but different configuration exist.

Please guide me if I am doing anything wrong setting replica forest.

Thanks,
Vikas Singh
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.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Email notifications for successful and failed ML backups

2015-10-08 Thread David Ennis
In ErrorLog, the backup information is logged as Info - so as long as you have 
that log level, then it is likely that COTS monitoring software can handle this.


Keep in mind, there is likely not just 1 success/fail you are looking for.  
When you back up a database, you may also be backing up forests, security db, 
schemas db, etc - depending on your  settings. EACH of those has their own log 
message set "Starting backup of xxx, Finishing xxx, finished xxx" etc.  You 
know that they are all part of the same backup job from the job id.




DAVID ENNIS
t: +31630917280<tel:%2B31630917280>
[http://www.hinttech.com/signature/tahzoo_logo.jpg]



From: general-boun...@developer.marklogic.com 
<general-boun...@developer.marklogic.com> on behalf of Geert Josten 
<geert.jos...@marklogic.com>
Sent: Thursday, October 8, 2015 8:50 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Email notifications for successful and 
failed ML backups

You could of course run scheduled tasks inside MarkLogic, but it would indeed 
be nice if you could execute some script after each backup. Unfortunately, that 
doesn't seem possible.

You might be able to watch logging though. I'm not entirely sure, but I think I 
heard colleagues talk about monitoring syslog for instance..

Cheers,
Geert

From: 
<general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>>
 on behalf of "Gulik, Ernest" <egu...@aha.org<mailto:egu...@aha.org>>
Reply-To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Date: Wednesday, October 7, 2015 at 4:15 PM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Email notifications for successful and 
failed ML backups


Hello,

I'm trying to setup similar backups with notifications as well in ML 7 but it 
doesn't seem like this functionality is supported out of the box.

Our approach is to setup cronjob that would execute script with xqueries.

I'm exploring tool https://developer.marklogic.com/code/cqsh that supposed to 
be an alternative to web gui but it's a pain to setup prerequisites.

Maybe someone who knows a lot about MarkLogic could respond if maybe cqsh could 
be a better approach to backups with notifications (or command line management) 
or maybe there's a better way of attacking that task ?







Thank you,

Ernest G.



From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sinang
Sent: Tuesday, October 06, 2015 5:56 PM
To: general 
<General@developer.marklogic.com<mailto:General@developer.marklogic.com>>
Subject: [MarkLogic Dev General] Email notifications for successful and failed 
ML backups



Is there a way to make ML send email notifications for successful and failed 
scheduled backups (configured via the ML admin UI) ?



Regards,
Danny




___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] xdmp:forest-clear

2015-10-02 Thread David Ennis
Are you doing this as Admin?


I believe that in some situations, Admin bypasses some checks.


So for a non-admin user, the results may be as you expect.


DAVID ENNIS
t: +31630917280<tel:%2B31630917280>
[http://www.hinttech.com/signature/tahzoo_logo.jpg]



From: general-boun...@developer.marklogic.com 
<general-boun...@developer.marklogic.com> on behalf of Andreas Hubmer 
<andreas.hub...@ebcont.com>
Sent: Friday, October 2, 2015 5:35 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] xdmp:forest-clear

Hello,

I've found an issue with xdmp:forest-clear.

xdmp:document-insert("test.xml", );
xdmp:forest-clear(xdmp:database-forests(xdmp:database()));
doc("test.xml") (: should be empty :)

When executing the above multi statement transaction, I would expect an empty 
result. But instead  is returned.
When I execute doc("test.xml") manually some moments later, the expected empty 
result is returned.

As a workaround I could use xdmp:document-delete(cts:uris()) but my assumption 
is that xdmp:forest-clear is much faster. Is that true?

Is xdmp:forest-clear somehow asynchronous?
Or is it maybe a visibility problem with deleted data? I run the code as admin 
user (just for testing).

Regards,
Andreas

--
Andreas Hubmer
IT Consultant

EBCONT enterprise technologies GmbH
Millennium Tower
Handelskai 94-96
A-1200 Vienna

Web: http://www.ebcont.com

OUR TEAM IS YOUR SUCCESS

UID-Nr. ATU68135644
HG St.Pölten - FN 399978 d
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Facet count mismatch with search result

2015-09-21 Thread David Ennis
Your search is 'filtered' While the counts for search are generated with
xdmp:estimate - which is essentially against the unfiltered fragments.

As odd as the results seem, I think it is the expected result in this case.





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  <http://www.hinttech.com/>
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] <http://www.hinttech.com>
<https://twitter.com/HintTech>  <http://www.facebook.com/HintTech>
<http://www.linkedin.com/company/HintTech>

On 21 September 2015 at 17:26, Roy Chowdhury, Soumadri <
srroychowdh...@innodata.com> wrote:

> Hi,
>
>
> I am using marklogic faceting for search using search:search function. I
> am having issues with facet count mismatch with the search result where the
> search query is wildcarded. Following is the search options and constraint
> configuration sample I am using in my code,
>
>
> *Search options:*
>
> http://marklogic.com/appservices/search;>
> true
> filtered
> 
> "
> 
> http://marklogic.com/cts; strength="20"/>
> 
> (
> -
>  tokenize="word">OR
>  tokenize="word">or
>  tokenize="word">AND
>  tokenize="word">and
> =
>  tokenize="word">
>  tokenize="word">=
>  tokenize="word">
>  tokenize="word">=
>  tokenize="word">!=
> 
>
> 
>  
>  
>  case-insensitive
>  diacritic-sensitive
>  punctuation-sensitive
>  whitespace-sensitive
>  unstemmed
>  wildcarded
>  
> 
>
> 
>  
>  
>  frequency-order
>  descending
>  
> 
>
> 
>
> When the search query includes a wildcarded query (e.g. Name=in*), the sum of 
> the facets count is turning out to be more than the number of results 
> returned. The facet element (i.e. Category) and searched element (i.e. Name) 
> are present in the same document.
>
> Regards,
>
> Soumadri Roy
>
> "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."
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Avoiding HTML tags in searches

2015-09-21 Thread David Ennis
​Your likely looking for the feature "Phrase Around"

https://docs.marklogic.com/admin-help/phrase-around


In a nutshell, content inside of these elements(and and containing content
- including more elements and their children, etc)  are simply not
indexed​. So, having the actual structure embedded in the document would
give you more granular control

The challenge you will have is that the HTML in the CDATA is likely indexed
as text, so the feature listed needs to be on the element containing the
CDATA..





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  <http://www.hinttech.com/>
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] <http://www.hinttech.com>
<https://twitter.com/HintTech>  <http://www.facebook.com/HintTech>
<http://www.linkedin.com/company/HintTech>

On 21 September 2015 at 21:32, Travis Raybold <trayb...@rubicon.com> wrote:

> Howdy,
>
>
>
> We have a content base full of documents that contain some HTML fields in
> them. This content is all escaped in CDATA tags because it is generally not
> valid XML. When we search, though, we really don't want to find text inside
> of the HTML tags - "class", "id" or "name", for example.
>
>
>
> Is there a way to tell the indexer to avoid content inside of HTML tags?
>
>
>
> Thanks,
>
>
>
> --Travis
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] .sjs vs .js

2015-09-17 Thread David Ennis
Dear friends,

We are getting heavily into using Javscript in our projects in all tiers.

For practical purposes(sharing existing libraries), We would like to be
able to import/require javascript ending in .js and not only .sjs

In our build processes, we could refactor the libraries to use sjs, but
that is not ideal.

One of our developers found that my adding the mime-type to ML, he could
successfully use .js files in ML.

The Question:
Does anyone know of any negative effect this  might have - or possibly an
opinion of how this would go against any best-practices for the JS part of
ML?

I see some concerns about (maybe ) a security issue (other JS files would
then by default be accessible) - but that is all I can come up with



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  <http://www.hinttech.com/>
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] <http://www.hinttech.com>
<https://twitter.com/HintTech>  <http://www.facebook.com/HintTech>
<http://www.linkedin.com/company/HintTech>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Query on Fragmentation

2015-09-16 Thread David Ennis
HI.

You can always test the items in question in a small controlled experiment:

- new database, document without fragmenting
- look at the document count vs the fragment count in admin interface for
that document
- then do the collection step
- then look again. If the add collection step does what you expect, the
number of fragments would have increased.





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  <http://www.hinttech.com/>
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] <http://www.hinttech.com>
<https://twitter.com/HintTech>  <http://www.facebook.com/HintTech>
<http://www.linkedin.com/company/HintTech>

On 16 September 2015 at 13:51, Pavadaidurai A <pavadaidura...@infosys.com>
wrote:

> Hi Geert,
>
>
>
> Thanks for responding! For the questions No.2 , yes the re-indexer is
> disabled. We do fire xdmp:document-set-collection on these documents on a
> regular basis. So, I am just curious if this API will take care of
> fragmentation for existing documents, since it internally rewrites the
> whole document.
>
>
>
> Thanks,
>
> Durai.
>
>
>
> *From:* general-boun...@developer.marklogic.com [mailto:
> general-boun...@developer.marklogic.com] *On Behalf Of *Geert Josten
> *Sent:* Wednesday, September 16, 2015 4:19 PM
> *To:* MarkLogic Developer Discussion
> *Subject:* Re: [MarkLogic Dev General] Query on Fragmentation
>
>
>
> Hi Durai,
>
>
>
> Ad 1. There will always be a top-level fragment. Fragment root elements
> and their contents will be recorded as separate fragments. This works
> recursively, so a Citation in a Citation would get its own fragment, and
> the contents of the inner Citation would not be considered part of the same
> fragment.
>
> Ad 2. To my knowledge fragmentation changes are normally applied
> automatically by triggering a reindexation. Unless you have disabled that
> of course.
>
> Ad 3. There is a cts query that allows crossing fragment boundaries, but I
> don’t think you’d normally need that.
>
>
>
> Kind regards,
>
> Geert
>
>
>
> *From: *<general-boun...@developer.marklogic.com> on behalf of
> Pavadaidurai A <pavadaidura...@infosys.com>
> *Reply-To: *MarkLogic Developer Discussion <
> general@developer.marklogic.com>
> *Date: *Wednesday, September 16, 2015 at 12:30 PM
> *To: *MarkLogic Developer Discussion <general@developer.marklogic.com>
> *Subject: *[MarkLogic Dev General] Query on Fragmentation
>
>
>
> Dear All,
>
>
>
> I have taken the below example from Marklogic documentation. I have couple
> of questions reg Fragmentation. I understand from below example that
> “Citation”, will need to defined as the fragement root
>
>
>
> 1)  Assuming that we few other elements under CitationSet besides
> Citation element, what happens to the Misc elemens? In other words, if I am
> using Fragment root, what happens to the left over elements in the document?
>
> 2)  I understand that after setting Fragmentation rule, existing
> documents will remain unfragmented unless re-indexed (or re-loaded). Does
> xdmp:document-set-collection API, takes care of fragmenting the document. I
> am asking this question because xdmp:document-set-collection API internally
> rewrites the document into the database.
>
> 3)  Is there anyway to find out if a given document is fragmented or
> not?
>
>
>
> 
>
> citation1
>
> citation2
>
> citation3
>
> citation4
>
> citation5
>
> misc1
>
> misc2
>
> misc3
>
> 
>
>
>
>
> Fragment Roots <https://docs.marklogic.com/guide/admin/fragments#id_34807>
>
> If a document contains many instances of an XML structure that share a
> common element name, then these structures make sensible fragments. With
> MarkLogic Server, you can use this common element name as a fragment root.
>
> The following diagram shows an XML document rooted at  that
> contains many instances of a  node. Each  node
> contains further XML and averages between 15K and 20K in size. Based on
> this information,  is a sensible element to use as a fragment
> root:
>
> [image:
> https://docs.marklogic.com/media/apidoc/8.0/guide/admin/fragments/fragments-1.gif]
>
>
>
>
>
> Thanks,
>
> Durai.
>
>
>
>  CAUTION - Disclaimer *
>
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
>
> for the use of the addressee(s). If you are not the intended recipient, please
>
> notify the sender 

Re: [MarkLogic Dev General] Best way to detect mutating operations?

2015-09-15 Thread David Ennis
HI.

As far as tracking code, you could use the profiling - wrapping your code
itself and then looking for some suspect functions.  Take this example:

xquery version "1.0-ml";
declare namespace prof="http://marklogic.com/xdmp/profile;;

let $req := xdmp:request()
let $_ := prof:enable($req)
let $insert := if (fn:true())
  then xdmp:document-insert("/test/foo.xml", )
  else ()
let $not-insert := if(fn:false())
  then  xdmp:document-insert("/test/foo2.xml", )
  else ()

return
prof:report($req)/prof:histogram/prof:expression/prof:expr-source[fn:starts-with(.,
"xdmp:document-insert")]

In this case, it returns only xdmp:document-insert("/test/foo.xml", )
and not the second insert because the code logic never gets into the second
update.

Other thoughts:
- debugger may help
- if you just want to know if a document was updated or inserted, then you
could add a trigger to log this for you.


Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  <http://www.hinttech.com/>
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] <http://www.hinttech.com>
<https://twitter.com/HintTech>  <http://www.facebook.com/HintTech>
<http://www.linkedin.com/company/HintTech>

On 15 September 2015 at 21:42, Ignacio Tripodi <itrip...@catalystsecure.com>
wrote:

> Thanks, Christopher, that's a good idea. The only problem with that
> approach is that I would have to track that at a specific code location
> (and I'm assuming it would be relative to the specific thread, not an
> process spawned by the given xqy script, right?).
>
> Is there a general way to detect if "a document update just happened"? I
> could test this in a very controlled local environment to guarantee nothing
> else besides my request is going on.
> Thanks,
>
> -i
>
>
> On Tue, Sep 15, 2015 at 1:35 PM, Christopher Hamlin <cbham...@gmail.com>
> wrote:
>
>>
>> In situations such as these, I find it useful to log what is happening
>> with an expression like
>>
>> xdmp:log(fn:concat ("position #1: xact (", xdmp:transaction(), "), mode
>> (", xdmp:get-transaction-mode(), "), ts (",xdmp:request-timestamp(),")")),
>>
>> This will log the current transaction number, the transaction mode, and
>> the request timestamp (or empty for query statements).
>>
>>
>> /ch
>>
>> On Tue, Sep 15, 2015 at 3:31 PM, Ignacio Tripodi <
>> itrip...@catalystsecure.com> wrote:
>>
>>> Besides the obvious code analysis by simple inspection (which can prove
>>> less than simple on large, complex systems), is there a reliable way to
>>> tell if a request to MarkLogic produced an XQuery mutating operation
>>> anywhere during the lifetime of that request? I'm interested to analyze if
>>> a particular request would be causing a document update somewhere or not.
>>> I'm looking at lock rates in the monitoring charts, for example, but
>>> they're just rates and not linked to a particular request.
>>> Thanks for any insight you could provide,
>>>
>>> -i
>>>
>>>
>>> ___
>>> General mailing list
>>> General@developer.marklogic.com
>>> Manage your subscription at:
>>> http://developer.marklogic.com/mailman/listinfo/general
>>>
>>>
>>
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] M-to-M replication

2015-09-14 Thread David Ennis
Are the servers in the same datacenter?

What about a cluster with local disk failover?



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  <http://www.hinttech.com/>
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] <http://www.hinttech.com>
<https://twitter.com/HintTech>  <http://www.facebook.com/HintTech>
<http://www.linkedin.com/company/HintTech>

On 14 September 2015 at 08:36, <rajamani.marimu...@cognizant.com> wrote:

> Hi Team,
>
>
>
> We are using ML4.2 and now started the migration to ML-8 , part of this
> migration we finding possible solutions about master to master replication
> which is currently not supported by ML. My questions is there any
> workaround  to implement this M-to- M replication or is there any roadmap
> planned for the same in fourth coming versions . Pls suggest the possible
> ways  to achieve this replication .
>
>
>
> Thanks and regards
>
> Raja >>>
> 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.
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Running executable from XQuery

2015-09-03 Thread David Ennis
Well, that seems like a filter written by someone with a sense of humour.

OK. Lets get back to your use-case:
- Data extracted from DLL files need to be stored in ML.

We have already explored the extract-metadata silliness.
We have described options for initiating from MarkLogic (using your own
external service).

The next question is: **  Does this have to be initiated by MarkLogic? **If
not:
External to ML in the language of your choice, extract the data and use
some http connector to load the data into ML via the built-in REST
endpoints.
This is back to the ETL approach:
- Extract Metadata from DLL with VB
- Translate it into XML or JSON
- Load it into MarkLogic via REST endpoints



Kind Regards,
David Ennis



On 2 September 2015 at 23:34, Danny Sinang <d.sin...@gmail.com> wrote:

> Unfortunately, the only output I get from xdmp:document-filter() when I
> pass in my DLL is this :
>
> 
> http://www.w3.org/1999/xhtml;>
>   
> 
> 
> 
>   
> 
>
> No version information, unlike the one returned by my VBScript.
>
>
>
> On Wed, Sep 2, 2015 at 4:46 PM, Danny Sinang <d.sin...@gmail.com> wrote:
>
>> Ah, document-get() ... perfect ... thanks !
>>
>> - Danny
>>
>> On Wed, Sep 2, 2015 at 4:44 PM, Joe Bryan <joe.br...@marklogic.com>
>> wrote:
>>
>>> Hi Danny,
>>>
>>> You don't need to have the DLL stored in the database in order to use
>>> xdmp:document-filter(). You merely need to have it's contents as a node()
>>> (specifically, a document-node() or binary() node). That node could come in
>>> as the response to a network request (to another system), it could be
>>> received as parameter in a network request, it could be read from the
>>> filesystem, etc.
>>>
>>> Here's an example reading from the filesystem:
>>>
>>> let $doc := xdmp:document-get("/Users/jbryan/Downloads/sample.pdf")
>>> return xdmp:document-filter($doc)
>>>
>>> Thanks.
>>>
>>> -jb
>>>
>>> From: <general-boun...@developer.marklogic.com> on behalf of Danny
>>> Sinang <d.sin...@gmail.com>
>>> Reply-To: MarkLogic Developer Discussion <
>>> general@developer.marklogic.com>
>>> Date: Wednesday, September 2, 2015 at 4:37 PM
>>> To: MarkLogic Developer Discussion <general@developer.marklogic.com>
>>> Subject: Re: [MarkLogic Dev General] Running executable from XQuery
>>>
>>> Hi David,
>>>
>>> Thank you very much for pointing out that article.
>>>
>>> xdmp:document-filter() accepts a node parameter. Since the DLL is on the
>>> filesystem, does this mean I need to ingest the DLL into ML first before I
>>> can pass it to xdmp:document-filter() ?
>>>
>>> Regards,
>>> Danny
>>>
>>> On Wed, Sep 2, 2015 at 3:29 PM, David Ennis <david.en...@hinttech.com>
>>> wrote:
>>>
>>>> HI.
>>>>
>>>> [other than some hooks for custom search extensions], MarkLogic does
>>>> not have a way to directly run code external to itself. You always need to
>>>> bridge to this other code as you have seen in the MLJAM example.
>>>>
>>>> However.. Looking at your use case, consider the fact that MarkLogic
>>>> can extract interesting metadata from over 100 different file formats.. DLL
>>>> (Windoes Executable) is one of them (lister under 'other'
>>>>
>>>> https://docs.marklogic.com/guide/search-dev/binary-document-metadata
>>>>
>>>> So, maybe your goal is reachable by using ML to do the extraction for
>>>> you...
>>>>
>>>>
>>>>
>>>> Kind Regards,
>>>> David Ennis
>>>>
>>>>
>>>> David Ennis
>>>> *Content Engineer*
>>>>
>>>> [image: HintTech]  <http://www.hinttech.com/>
>>>> Mastering the value of content
>>>> creative | technology | content
>>>>
>>>> Delftechpark 37i
>>>> 2628 XJ Delft
>>>> The Netherlands
>>>> T: +31 88 268 25 00
>>>> M: +31 63 091 72 80
>>>>
>>>> [image: http://www.hinttech.com] <http://www.hinttech.com>
>>>> <https://twitter.com/HintTech>  <http://www.facebook.com/HintTech>
>>>> <http://www.linkedin.com/company/HintTech>
>>>>
>>>> On 2 September 2015 at 21:17, Danny Sinang <d.sin...@gmail.com> wrote:
>>>>
>>

Re: [MarkLogic Dev General] Running executable from XQuery

2015-09-02 Thread David Ennis
HI.

[other than some hooks for custom search extensions], MarkLogic does not
have a way to directly run code external to itself. You always need to
bridge to this other code as you have seen in the MLJAM example.

However.. Looking at your use case, consider the fact that MarkLogic can
extract interesting metadata from over 100 different file formats.. DLL
(Windoes Executable) is one of them (lister under 'other'

https://docs.marklogic.com/guide/search-dev/binary-document-metadata

So, maybe your goal is reachable by using ML to do the extraction for you...



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  <http://www.hinttech.com/>
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] <http://www.hinttech.com>
<https://twitter.com/HintTech>  <http://www.facebook.com/HintTech>
<http://www.linkedin.com/company/HintTech>

On 2 September 2015 at 21:17, Danny Sinang <d.sin...@gmail.com> wrote:

> Has anyone here tried running Windows executable files from within XQuery
> scripts ?
>
> I've got a VBScript that can read the version info of any given DLL, and
> I'd like to invoke it from an ML scheduled task and store the version info
> inside MarkLogic.
>
> The list of DLLs to read is stored in an XML file inside MarkLogic.
>
> I think I can probably use MLJAM to make the OS run the VBScript, but I'm
> wondering if there's a solution out there that involves less components /
> moving parts.
>
> Regards,
> Danny
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Generate PDF from Marklogic

2015-09-01 Thread David Ennis
I've done something similar to what Florent suggests in the past with the
Java flying saucer Library (XML or XHTML + CSS2 = PDF).

I think no matter how you wrap it up and what the details are, its the same
pattern used over and over with MarkLogic for external functionality -
create an HTTP service in the language of your choice to do the thing you
want done and post to that service.


Kind Regards,
David Ennis

On 1 September 2015 at 16:43, Florent Georges <li...@fgeorges.org> wrote:

>   Hi,
>
>   As far as I know, there is no built-in way.  I think the usual way is to
> use XSLT on MarkLogic to generate XSL-FO, and use xdmp:http-post() to send
> it to an endpoint an XSL-FO processor listens to (typically Apache FOP,
> wrapped in Cocoon or in an in-house Java HTTP endpoint).
>
>   This setup is reasonably easy.  I guess searching for "fop marklogic"
> should give a few links about that technique.
>
>   Regards,
>
> --
> Florent Georges
> http://fgeorges.org/
> http://h2oconsulting.be/
>
>
> On 1 September 2015 at 16:00, vimal c wrote:
>
>> Hi All,
>>
>> Is it possible to generate .pdf file from marklogic?
>>
>> I see that we can convert a pdf document to xhtml files and parts by
>> using xdmp:pdf-convert.
>>
>> But Do we have any way in marklogic to create a .pdf file out of the xml
>> content saved in marklogic?
>>
>>
>> Any idea would be really helpful.
>> Thanks in advance.
>>
>> Regards,
>> Vimal C
>>
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>> --
>> <http://developer.marklogic.com/mailman/listinfo/general>
>> Florent Georges
>> <http://developer.marklogic.com/mailman/listinfo/general>
>> http://fgeorges.org/
>> http://h2oconsulting.be/
>>
>>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How to trobleshoot Linux Installation

2015-08-27 Thread David Ennis
Ah,,,

When you stated 'local browser' I assumed that you meant the browser on the
machine running MarLogic..

If not, Peter is probably right..

Start on the server, do regular sysadmin type tests and get some more
information to put things in the entire context. If you're testing
remotely, then there is no reason to assume it is MarkLogic at all as there
can be lots of things between you and the ML Instance..

The most standard way to test is to be on the box housing MarkLogic and use
the 7-Layer-Super-Network-Test-Tool (also known as telnet..)

telnet localhost 8001
 GET foobar (type this in - you are asking for a page that does not exist)
[return]
[return] (yes, twice)


A vanilla ML install will return a useful response in the header section
including:
Server: MarkLogic

IF you get the results as above, then your issue is external to ML and
related to the setup on your box..
IF you don't get the results above, then still report back about tests done
on the same box as the ML Instance..



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 27 August 2015 at 10:15, Peter Kester peter.kes...@marklogic.com wrote:

 My guess is a local firewall.
 Switch that off for test.

 # service iptables save
 # service iptables stop
 # chkconfig iptables off

 HTH

 Peter
 From: Joshi, Vipan vjo...@optum.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Wednesday 26 August 2015 16:27
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: Re: [MarkLogic Dev General] How to trobleshoot Linux Installation

 I am getting “Page not found” from my local browser when hit linuxserver
 port 8001. I can ping that server from my local desktop.



 I have installed Marklogic and it’s dependent rpm(s).

 I started the marklogic and sent the  ErrorLog.txt in first email.

 Please guide me how to troubleshoot this.



 *From:* general-boun...@developer.marklogic.com [
 mailto:general-boun...@developer.marklogic.com
 general-boun...@developer.marklogic.com] *On Behalf Of *
 rajamani.marimu...@cognizant.com
 *Sent:* Tuesday, August 25, 2015 8:57 AM
 *To:* general@developer.marklogic.com
 *Subject:* Re: [MarkLogic Dev General] How to trobleshoot Linux
 Installation



 Hi Vipan,



 What you are getting in the admin interface while accessing by browser
 .Pls send us clear info to solve your problem .



 Thanks and regards

 Raja 



 *From:*general-boun...@developer.marklogic.com [
 mailto:general-boun...@developer.marklogic.com
 general-boun...@developer.marklogic.com] *On Behalf Of *Joshi, Vipan
 *Sent:* Tuesday, August 25, 2015 6:01 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* [MarkLogic Dev General] How to trobleshoot Linux Installation



 Hi All,

 I installed MarkLogic on linux RHEL 6.x and I am not able to connect to
 admin console using browser from desktop.

 Wanted to know how can I troubleshoot to resolve this problem – there is
 not much in ErrorLog.txt

 Below are some of the lines from error log file.



 2015-08-25 07:16:32.904 Notice: Stopping by SIGTERM from pid 17796

 2015-08-25 07:16:59.124 Notice: Starting MarkLogic Server 8.0-3 x86_64 in
 /opt/MarkLogic with data in /var/opt/MarkLogic

 2015-08-25 07:16:59.133 Info: Host apsrd5148.uhc.com running Linux
 2.6.32-504.8.1.el6.x86_64 (Red Hat Enterprise Linux Server release 6.6
 (Santiago))

 2015-08-25 07:16:59.152 Info: SSL FIPS mode has been enabled

 2015-08-25 07:16:59.923 Info: Native plugin cache manifest initialized

 2015-08-25 07:16:59.926 Info: Forest Last-Login state changed from
 unmounted to mounted

 2015-08-25 07:16:59.927 Info: Linux file system mount option 'barrier' is
 default; recommend faster 'nobarrier' if storage has non-volatile write
 cache

 2015-08-25 07:16:59.927 Info: Mounted forest Last-Login locally on
 /var/opt/MarkLogic/Forests/Last-Login read write (dm-4 ext4 rw)

 2015-08-25 07:16:59.929 Info: Forest Last-Login state changed from mounted
 to recovering

 2015-08-25 07:16:59.932 Info: Forest Schemas state changed from unmounted
 to mounted

 2015-08-25 07:16:59.932 Info: Forest Last-Login state changed from
 recovering to open

 2015-08-25 07:16:59.932 Info: Mounted forest Schemas locally on
 /var/opt/MarkLogic/Forests/Schemas read write (dm-4 ext4 rw)

 2015-08-25 07:16:59.934 Info: Forest Schemas state changed from mounted to
 recovering

 2015-08-25 07:16:59.937 Info: Forest Extensions state changed from
 unmounted to mounted

 2015-08-25 07:16:59.938 Info: Mounted forest Extensions locally on
 /var/opt/MarkLogic/Forests/Extensions read write (dm-4 ext4 rw)

 2015-08-25 07:16:59.939 Info: Forest

Re: [MarkLogic Dev General] Word Query - Excluded element Question

2015-08-26 Thread David Ennis
I was hoping someone would have a better answer before I replied, but here
is my response.  Hopefully others will clarify  / build on it.


I do not think this will make a difference.  The reason being that I
understand that the way excluded and included elements actually works is
related to traversing the tree while creating the word indexes and
including or excluding parts of the tree in the indexing step.  Or even if
this statement inaccurate in some way, it is still related to the analysis
of the trees (even the tree structure in ML is a type of internal index
like a term list, but element A pointing to parent B rather than a term to
a fragment.

So, with the includes and excludes all related to the word queries and the
way the tree was indexed, I don't see how any range indexes will help this.

Perhaps someone will debunk this understanding and/or suggest some magic
combination of other approaches. Perhaps there is another way of creating a
field with an xpath expression of the ones to include and using a tuned
field-word-query on that or similiar.







Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 26 August 2015 at 04:45, Yang, Yun yun.y...@wolterskluwer.com wrote:

 Any advise? Appreciate the help.

 Sent from my iPhone

 On Aug 25, 2015, at 3:23 PM, Yang, Yun yun.y...@wolterskluwer.com wrote:

 All,



 We use Word Query in our application. For the word query setting, in the
 excluded elements section, we have excluded one attribute based on the
 value. For example, in element *Content, *if attribute* Indexing = false,
 *we excluded from the word search. There are only two values in the
 attribute, true and false.



 *Question:*

 Does it worth to create an attribute range index for two distinct values
 to speed up the search? We have millions of the docs meet the condition for
 exclusion.



 *XML Sample:*

 Content Indexing = “false”/





 Thanks,



 Yun Yang




 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] element-value-query Vs where condition

2015-08-17 Thread David Ennis
And to extend this train of thought:

In many cases, *-range-queries may offer much more performance increase
over anything from the universal index (the *-value-queries) - even if your
value is not a range.

This goes in-depth:
https://docs.marklogic.com/guide/performance.pdf



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
On 17 August 2015 at 15:16, rajamani.marimu...@cognizant.com wrote:

 Hi Anoop,



 Marklogic specific Xquery functions mainly introduced for faster
 performance and get fast results . Even in some constraint plain Xquery
 FlOWR conditions also useful.. All are depends on the requirements but, I
 can suggest wherever possible use marklogic specific functions get better
 results .



 Thanks and regards

 Raja 



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Anoop Khetan
 *Sent:* Monday, August 17, 2015 5:38 PM
 *To:* general@developer.marklogic.com
 *Subject:* [MarkLogic Dev General] cts:element-value-query Vs where
 condition



 Hi,



 In my system few Xqueries are using cts:element-value-query and few
 Xquries are using where condition to get particular document.



 Can someone tell me which will give me faster results.



 Regards,

 Anoop



  CAUTION - Disclaimer *

 This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely

 for the use of the addressee(s). If you are not the intended recipient, please

 notify the sender by e-mail and delete the original message. Further, you are 
 not

 to copy, disclose, or distribute this e-mail or its contents to any other 
 person and

 any such actions are unlawful. This e-mail may contain viruses. Infosys has 
 taken

 every reasonable precaution to minimize this risk, but is not liable for any 
 damage

 you may sustain as a result of any virus in this e-mail. You should carry out 
 your

 own virus checks before opening the e-mail or attachment. Infosys reserves the

 right to monitor and review the content of all messages sent to or from this 
 e-mail

 address. Messages sent to or from this e-mail address may be stored on the

 Infosys e-mail system.

 ***INFOSYS End of Disclaimer INFOSYS***


 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.

 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Query Result Downloading (QConsole)

2015-07-24 Thread David Ennis
This is a bit cumbersome and digs into the internals of queryConsole a bit,
but it is once workable solution (even if its a bit of a **sharp tool**).
***Not any production ready solution***, but I sometimes use it to view
documents in the database in my browser when troubleshooting.

*Query Console:*
Every request includes a request parameter sid
- this relates to the current tab in your query browser (and in that case,
the database selected as well).
Query console also has en endpoint: /qconsole/endpoints/view.xqy (used
mostly for viewing binary content when you click on the URI)

*Process:*
So, if you were to:
1) save the results into an XML node in the same database via xquery
example: xdmp:document-insert(/temp/results.xml, cts:search('foo'))

​2) Understand what your sid is for the current query console (​it is
passed with the requests)
Lets pretend mine is 12345

Then(based on sample parameters above) you could hit the endpoint:
/qconsole/endpoints/view.xqy?sid=12345uri=/tmp/results.xml


Kind Regards,
David Ennis


David Ennis
*Content Engineer*
*​HintTech*

*​*
On 24 July 2015 at 10:08, Andreas Hubmer andreas.hub...@ebcont.com wrote:

 Thanks for the suggestion. As far as I know I would need an HTTP app
 server to perform the download.

 What I am looking for is an ad-hoc method to download the results of a
 query in the query console.

 Cheers,
 Andreas

 2015-07-23 15:50 GMT+02:00 rajamani.marimu...@cognizant.com:

  Hi Andreas,



 You can also use the Zip option , this will download your xml  into your
 local file system in zip file.



 let $zip := xdmp:zip-create(

parts xmlns=xdmp:zip

  partmimetype/part

 partresult.xml/part

   /parts,

 (document { application/epub+zip },

  result{$resultData}

 /result ))

 return

 ( xdmp:set-response-content-type(application/zip),



 $zip)





 Thanks and regards

 Raja 



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Dave Cassel
 *Sent:* Thursday, July 23, 2015 6:29 PM
 *To:* MarkLogic Developer Discussion

 *Subject:* Re: [MarkLogic Dev General] Query Result Downloading
 (QConsole)



 To be precise, xdmp:save() will write to the file system of the server
 where it's running; that might or might not be your local, depending on
 where MarkLogic is running. If it's remote, it will write to that server,
 and you can download the files from there (assuming you have access).



 --

 Dave Cassel http://davidcassel.net, @dmcassel
 https://twitter.com/dmcassel
 Technical Community Manager

 MarkLogic Corporation http://www.marklogic.com/

 http://developer.marklogic.com/





 *From: *general-boun...@developer.marklogic.com on behalf of Andreas
 Hubmer andreas.hub...@ebcont.com
 *Reply-To: *MarkLogic Developer Discussion 
 general@developer.marklogic.com
 *Date: *Thursday, July 23, 2015 at 8:48 AM
 *To: *MarkLogic Developer Discussion general@developer.marklogic.com
 *Subject: *Re: [MarkLogic Dev General] Query Result Downloading
 (QConsole)



   True, that is an option. Thanks!



 2015-07-23 14:43 GMT+02:00 DK Singh dharam.m...@gmail.com:

 You can save the result in your local system using xdmp:save function

 On Jul 23, 2015 6:02 PM, Andreas Hubmer andreas.hub...@ebcont.com
 wrote:

Hello,

 Is there a possibility to download the result of a query instead of
 displaying it in the Query Console? Sometimes the result is just too big.

 Best regards,

 Andreas


 --

 Andreas Hubmer

 IT Consultant



 Web: http://www.ebcont.com



 OUR TEAM IS YOUR SUCCESS





 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general




 --

 Andreas Hubmer

 IT Consultant



 EBCONT enterprise technologies GmbH

 Millennium Tower

 Handelskai 94-96

 A-1200 Vienna



 Mobile: +43 664 60651861

 Fax: +43 2772 512 69-9

 Email: andreas.hub...@ebcont.com

 Web: http://www.ebcont.com



 OUR TEAM IS YOUR SUCCESS



 UID-Nr. ATU68135644

 HG St.Pölten - FN 399978 d

  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

Re: [MarkLogic Dev General] Regarding Excluding a node from search

2015-07-23 Thread David Ennis
HI.

It looks like you want to investigate the feature phrase-around

https://docs.marklogic.com/admin-help/phrase-around


In other words: search around certain elements.


Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 23 July 2015 at 15:57, Indrajeet Verma indrajeet.ve...@gmail.com wrote:

 Hi All,

 I am doing free text search by using search libraries. I am using
 search:search/search:resolve etc.. We have elements footnote inside
 documents and I don't want to include these nodes in my search.

 e.g.

 If I search Effective , this should not return result.

 If I search confidential , this should return result however match count
 should be only 2 NOT 3. Also confidential  that is under footnote should
 not be highlighted.

 doc
 meta
 /meta
 footnote id=R09-IDANDNQ-R09-IDAE00T-FN7 content-type=secondary
 para
 textEffective February 3, 2015, confidential  /text
/para
 /footnote
 num(a)/num
 para
 textAn SCI entity (as defined in
 of this chapter) shall not omit the confidential portion from
 the material filed in electronic format on Form SCI pursuant to Regulation
 SCI,
 italicet seq/italic., and, in lieu of the procedures
 described in
  of this section, may request confidential treatment of all
 information provided on Form SCI by completing Section IV of Form SCI.
 /text
 /para
 /doc


 Is there any way to exclude elements from the search?

 Regards,
 Indy

 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] ML Content Pump command for Windows

2015-07-02 Thread David Ennis
Further to what Jakob said:

Just for completeness:
If, in fact, you really wanted the copy or export commands for *other*
use-cases in the future, some of the parameters are different (input_host
and output_host for copy as example).

The different parameters depending on which MLCP command you run can be
found here:
https://docs.marklogic.com/guide/ingestion/content-pump#id_55140



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 2 July 2015 at 12:37, Jakob Fix jakob@gmail.com wrote:

 Hi Sachin,

 I think you should use the import command (rather than copy, which is
 intended for copying between ML databases).

 So, your command should read:

 mlcp.bat import -host localhost -port 4373 -username sachin -password
 sachin -input_file_path C:\Users\SHARMAS7\Desktop\documents\xquery
 -transform_module /example/mlcp-transform.xqy -transform_namespace 
 http://marklogic.com/example; -transform_param my-value

 (I removed the -mode local because I think that's the default when
 importing).



 cheers,
 Jakob.

 On Thu, Jul 2, 2015 at 12:33 PM, Sachin Sharma sachiins...@gmail.com
 wrote:

 Hello I am trying to apply ml content pump ingestion(using function to
 transform xml documents) on my local ml (windows) using mlcp
 tutorials.Following is linux command for ingestion (From mlcp tutorials)

 mlcp.sh copy -mode local -host localhost -port 4373 -username sachin
 -password sachin -input_file_path /users/sachin/ -transform_module
 /example/mlcp-transform.xqy -transform_namespace 
 http://marklogic.com/example; -transform_param my-value

 Following is equivalent for above linux commands on windows

 mlcp.bat copy -mode local -host localhost -port 4373 -username sachin
 -password sachin -input_file_path
 C:\Users\SHARMAS7\Desktop\documents\xquery -transform_module
 /example/mlcp-transform.xqy -transform_namespace 
 http://marklogic.com/example; -transform_param my-value

 When above windows commands is being executed it is giveing error Error
 Parsing  Option Invalid option -host

 So can someone into windows commands and correct  it.Any help is
 appreciated.

 Thanks
 Sachin Sharma

 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Install MarkLogik Server on Debian7

2015-06-29 Thread David Ennis
HI.

You can use alien to repackage.

A sample of the steps can be found at the start of this page:

http://blog.msbbc.co.uk/2010/04/marklogic-x64-install-on-ubuntu-104.html





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 29 June 2015 at 16:51, Loredana Versienti loredana.versie...@isti.cnr.it
 wrote:

 Hello,
 I have a virtual machine with SO Debian 7, 64 bit and 3.2 kernel.
 I wonder if it's possible to install MarkLogik Server.
 Thank you very much
 Best Loredana
 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Certification info

2015-06-14 Thread David Ennis
HI.

http://www.marklogic.com/training/

This landing page includes a link to the study guide you already have. But
more importantly, the upper section (clicking on the various links) shows
you the training tracks available. This includes the on-demand trainings
(videos).

*This is our internal approach:*
1) The study guide is detailed in telling you what topics you need.
2) https://docs.marklogic.com/ (especially the right-hand side -  docs) has
every detail about MarkLogic.

*What we do to prepare people for training:*
1) We have them go through the PDF and for every item in the tables, they
find the proper documentation and paste the link into the table
2) They then use this as their targeted study Guide
-- 1 they knoe where the materials are and study and 2, they are used to
the guides for future quick lookup.


*In addition, we:*
- Have them get very used to Query Console (improting and working through a
workspace with samples of xQuery which comes with every ML install)
- focus on MLCP (if you mess up on MLCP for docs and triples, then you
don't have the data you need for the rest of the exam)
- focus on cURL
- do this on windows (we often develop on linux, so tiny differences in
cURL commands on windoes vs LINUX can waste time)






Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 14 June 2015 at 04:30, Sarma, Sangeetha s.sa...@klopotek.com wrote:

  Hi friends,



 We would like to get some information on the MarkLogic Developer and
 Administrator professional certification program. Study guide
 ‘marklogic-certification-study-guide.pdf’ is very informative but wondering
 if there are any materials or resources available specific to
 Certification. Any general feedback on certification would be greatly
 appreciated too.



 Thank you

 Sangeetha

 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Field Search?

2015-06-08 Thread David Ennis
HI.

Fields in MarkLogic is a way to group values form multiple elements into a
single searchable unit. For instance, if I had 2 types of data in my system
and I wanted to search either type of document based on postal codes:
I could define a field called postal-code and map two(or more) xpath
expressions to it:
/some/path/to/pcode
/some/other/path/to/postal_code

In the end, it works very much like a word query (and even has the same
defaults, I believe)

Details: https://docs.marklogic.com/guide/admin/fields




Regarding quer builder:
I cannot find a full example, but there is a test in github showing the use
of a field.
https://github.com/marklogic/node-client-api/blob/1896935ca56c92d544d5a448b5ff39bc4f4c6af9/test-basic/query-builder.js

This would make me think that it is just qb.field('fieldname', 'value')
-rather than qb.word()



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 8 June 2015 at 17:34, Martin Vollmix voll...@hotmail.com wrote:

 Hi,



 can anybody explain, what a “field search“ is or a „search title for a
 keyword“

 and how this can be done using querybuilder in node.js



 Thanks in advance



 Martin



 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] external auth

2015-05-08 Thread David Ennis
Not knowing the details completely, one cannot say what the user meant by
session data, but in the situation described, a role could be analysed to
switch between content databases, for example. So in this case, the
information used to isolate the user would be the user's role -which would
have come from being logged in to this app server to begin with, for
example. So, a mix of changing content databases and perhaps module
roots(based on role) could move the person to a different 'service' with
different content on the same app server.

Yes, there is alot of reading/understanding/testing for someone to use the
Enhanced HTTP features.  But they were created and offered as a feature,
and if used properly, they can be beneficial.




Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 8 May 2015 at 02:46, David Lee david@marklogic.com wrote:

  I may be misunderstanding but I see session data and REST in the
 same paragraph.

 What exactly do you mean by session data.

 REST Services are not intended, nor directly manage server 'session state'
 of the sort that is associated with Browser/interactive 'session'

 ( e.g. if you use xdmp:set-session-field() that creates a 'Session' which
 is managed by browser cookies)



 You can have both browser based sessions and do rest from JS calls - but
 you should not depend on, or attempt to make use of 'session state' from
 REST calls - if it happens to work that is something that's not supported
 and may or may not work in the future or in a different configuration.



 That out of the way - assuming your talking about some other kind of
 'session state'  - maybe a database document which you pass the URL through
 on REST calls ... that is a perfect use for the Enhanced HTTP server.

 It can be configured to switch DB, Modules DB, add and remove query
 params, enforce additional security checks, switch between HTML,XML, JSON
 error formats, change error handlers ... and of course 'rewrite' the URL.
 REST, HTTP, XCC can all interop on the same port - in the same or different
 'applications'.   These choices can be based on any header or URI path
 component or query param, as well as many of the 'request state' values
 available (user id, name, database etc.).



 If your using a REST server which is created by the REST APIS' s then you
 will need to modify the generated rewriter - carefully - so as not to break
 the existing REST library infrastructure.








 -

 David Lee
 Lead Engineer
 *Mark**Logic* Corporation
 d...@marklogic.com
 Phone: +1 812-482-5224

 Cell:  +1 812-630-7622
 www.marklogic.com



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *David Ennis
 *Sent:* Thursday, May 07, 2015 1:40 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] external auth



 HI.



 This type of scenario seems very possible with the Enhanced HTTP erver
 configuration options available in Version 8. One of the most obvious
 out-of-the-box benefits of the new server rewrite engine is the fact that
 you need not have a separate port for your web app and REST API, for
 example. Consider also that you have control over quite a bit - including
 switching module databases and content databases as part of the rewrite
 rules - which may be of benefit to you for what you describe.



 http://developer.marklogic.com/features/enhanced-http














 Kind Regards,

 David Ennis





 *David Ennis*
 *Content Engineer*

 [image: HintTech]  http://www.hinttech.com/
 Mastering the value of content
 creative | technology | content

 Delftechpark 37i
 2628 XJ Delft
 The Netherlands
 T: +31 88 268 25 00
 M: +31 63 091 72 80

 [image: http://www.hinttech.com] http://www.hinttech.com/ [image:
 http://www.hinttech.com/signature/Twitter_HintTech.png]
 https://twitter.com/HintTech [image:
 http://www.hinttech.com/signature/Facebook_HintTech.png]
 http://www.facebook.com/HintTech [image:
 http://www.hinttech.com/signature/Linkedin_HintTech.png]
 http://www.linkedin.com/company/HintTech



 On 7 May 2015 at 17:28, cyanline llc i...@cyanline.com wrote:

 Hello,
Looking for a bit of philosophical help here. We're deploying
 rest-apps with Roxy to one site. We have built a second site where users
 register, login, and perform a number of actions. Then, when the user is
 ready to use the marklogic rest-app, we pass them from the second site
 to the marklogic site.
We would like that the user need not authenticate themselves again
 *and* that a user only

Re: [MarkLogic Dev General] external auth

2015-05-07 Thread David Ennis
HI.

This type of scenario seems very possible with the Enhanced HTTP erver
configuration options available in Version 8. One of the most obvious
out-of-the-box benefits of the new server rewrite engine is the fact that
you need not have a separate port for your web app and REST API, for
example. Consider also that you have control over quite a bit - including
switching module databases and content databases as part of the rewrite
rules - which may be of benefit to you for what you describe.

http://developer.marklogic.com/features/enhanced-http







Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 7 May 2015 at 17:28, cyanline llc i...@cyanline.com wrote:

 Hello,
Looking for a bit of philosophical help here. We're deploying
 rest-apps with Roxy to one site. We have built a second site where users
 register, login, and perform a number of actions. Then, when the user is
 ready to use the marklogic rest-app, we pass them from the second site
 to the marklogic site.
We would like that the user need not authenticate themselves again
 *and* that a user only has access to their rest-app, but not the others.
With this current setup, we can see that we either need to pass the
 session data from one server to another, or have a third-party server
 track and share session data with the other 2 servers (ie ldap).
Is ldap the way to go or are we way off with this current setup/there
 is a better way to do this?

 Thank you

 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Deploy a javascript application

2015-04-30 Thread David Ennis
HI.

No, node.js is not required for the middle tier.  We use java, .net.
node.js.



Maybe let others chime-in about the 'best option' - however, For your other
idea - It is my absolute favourite.  2-tier app with an angular-based web
application being served via MarkLogic's awesome HTTP server (we cut out
the middle man).  In ML7, we've always used a framework and created API
endpoints rather than the REST API so that the http server and REST API are
on the same port on the same server  (so that we get no cross-site
scripting issues in client JS).  However, in ML8, the HTTP rewriter
squashes that problem anyway.




Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 30 April 2015 at 08:51, Yinyan guy yinyan...@hotmail.com wrote:

 Hi All,
 I have  basic question on deployment of a simple application. I am
 planning to write the application using angularJS and wanted to know what
 is the best option for the deployment of this application. I have following
 questions

 1. is it mandatory to use node.js for the mid tier?
 2. Can I deploy the Angular.JS application which would use REST APIs using
 the Marklogic HTTP server?
 3. is a separate web/app server the best option?

 Thank You.
 regards,
 Puneet


 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Exporting Database Configs from MLCP

2015-04-29 Thread David Ennis
​The endpoint that matches the data you see when managing a database in the
admin interface is:
http://docs.marklogic.com/REST/GET/manage/v2/databases/[id-or-name]/properties

IN general, all of the endpoints in the management API have GET and POST
verbs defined, so you have about 100 getters and 100 setters for just about
everything you can imagine doing for administration of your ML server.
​



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 29 April 2015 at 20:25, Diedrick, Johann johann.diedr...@metmuseum.org
wrote:

  Hello-

  I was wondering if there was a way to export database config files found
 in the Configuration Manager from the command line. I think MLCP is the
 tool to do this, but as far as I know it is only used for exporting content
 from the database. I’m not sure if it can be used to export database config
 files in the Configuration Manager.  If there is a way to do this with or
 without MLCP, I would appreciate any suggestions!

  Thanks in advance,
 -Johann

 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] JSON sending in the request body is not being converted into map:map in ML8 using roxy however working fine with ML6

2015-04-28 Thread David Ennis
HI.

The issue here may be is that json is a first-class citizen in MarkLogic 8
and is happy staying as json.

If all of your code expects a map, then perhaps you can test the type of
the document and if its json, transform it to the map on the fly.

Kind Regards,
David Ennis



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 28 April 2015 at 16:14, Indrajeet Verma indrajeet.ve...@gmail.com
wrote:

 Hi,

 Please help us if you have encountered same kind of problem.

 We are upgrading ML6 to ML8 and using roxy as well. The roxy is customized
 based on the customer requirement.


 For one of the REST request /setcache, we are sending below data to
 cache and that is being converted into map (key value pair)

 ML6-

 Request in Body-
 ---

 {USERSESSION:a57e7e98cae8a7857285cd9a66de813f|4/28/2015 9:48:14
 PM:{user:user-profile
 wk-pid=\USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39\docTypeUsers/docTypeusername
 type=\string\USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/usernameuserId
 type=\string\lrunne...@wk.com/userIdemail type=\string\
 lrunne...@wk.com/emailuserStatus
 type=\string\Active/userStatusdefaultContentCollectionALL/defaultContentCollectionrole
 type=\string\user/roletrialEndDate type=\string\/activationDate
 type=\string\2013-12-25/activationDatephoneNumber
 type=\string\/sendWelcomeEmail type=\string\/additionalEmail
 type=\string\/filingContent
 type=\string\Allowed/filingContentfirstName
 type=\string\John/firstNamelastName
 type=\string\Doe/lastNameorgCode
 type=\string\WK001/orgCodeorgName
 type=\string\LoadRunner/orgNamesalesTerritory
 type=\string\/password5f4dcc3b5aa765d61d8327deb882cf99/passwordpwpassword/pwcountOfLoggedIn11/countOfLoggedIncreated2014-07-11T11:05:11.589-05:00/createdcreatedBy
 type=\string\System/createdBymodified2014-07-11T11:05:11.589-05:00/modifiedmodifiedBy
 yun.y...@wolterskluwer.com/modifiedBy/user-profile,
 session:session wk-pid=\a57e7e98cae8a7857285cd9a66de813f|4/28/2015
 9:48:14
 PM\usernameUSR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/usernamecreated2015-04-28T17:48:14.661+05:30/createdexpiration2015-04-28T21:48:14.661+05:30/expirationcurrenttime2015-04-28T17:48:14.661+05:30/currenttimevalidfalse/valid/session}}

 Converted into below map using ML6-
 --

 map:map(map:map xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance;
 xmlns:map=http://marklogic.com/xdmp/map;map:entry
 key=USERSESSION:97f7d8ec0b5bba928cb025bd1d4d28d4|4/28/2015 9:57:24
 PMmap:valuemap:mapmap:entry key=usermap:valueuser-profile
 wk-pid=USR-59fb4f7d-de03-1e37-a23c-5c3d71552eaausernameUSR-59fb4f7d-de03-1e37-a23c-5c3d71552eaa/usernamedocTypeUsers/docTypeuserId
 type=stringsjauh...@innodata.com/userIdfirstName
 type=stringshruti/firstNamelastName
 type=stringjauhari/lastNameorgCode
 type=stringFORD-101/orgCodeorgName type=stringFord Motor
 Company/orgNamefilingContent
 type=stringAllowed/filingContentuserStatus
 type=stringActive/userStatustrialEndDate
 type=string2018-12-31/trialEndDaterole
 type=stringuser/roletelephoneNumber 
 type=string212-555-1212/telephoneNumbersalesTerritory
 type=stringNortheast/salesTerritorysendWelcomeEmail
 type=stringFalse/sendWelcomeEmaildefaultContentCollection
 type=stringdefault/defaultContentCollectionadditionalEmail
 type=stringskh...@innodata.com/additionalEmailpassword5f4dcc3b5aa765d61d8327deb882cf99/passwordpwpassword/pwcountOfLoggedIn11/countOfLoggedIncreated2015-04-22T15:37:32.151+05:30/createdcreatedByUSR-2fe944cc-013e-5b5a-0dba-7e98c3ffab00/createdBymodified2015-04-22T15:37:32.151+05:30/modifiedmodifiedByUSR-2fe944cc-013e-5b5a-0dba-7e98c3ffab00/modifiedBy/user-profile/map:value/map:entrymap:entry
 key=sessionmap:valuesession
 wk-pid=97f7d8ec0b5bba928cb025bd1d4d28d4|4/28/2015 9:57:24
 PMusernameUSR-59fb4f7d-de03-1e37-a23c-5c3d71552eaa/usernamecreated2015-04-28T17:57:24.34+05:30/createdexpiration2015-04-28T21:57:24.34+05:30/expirationcurrenttime2015-04-28T17:57:24.34+05:30/currenttimevalidfalse/valid/session/map:value/map:entry/map:map/map:value/map:entry/map:map)

 ML8 -
 ---
 Input and converted output is same. i.e. without map:

 {USERSESSION:a57e7e98cae8a7857285cd9a66de813f|4/28/2015 9:48:14
 PM:{user:user-profile
 wk-pid=\USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39\docTypeUsers/docTypeusername
 type=\string\USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/usernameuserId
 type=\string\lrunne...@wk.com/userIdemail type=\string\
 lrunne...@wk.com/emailuserStatus
 type=\string\Active/userStatusdefaultContentCollectionALL/defaultContentCollectionrole
 type=\string\user/roletrialEndDate type

Re: [MarkLogic Dev General] mlcp copy database issue

2015-04-23 Thread David Ennis
HI.

From Query Console, I would look at a sample of the documents and check the
permissions:
https://docs.marklogic.com/xdmp:document-get-permissions

Then from there work backwards and make sure that your user's role has read
access to those documents.





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 23 April 2015 at 08:35, jaydip rananavare jaydiprananav...@gmail.com
wrote:

 Hello All,

 We are using mlcp copy command to copy content between two databases but
 we are facing an issue.

 *Problem:*
 When we run the command it is able to connect to source database but it
 does not read any content hence nothing gets copied.

 *What we are doing:*
 Here is our command:
 ./mlcp.sh copy \
   -input_host source-host \
   -input_port 8000 \
   -input_username read-only-user \
   -input_password  \
   -input_database source-db \
   -directory_filter /some-directory/ \
   -output_host target-host \
   -output_port 8000 \
   -output_username admin \
   -output_password  \
   -output_database target-db

 *What we think is causing problem:*
 We think that the user that we are using to connect to source machine does
 not have correct privileges. We followed this document [
 https://docs.marklogic.com/guide/ingestion/content-pump#id_47736] and
 granted [hadoop-user-read] role but still it did not work (mlcp can connect
 to source database but cannot read content). The same command works and
 copies content if we use admin user to connect to source database.

 It is not clear what minimal roles/privileges we need to setup so that
 given command will work. Could you please help us?

 -Regards,

 *Jaydip Rananavare*


 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] XDMP:SPAWN - Load Distribution Issue

2015-04-22 Thread David Ennis
We also write jobs to a physical queue (XML information with the required
information) and then have them picked up by processes running on each node.





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 22 April 2015 at 16:28, Indrajeet Verma indrajeet.ve...@gmail.com
wrote:

 If you are using Java to call XQuery modules via XDBC, you can use
 MarkLogic provided Java code with round robin approach to send requests to
 ML nodes.

 However corb/recordloader are nice to use for ingestion/bulk upload and
 easy to configure

 Regards,
 Indrajeet

 On Wed, Apr 22, 2015 at 5:20 PM, Dave Cassel dave.cas...@marklogic.com
 wrote:

   I believe you can use Taskbot https://github.com/mblakele/taskbot
 for this. If not that, then I'd go with Corb2
 https://github.com/marklogic/corb2.

  --
 Dave Cassel http://davidcassel.net, @dmcassel
 https://twitter.com/dmcassel
 Developer Community Manager
 MarkLogic Corporation http://www.marklogic.com/
  Data Innovation Summit
 http://fedscoop.com/events/datainnovationsummit/2015/ May 7th in DC


   From: abhishek.srivas...@cognizant.com 
 abhishek.srivas...@cognizant.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 
 Date: Wednesday, April 22, 2015 at 12:10 AM
 To: general@developer.marklogic.com general@developer.marklogic.com
 Subject: [MarkLogic Dev General] XDMP:SPAWN - Load Distribution Issue

  Hi All,


  We are using xdmp:spawn-function to bulk process content. Somehow the
 task is not getting distributed across each node of the cluster but stick
 to the machine it is initiated. Is there any way to spawn load across all
 nodes of the cluster?


  Thanks

 Abhishek
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.


 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] xdmp:user-last-login not returning anything while executing it after custom log in page

2015-04-22 Thread David Ennis
HI.

You've changed your auth type and I note that your xQuery sample mentions
ldap user.

I know you mention application'level and not external auth, but perhaps
this is related:

get-current-user, for instance does not return the same value depending on
the authentication method.

http://docs.marklogic.com/guide/security/external-auth (look to the bottom
of the page)





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 22 April 2015 at 22:10, Sudheer Yalaverthi sudheer.yalaver...@db.com
wrote:



 Hi,



 I am trying to develop a custom log in page and display the users last log
 in details but xdmp:user-last-login seems to not return anything.



 Initially I have a http server with last log in details enabled and
 authentication scheme to basic. While I accessed a sample.xqy over this
 server on IE, I logged in with user credentials and in the subsequent
 accesses, I was able to get the last log in details using the below line.




 xdmp:user-last-login(xdmp:get-request-user())//*:last-successful-login/text()



 This worked pretty well with basic authentication scheme.



 Now I developed a custom login page and set the application-level
 authentication scheme on the application server.

 After I log in, I am able to see the user name in the sample.xqy but not
 the last log in details. The same line is giving no response.



 When I executed the below query in qconsole, it is giving nothing though I
 have an xml related to this user in the last log in database.

 xdmp:user-last-login(xdmp:user(ldapuser1))





 Any thoughts?





 Regards,

 Sudheer




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

 Deutsche Bank does not render legal or tax advice, and the information
 contained in this communication should not be regarded as such.

 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] 401 Unauthorized

2015-04-16 Thread David Ennis
HI.  I would use curl in verbose mode (as suggested by Christopher) so that
you can see the details.

Furthermore, I would use --anyauth for the auth type.

If one auth type fails, it will re-post the request again.

This, combined with verbose output can be very helpful to troubleshoot
these issues.

Regards,
David Ennis



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 16 April 2015 at 14:38, Puneet makwana yinyan...@hotmail.com wrote:

 Hi All,
 I have been struggling with a basic authentication error and I know it is
 something simple. I am using Marklogic 8 on Win8 and I am trying to create
 a REST API instance using Curl CLI. The command that I am using is
 curl -s -X POST --digest --user admin:admin -d{\rest-api\ :
 {\name\:\5minguide\,\database\:\5minguide\,\port\:8010}} -H
 Content-type: application/json http://localhost:8002/v1/rest-apis;
 I am using admin:admin to authenticate to the http://localhost:800
 http://localhost:80021 (admin console) but everytime I run the above
 command I get the following error

 html xmlns=http://www.w3.org/1999/xhtml;
   head
 title401 Unauthorized/title
 meta name=robots content=noindex,nofollow/
   /head
   body
 h1401 Unauthorized/h1
   /body
 /html

 can anyone confirm if I am user the right user? or role required to create
 REST API instance?
 Thanks in advance.
 regards,
 Puneet

 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Scheduled Task to run batch file.

2015-04-13 Thread David Ennis
MarkLogic does not execute external code like shell or batch scripts.
 ​How are you trying to trigger the script? ​




Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 13 April 2015 at 20:40, Thomas, Elroy E (CGI Federal) 
elroy.tho...@cgifederal.com wrote:

  I see linux shell scripts (.sh) have a mimetype in MarkLogic 7, but I
 don’t see one for windows batch files (.bat).

 I am testing being able to run a shell script weekly to stop and start a
 MarkLogic plugin for New Relic.



 I am testing the process on my windows laptop and plan to implement it in
 our production Linux environment.



 I tried adding application/bat mimetype as binary, but I still get
 XDMP-NOEXECUTE errors.





 *Gene Thomas*

 MarkLogic Deployment  Operations Engineer

 VDC-HIM Project | CGI Federal | T: 619-947-6507 | C 619-496-7766

 www.cgi.com



 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Scheduled Task to run batch file.

2015-04-13 Thread David Ennis
HI. Yes - I think that security certifications come at a price related to
ML Isolation from the host machine.

Just so you know, a somewhat standard way of making ML 'do thing' on the
machine is to write an http service of your choice(Python, Java, etc) and
use ML HTTP client to interact with it.  But in your case, if you need to
do that, then you are likely just as well to keep it completely external.

Kind Regards,
David Ennis



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 13 April 2015 at 20:51, Thomas, Elroy E (CGI Federal) 
elroy.tho...@cgifederal.com wrote:

  David/Danny,



 Thanks for the quick response.

 We are using New Relic to monitor ML.  Unfortunately, the New Relic plugin
 seems to need restarting regularly to maintain connectivity.  It stops
 reporting after an unknown period of time.  We were hoping to use an ML
 scheduled task to run a shell script to stop and then restart the plugin.
 I guess we will have to switch to using cron instead.



 *Gene Thomas*

 MarkLogic Deployment  Operations Engineer

 VDC-HIM Project | CGI Federal | T: 619-947-6507 | C 619-496-7766

 www.cgi.com



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *David Ennis
 *Sent:* Monday, April 13, 2015 11:47 AM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] Scheduled Task to run batch file.



 MarkLogic does not execute external code like shell or batch scripts.

  ​How are you trying to trigger the script? ​








 Kind Regards,

 David Ennis





 *David Ennis*
 *Content Engineer*

 [image: HintTech]  http://www.hinttech.com/
 Mastering the value of content
 creative | technology | content

 Delftechpark 37i
 2628 XJ Delft
 The Netherlands
 T: +31 88 268 25 00
 M: +31 63 091 72 80

 [image: http://www.hinttech.com] http://www.hinttech.com
 https://twitter.com/HintTech  http://www.facebook.com/HintTech
 http://www.linkedin.com/company/HintTech



 On 13 April 2015 at 20:40, Thomas, Elroy E (CGI Federal) 
 elroy.tho...@cgifederal.com wrote:

 I see linux shell scripts (.sh) have a mimetype in MarkLogic 7, but I
 don’t see one for windows batch files (.bat).

 I am testing being able to run a shell script weekly to stop and start a
 MarkLogic plugin for New Relic.



 I am testing the process on my windows laptop and plan to implement it in
 our production Linux environment.



 I tried adding application/bat mimetype as binary, but I still get
 XDMP-NOEXECUTE errors.





 *Gene Thomas*

 MarkLogic Deployment  Operations Engineer

 VDC-HIM Project | CGI Federal | T: 619-947-6507 | C 619-496-7766

 www.cgi.com




 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Range index for duplicate element for facets how to

2015-04-05 Thread David Ennis
HI.

I suggest you verify your path range indexes in query console to make sure
they are correct *before* you go any further.

You state that the path range index you created is: product-reference/date

However, looking at your provided XML, that path does not exist. Date is
under:  product-reference/product-id/date

​Note:
I test things like this in query console by adding the xPath expression to
the test XML.  For you sample, the following is how I noted the need for
product-id:
xml
product-reference
product-id
countryIND/country
product-numberAA-503/product-number
product-typeapparel/product-type
date20130105/date
/product-id
/product-reference
/xml/product-reference/product-id/date​


Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 5 April 2015 at 07:02, Shashidhar Rao raoshashidhar...@gmail.com wrote:

 Have tried replacing with path-index still getting this error
 RESTAPI-EMPTYBODY (err:FOER):

 ?xml version=1.0 encoding=UTF-8?
 options xmlns=http://marklogic.com/appservices/search;
 constraint name=date
   range collation=http://marklogic.com/collation/; type=xs:string
 facet=false
 path-indexproduct-reference/date/path-index
   /range
 /constraint
 /options

 Thanks
 sd

 On Sat, Apr 4, 2015 at 11:36 PM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

 Just created path range indexes for the above date, and was trying to
 write the options through QueryOptionsManager  writeOptions method, but for
 Range index it is working but for Path range index the options is giving me
 java.lang.NullPointerException

 My Path Range Index settings.
 scalar type = string
 path expression = product-reference/date
 collation =http://marklogic.com/collation/;

 Options I want to write through QueryOptionsManager
 ?xml version=1.0 encoding=UTF-8?
 options xmlns=http://marklogic.com/appservices/search; 
 constraint name=date
   range type=xs:string collation=http://marklogic.com/collation/;
element ns= name=product-reference/date/
/range
 /constraint
 /options

  Appreciate if someone could help me fix this issue. I had gone through
 the documentation but could not find the options xml for Path range index.
 Maybe the range is not what is expected for Path range index.

 Thanks
 sd

 On Sat, Apr 4, 2015 at 6:47 PM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

 Could some help me with creating the range index for a duplicated nested
 element

 A snippet of my xml structure is given below and I want to create range
 index for the date under the product-reference for the facets and not the
 date under the
 store-reference . How should I do it . Appreciate if some could help
 me out.

 2. Is it still possible for me to create both the date as range indexes
 which one marklogic will pick up if I create range indexes for both date
 under product-reference and date under store-reference.


 product-reference
 product-id
 countryIND/country
 product-numberAA-503/product-number
 product-typeapparel/product-type
 date20130105/date
 /product-id
 /product-reference
 store-reference
 store-id
 countryJP/country
 store-number8369/store-number
 date20120906/date
 /store-id
 /store-reference

 thanks
 sd




 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Range index for duplicate element for facets how to

2015-04-04 Thread David Ennis
Use a path index perhaps

On 4 April 2015 15:17:40 CEST, Shashidhar Rao raoshashidhar...@gmail.com 
wrote:
Could some help me with creating the range index for a duplicated
nested
element

A snippet of my xml structure is given below and I want to create range
index for the date under the product-reference for the facets and not
the
date under the
store-reference . How should I do it . Appreciate if some could help
me
out.

2. Is it still possible for me to create both the date as range indexes
which one marklogic will pick up if I create range indexes for both
date
under product-reference and date under store-reference.


product-reference
product-id
countryIND/country
product-numberAA-503/product-number
product-typeapparel/product-type
date20130105/date
/product-id
/product-reference
store-reference
store-id
countryJP/country
store-number8369/store-number
date20120906/date
/store-id
/store-reference

thanks
sd




___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] AngularJS to MarkLogic Connectivity Isssue

2015-03-31 Thread David Ennis
Also, If you have the ability to update to MarkLogic 8, then this is a
non-issue with the new Advanced HTTP Server features.


Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content


On 31 March 2015 at 15:41, Varun Shetty varu...@gmail.com wrote:

 You would need a search query transform to apply cross origin headers.

 Headers should be part of your response and not your request.

 These links should help in understanding search query transform
 http://docs.marklogic.com/guide/node-dev/extensions#id_78179
 http://docs.marklogic.com/REST/PUT/v1/config/transforms/[name]

 If you are testing locally and want to get rid of the cross domain errors
 locally, you can modify the chrome shortcut to add the following arguments.
 --args --allow-file-access-from-files --disable-web-security


 Regards,
 Varun Shetty



 On Mon, Mar 30, 2015 at 11:23 PM, SateeshKumar Bheemsetty 
 sateesh.bheemse...@gmail.com wrote:

 Hi Team,

 I am trying to save a user entered[page developed in AngularJS]
 information as a json document in Mark Logic through ML REST API but am
 facing below issue :

 *browser console:*
 NetworkError: 401 Unauthorized -
 http://localhost:8003/v1/documents?uri=/docs/;
 documen...=/docs/
 2
 Cross-Origin Request Blocked: The Same Origin Policy disallows reading
 the remote resource at http://localhost:8003/v1/documents?uri=/docs/.
 This can be fixed by moving the resource to the same domain or enabling
 CORS.


 *In browser NetWork Tab it shows as below :*

 error-response xmlns=http://marklogic.com/xdmp/error;
   status-code404/status-code
   statusNot Found/status
   message-codeRESTAPI-NODOCUMENT/message-code
   messageRESTAPI-NODOCUMENT: (err:FOER) Resource or document does
 not exist:  category: content message: /docs/userInfo.json
 /message
 /error-response

 *code tried to connect :*
 $http({
 method: 'PUT',
 url: 'http://localhost:8003/v1/documents?uri=/docs/userInfo.json',
 data: data1,
 headers:{
 'Access-Control-Allow-Origin': '*',
 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE,
 OPTIONS',
 'Access-Control-Allow-Headers': 'Content-Type,
 X-Requested-With'
 }
 }).success(function () {alert('Successfully Added In DB');});
 }
 });

 My Angular JS web page is deployed in tomcat on port 7080 and my REST API
 is located at 8003.Also i have not passed any credentials to connect ML and
 am not not sure on how to pass authentication .

 Could you please guide me in getting this resolved.


 Thanks,
 Sateesh

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Additional XQuery libraries

2015-03-26 Thread David Ennis
There is is a comminity driven, open mailing list that you are aparently
subscribed to..

No one ion particular  is mailing you.. NO one is trying to spam you or
keep you on the list.. Florent and others were just trying to assist you...

The link seems to work just fine..

http://developer.marklogic.com/mailman/listinfo/general






Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 26 March 2015 at 15:40, norman817 norman...@gmail.com wrote:

 I have followed the link the at the bottom of the email. When I click
 unsubscribe, it gives me an error. This is the thrid time I've tried to do
 this.  What do you expect  from me.


  Original message 
 From: Florent Georges li...@fgeorges.org
 Date:26/03/2015 8:56 AM (GMT-06:00)
 To: MarkLogic Developer Discussion general@developer.marklogic.com,
 norman...@gmail.com
 Subject: Re: [MarkLogic Dev General] Additional XQuery libraries

 Please click on the link at the bottom of every email sent to the list
 (like this one).  Follow the Mailman instructions to unsubscribe.

 On 26 March 2015 at 14:27, norman817 wrote:

 Stop emailing me


  Original message 
 From: Alex Jouravlev al...@businessabstraction.com
 Date:25/03/2015 10:11 PM (GMT-06:00)
 To: MarkLogic Developer Discussion General@developer.marklogic.com
 Subject: [MarkLogic Dev General] Additional XQuery libraries

 Hi Everyone,

 What additional XQuery libraries - other than supplied with MarkLogic -
 you found useful?

 Alex Jouravlev
 Director, Business Abstraction Pty Ltd
 Phone:   +61-(2)-8003-4830
 Mobile: +61-4-0408-3258
 Web: http://www.businessabstraction.com
 LinkedIn: http://au.linkedin.com/in/alexjouravlev/

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

 --
 http://developer.marklogic.com/mailman/listinfo/general
 Florent Georges
 http://developer.marklogic.com/mailman/listinfo/general
 http://fgeorges.org/
 http://h2oconsulting.be/


 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] xml ingestion quick question

2015-03-24 Thread David Ennis
I always find it more exact to configure my indexes in the admin interface
instead of the app-builder interface (I'm not a fan of wizard-type things
that hide some options).  You have more control over the process and more
options.


[BTW: when using roxy, we usually then read the database.xml and extract
the configured indexes for us in ml-config.xml later]



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 23 March 2015 at 20:50, cyanline llc i...@cyanline.com wrote:

 Mike,
While attempting to add the Element via the CONFIGURE ELEMENT RANGE
 INDEX menu on the app builder interface (port 8000), upon hitting the
 Find button, I receive No elements matched your search. For this
 app, I have added all the other Element Rage Indexes with this method
 (~15).
I have not tried via the admin interface, nor with the ml-config.xml
 file.
The version of ML is 7.0-4.3

 Thank you,
 Cory
 On 03/23/2015 03:44 PM, Michael Blakeley wrote:
  There is no nesting limit.
 
  Why can't you create an element-range index on attachment_filename? Is
 there an error message?
 
  What's the full version number of the MarkLogic release you're using?
 
  -- Mike
 
  On 23 Mar 2015, at 11:27 , cyanline llc i...@cyanline.com wrote:
 
  Hello,
 What am I missing that I can create an Element Range Index on
  attachment-count but not attachment_filename?
 Below is sample XML that I am ingesting and building an app around.
 
  attachment-count1/attachment-count
  attachments
 attachment
  attachment_filenameAdnserio~1.pdf/attachment_filename
 /attachment
  /attachments
 
 I have checked and I am producing valid XML. 'attachment-count' is
  obviously nested, so, is there a nesting maximum?
 
  Thanks in advance.
  ___
  General mailing list
  General@developer.marklogic.com
  http://developer.marklogic.com/mailman/listinfo/general
 
  ___
  General mailing list
  General@developer.marklogic.com
  http://developer.marklogic.com/mailman/listinfo/general

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] ML8 404 Error

2015-03-20 Thread David Ennis
Rewriter or permissions?

On 20 March 2015 23:17:45 CET, Paul Williams 
paul.willi...@flatironssolutions.com wrote:
I recently upgraded to ML8 and redeployed my app on my local dev
environment (Win Serv 2k8) without a hitch.  But when I tried the same
upgrade steps on a test server (Linux), I am getting a 404 error when
trying to access the application.  It's as if it cannot see modules in
the modules db associated with the appserver.  I've double checked the
modules db and root path settings.

In the qconsole, the Content Source properly lists my [database]
([modules db]) combination and I can invoke a loaded module there
successfully.  The ErrorLog shows nothing and the AccessLog for that
port just shows the GET attempt with the 404 response code.

Any suggestions?
TIA

-- Paul Williams





___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Can't insert document with square brackets in uri

2015-03-18 Thread David Ennis
I think Geert's point is that zip-create accepts 2 things - a manifest and
a sequence of nodes.

The names of the files in the zip can be whatever you want, I believe
The sequence of nodes are then stored in the zip in order where nodes[1]
matches the first part, etc.

SO, the name of the file in ML need not necessarily match the filename in
the zip.





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 18 March 2015 at 21:21, Danny Sinang d.sin...@gmail.com wrote:

 I see. You're suggesting I not save the said file into ML, but rather save
 it inside a zip (pptx) file which accepts that filename format.

 Thanks !

 Danny

 On Wed, Mar 18, 2015 at 3:18 PM, Geert Josten geert.jos...@marklogic.com
 wrote:

  Hi Danny,

  I thought it should be possible to specify the name/path at which a
 file should be stored in the zip with the manifest that you supply to
 xdmp:zip..

  Cheers,
 Geert

   From: Danny Sinang d.sin...@gmail.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 
 Date: Wednesday, March 18, 2015 at 8:03 PM
 To: general General@developer.marklogic.com
 Subject: [MarkLogic Dev General] Can't insert document with square
 brackets in uri

   I'm trying to programmatically copy a powerpoint template file from
 one ML directory to another using xdmp:document-insert().

  Problem is, that file's URI (see below) has square brackets in it.

  [Content_Types].xml



  I wish I could just rename that source file, but that's how MS
 Powerpoint named it.

  Renaming it, and then zipping it up into a .pptx file results in a
 corrupted Powerpoint file.

  Is there another way to do the copying ?

  Regards,
 Danny



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Cancellation of Updates

2015-03-14 Thread David Ennis
​There is a link on the email you received for which you can unsubscribe
yourself.

Kind Regards,
David Ennis​



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 14 March 2015 at 12:09, Roland Priborsky broukpit...@gmail.com wrote:

 Can you please take me of the mailing list. Thank you very much indeed.
 Roland

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Loading Skos triples using Rest

2015-02-16 Thread David Ennis
HI.

The supported formats of triples used with the REST api are listed here
with the corresponding mime-type needed for the post request to the server:

http://docs.marklogic.com/guide/semantics/loading#id_70682

If you are using a format not listed here, then  you will likely need to
transform it to one of the supported types.



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 16 February 2015 at 16:40, Basavaraj Kalloli basavarajkall...@gmail.com
wrote:

 Hi MarkLogic Devs,

 I want to load triples using the Rest endpoint as documented here:

 http://docs.marklogic.com/guide/semantics/loading#id_97293

 But I have a Skos format and I dont see a way to set the MimeType to Skos
 for it to be loaded. Any ideas how to get this to work?

 The simplest thing to do is use mlcp to load this, but I cant use mlcp
 because I am working on a stateless environment where I dont have access to
 the File System.

 Cheers,
 Basu

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Loading Skos triples using Rest

2015-02-16 Thread David Ennis
That's a different story alltogether - an actual error message:

perhaps start with the sample for rdf-xml from ML and work from there:

rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#;
  xmlns:d=http://example.org/data/;
  xmlns:xsd=http://www.w3.org/2001/XMLSchema/;
  rdf:Description rdf:about=http://example.org/data#item22;
d:shipped rdf:datatype=xsd:date2013-05-14/d:shipped
d:quantity rdf:datatype=xsd:integer27/d:quantity
d:invoiced rdf:datatype=xsd:booleantrue/d:invoiced
d:costPerItem rdf:datatype=xsd:decimal10.50/d:costPerItem
  /rdf:Description
/rdf:RDF




Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 16 February 2015 at 17:01, Basavaraj Kalloli basavarajkall...@gmail.com
wrote:

 Yeap so I used the MIME type as 'application/rdf+xml' and tried the above
 curl request with PUT but it just fails with the below error:

 rapi:error 
 xmlns:rapi=http://marklogic.com/rest-api;rapi:status-code400/rapi:status-coderapi:statusBad
 Request/rapi:statusrapi:message-codeXDMP-DOCROOTTEXT/rapi:message-coderapi:messageXDMP-DOCROOTTEXT:
 xdmp:get-request-body(xml) -- Invalid root text

 On Mon, Feb 16, 2015 at 9:28 PM, Anthony Coates anthony.coa...@db.com
 wrote:

  Classification: *Public*

 SKOS is just RDF, to the question is just around what RDF format has been
 used (e.g. Turtle vs. RDF/XML).  SKOS doesn’t have its own MIME type.  
 Cheers,
 Tony.



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *David Ennis
 *Sent:* 16 February 2015 15:56
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] Loading Skos triples using Rest



 HI.



 The supported formats of triples used with the REST api are listed here
 with the corresponding mime-type needed for the post request to the server:



 http://docs.marklogic.com/guide/semantics/loading#id_70682



 If you are using a format not listed here, then  you will likely need to
 transform it to one of the supported types.






 Kind Regards,

 David Ennis





 *David Ennis*
 *Content Engineer*

 [image: HintTech]  http://www.hinttech.com/
 Mastering the value of content
 creative | technology | content

 Delftechpark 37i
 2628 XJ Delft
 The Netherlands
 T: +31 88 268 25 00
 M: +31 63 091 72 80

 [image: http://www.hinttech.com] http://www.hinttech.com/ [image:
 http://www.hinttech.com/signature/Twitter_HintTech.png]
 https://twitter.com/HintTech [image:
 http://www.hinttech.com/signature/Facebook_HintTech.png]
 http://www.facebook.com/HintTech [image:
 http://www.hinttech.com/signature/Linkedin_HintTech.png]
 http://www.linkedin.com/company/HintTech



 On 16 February 2015 at 16:40, Basavaraj Kalloli 
 basavarajkall...@gmail.com wrote:

 Hi MarkLogic Devs,



 I want to load triples using the Rest endpoint as documented here:



 http://docs.marklogic.com/guide/semantics/loading#id_97293



 But I have a Skos format and I dont see a way to set the MimeType to Skos
 for it to be loaded. Any ideas how to get this to work?



 The simplest thing to do is use mlcp to load this, but I cant use mlcp
 because I am working on a stateless environment where I dont have access to
 the File System.



 Cheers,

 Basu


 ___
 General mailing list
 General@developer.marklogic.com
 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.

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Loading Skos triples using Rest

2015-02-16 Thread David Ennis
OK.. Here is an example directly form following the manual..

*# my sample xmle file*
*$ cat sample-triple.xml *
rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#;
  xmlns:d=http://example.org/data/;
  xmlns:xsd=http://www.w3.org/2001/XMLSchema/;
  rdf:Description rdf:about=http://example.org/data#item22;
d:shipped rdf:datatype=xsd:date2013-05-14/d:shipped
d:quantity rdf:datatype=xsd:integer27/d:quantity
d:invoiced rdf:datatype=xsd:booleantrue/d:invoiced
d:costPerItem rdf:datatype=xsd:decimal10.50/d:costPerItem
  /rdf:Description
/rdf:RDF
*#my script*
*$ cat sample.sh *
curl -s -X PUT --data-binary '@sample-triple.xml'  \
-H Content-type: application/rdf+xml  \
--digest --user *:***  \
http://localhost:/v1/graphs?default;
*#run the command*

*And the result:*
I get a triple in my database (/triplestore/8cfb799a4130f932.xml)


Try a sample like this and see what happens so that we can get a  baseline
in order to properly assist.






Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 16 February 2015 at 17:01, Basavaraj Kalloli basavarajkall...@gmail.com
wrote:

 Yeap so I used the MIME type as 'application/rdf+xml' and tried the above
 curl request with PUT but it just fails with the below error:

 rapi:error 
 xmlns:rapi=http://marklogic.com/rest-api;rapi:status-code400/rapi:status-coderapi:statusBad
 Request/rapi:statusrapi:message-codeXDMP-DOCROOTTEXT/rapi:message-coderapi:messageXDMP-DOCROOTTEXT:
 xdmp:get-request-body(xml) -- Invalid root text

 On Mon, Feb 16, 2015 at 9:28 PM, Anthony Coates anthony.coa...@db.com
 wrote:

  Classification: *Public*

 SKOS is just RDF, to the question is just around what RDF format has been
 used (e.g. Turtle vs. RDF/XML).  SKOS doesn’t have its own MIME type.  
 Cheers,
 Tony.



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *David Ennis
 *Sent:* 16 February 2015 15:56
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] Loading Skos triples using Rest



 HI.



 The supported formats of triples used with the REST api are listed here
 with the corresponding mime-type needed for the post request to the server:



 http://docs.marklogic.com/guide/semantics/loading#id_70682



 If you are using a format not listed here, then  you will likely need to
 transform it to one of the supported types.






 Kind Regards,

 David Ennis





 *David Ennis*
 *Content Engineer*

 [image: HintTech]  http://www.hinttech.com/
 Mastering the value of content
 creative | technology | content

 Delftechpark 37i
 2628 XJ Delft
 The Netherlands
 T: +31 88 268 25 00
 M: +31 63 091 72 80

 [image: http://www.hinttech.com] http://www.hinttech.com/ [image:
 http://www.hinttech.com/signature/Twitter_HintTech.png]
 https://twitter.com/HintTech [image:
 http://www.hinttech.com/signature/Facebook_HintTech.png]
 http://www.facebook.com/HintTech [image:
 http://www.hinttech.com/signature/Linkedin_HintTech.png]
 http://www.linkedin.com/company/HintTech



 On 16 February 2015 at 16:40, Basavaraj Kalloli 
 basavarajkall...@gmail.com wrote:

 Hi MarkLogic Devs,



 I want to load triples using the Rest endpoint as documented here:



 http://docs.marklogic.com/guide/semantics/loading#id_97293



 But I have a Skos format and I dont see a way to set the MimeType to Skos
 for it to be loaded. Any ideas how to get this to work?



 The simplest thing to do is use mlcp to load this, but I cant use mlcp
 because I am working on a stateless environment where I dont have access to
 the File System.



 Cheers,

 Basu


 ___
 General mailing list
 General@developer.marklogic.com
 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.

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman

Re: [MarkLogic Dev General] Loading Skos triples using Rest

2015-02-16 Thread David Ennis
You can pick form the list provided  - depending on what you are able to do
with your data.

The page previously provided does not just list each type supported, but
also has a small description/sample/discussion of each one to help you
decide.





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 16 February 2015 at 16:58, Anthony Coates anthony.coa...@db.com wrote:

  Classification: *Public*

 SKOS is just RDF, to the question is just around what RDF format has been
 used (e.g. Turtle vs. RDF/XML).  SKOS doesn’t have its own MIME type.  Cheers,
 Tony.



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *David Ennis
 *Sent:* 16 February 2015 15:56
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] Loading Skos triples using Rest



 HI.



 The supported formats of triples used with the REST api are listed here
 with the corresponding mime-type needed for the post request to the server:



 http://docs.marklogic.com/guide/semantics/loading#id_70682



 If you are using a format not listed here, then  you will likely need to
 transform it to one of the supported types.






 Kind Regards,

 David Ennis





 *David Ennis*
 *Content Engineer*

 [image: HintTech]  http://www.hinttech.com/
 Mastering the value of content
 creative | technology | content

 Delftechpark 37i
 2628 XJ Delft
 The Netherlands
 T: +31 88 268 25 00
 M: +31 63 091 72 80

 [image: http://www.hinttech.com] http://www.hinttech.com/ [image:
 http://www.hinttech.com/signature/Twitter_HintTech.png]
 https://twitter.com/HintTech [image:
 http://www.hinttech.com/signature/Facebook_HintTech.png]
 http://www.facebook.com/HintTech [image:
 http://www.hinttech.com/signature/Linkedin_HintTech.png]
 http://www.linkedin.com/company/HintTech



 On 16 February 2015 at 16:40, Basavaraj Kalloli 
 basavarajkall...@gmail.com wrote:

 Hi MarkLogic Devs,



 I want to load triples using the Rest endpoint as documented here:



 http://docs.marklogic.com/guide/semantics/loading#id_97293



 But I have a Skos format and I dont see a way to set the MimeType to Skos
 for it to be loaded. Any ideas how to get this to work?



 The simplest thing to do is use mlcp to load this, but I cant use mlcp
 because I am working on a stateless environment where I dont have access to
 the File System.



 Cheers,

 Basu


 ___
 General mailing list
 General@developer.marklogic.com
 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.

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Loading Skos triples using Rest

2015-02-16 Thread David Ennis
Glad its solved.

Kind Regards,
David Ennis
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Fwd: Consuming a multipart response and parsing body part in xquery

2015-02-13 Thread David Ennis
I'll do this over the weekend. I'm curious as well.





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 13 February 2015 at 17:53, Florent Georges li...@fgeorges.org wrote:

   If this is not much trouble to replicate, I'd be interested to see the
 difference, yes.  This is just out of curiosity, so don't spend the day on
 it, please :-)

   I can't see what that could change (as far as standards are concerned,
 at least).  It would be interesting to see the dump of the HTTP response on
 the one hand, and the different result save in the image file on the other
 hand.

   Regards,

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


 On 10 February 2015 at 17:13, David Ennis wrote:

 Hi.

 I can check with on of our developers or run a test again, but that's the
 combination that worked. As I understand it, without hexBinary, images were
 not able to be opened..

 Easy enough to test again. I'll do that in the coming days and confirm



 Kind Regards,
 David Ennis


 David Ennis
 *Content Engineer*

 [image: HintTech]  http://www.hinttech.com/
 Mastering the value of content
 creative | technology | content

 Delftechpark 37i
 2628 XJ Delft
 The Netherlands
 T: +31 88 268 25 00
 M: +31 63 091 72 80

 [image: http://www.hinttech.com] http://www.hinttech.com
 https://twitter.com/HintTech  http://www.facebook.com/HintTech
 http://www.linkedin.com/company/HintTech

 On 10 February 2015 at 17:07, Florent Georges li...@fgeorges.org wrote:

 On 10 February 2015 at 14:23, David Ennis wrote:

  I just checked some of our source code for saving from a post to disk.
  Florent's example has the key - its the casting to xs:base64binary..


   Good to hear :-)

  An example from working code is:  xdmp:save([your-path-here],
  binary{xs:hexBinary(xs:base64Binary([your post variable here)})


   Mmh, that's weird you need to have
 xs:hexBinary(xs:base64Binary(...)).  You should be able to create a
 binary node with either a hex or a base64 binary item.  I do not see
 need to convert the base64 one to hex (even though I don't expect it
 to do any harm).

   Regards,



 --
 Florent Georges
 http://fgeorges.org/
 http://h2oconsulting.be/
  ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general





 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Consuming a multipart response and parsing body part in xquery

2015-02-10 Thread David Ennis
HI.

The data coming in from the form may very well be base-64 encoded.  For
that, you will need xdmp:base64-decode() in addition to what you already
have.




Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 10 February 2015 at 07:29, Raghu raghupathy.visweswa...@gmail.com
wrote:

 Hi All,

   I'm calling a web service from my xquery and the response I'm getting is
 a multipart response with two parts. I need the binary content(pdf) in the
 second part to be stored in Marklogic, using xdmp:document-insert(), but
 I'm unable to do that, I'm getting the following errors


 If I use xdmp:document-insert ($uri,$secondPart) it says ARG2 IS NOT  A
 NODE

 If I use xdmp:document-insert ($uri,document { $secondPart } ) the query
 times out

 If I use binary{$secondPart} then it says invalid xdmp:cast exception

 If I use xdmp:multipart-decode($boundary-value, $multipart-response[2])
 then I get xdmp:invalid multipart

 How do I parse a mutlipart response in xquery? What is the right way to do
 this?
 Please help me out here.

 (: Logic I've used to parse the multipart response is below :)

   let $boundary-value := fn:concat('--',
 fn:substring-after($multipart-response[1]/http:headers/http:content-type,
 'application/x-multipart-mixed;boundary='))

   let $multipart-responseStr :=
 xdmp:binary-decode($multipart-response[2], 'UTF-8')

   let $tokens := fn:tokenize($multipart-responseStr,
 $boundary-value)

   let $secondPart  := fn:substring-after($tokens[3],
 'Content-Type: application/pdf;charset=UTF-8')

 Thanks in advance!




 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Consuming a multipart response and parsing body part in xquery

2015-02-10 Thread David Ennis
I just checked some of our source code for saving from a post to disk.
Florent's example has the key - its the casting to xs:base64binary..

An example from working code is:  xdmp:save([your-path-here],
binary{xs:hexBinary(xs:base64Binary([your post variable here)})



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 10 February 2015 at 13:57, Florent Georges li...@fgeorges.org wrote:

   Hi,

   In addition, you might be interested in the following (not been
 maintained for years and never been completely implemented, but there
 was something WRT multipart, if I remember correctly):


 https://github.com/fgeorges/expath-http-client-ml/blob/master/src/http-client.xq

   Regards,

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


 On 10 February 2015 at 07:29, Raghu wrote:
  Hi All,
 
I'm calling a web service from my xquery and the response I'm getting
 is a
  multipart response with two parts. I need the binary content(pdf) in the
  second part to be stored in Marklogic, using xdmp:document-insert(), but
 I'm
  unable to do that, I'm getting the following errors
 
 
  If I use xdmp:document-insert ($uri,$secondPart) it says ARG2 IS NOT  A
 NODE
 
  If I use xdmp:document-insert ($uri,document { $secondPart } ) the query
  times out
 
  If I use binary{$secondPart} then it says invalid xdmp:cast exception
 
  If I use xdmp:multipart-decode($boundary-value, $multipart-response[2])
 then
  I get xdmp:invalid multipart
 
  How do I parse a mutlipart response in xquery? What is the right way to
 do
  this?
  Please help me out here.
 
  (: Logic I've used to parse the multipart response is below :)
 
let $boundary-value := fn:concat('--',
  fn:substring-after($multipart-response[1]/http:headers/http:content-type,
  'application/x-multipart-mixed;boundary='))
 
let $multipart-responseStr :=
  xdmp:binary-decode($multipart-response[2], 'UTF-8')
 
let $tokens := fn:tokenize($multipart-responseStr,
  $boundary-value)
 
let $secondPart  := fn:substring-after($tokens[3],
 'Content-Type:
  application/pdf;charset=UTF-8')
 
 
  Thanks in advance!
 
 
 
 
  ___
  General mailing list
  General@developer.marklogic.com
  http://developer.marklogic.com/mailman/listinfo/general
 
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MarkLogic Range Query

2015-02-02 Thread David Ennis
HI.

You would want to put range indexes on the min and max attributes
You could then use cts:element-attribute-range query to actually do your
CTS logic
http://docs.marklogic.com/cts:element-attribute-range-query





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 2 February 2015 at 18:17, Dinesh jdin...@xedge.com.sg wrote:

 Hello MarkLogic experts,

 Sorry, one correction in below query/results

 Could you please advise how to use cts functions for the below sample
 results using MarkLogic.

 XML

 entry min=100 max=999

 productapple/product

 /entry

 entry min=1 max=99

 productorange/product

 /entry

 /root



 Query:

 Query 1 :  200   (Less than)

 Results should be: apple, orange

 Query 2 :  200  (Greater than)

 Results should be: apple





 Regards,

 Dinesh



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] ERR_EMPTY_RESPONSE from security-install.xqy

2015-01-26 Thread David Ennis
HI Ardal.

I note that you are installing this in a VM using Ubuntu.

I don't think that MarkLogic has a debian package available.  I uaually use
alien to convert them when testing on debian based systems.

Could you explain how you went about installing MarkLogic on a debian based
system?  Perhaps there is something about that. (for instance, there is a
sysconfig file that gets created that might be overlooked if installed 'by
hand'- not sure if that could be the issue, for instance)




Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 26 January 2015 at 10:50, Ardal Powell ard...@me.com wrote:

 Thanks, Danny. I'm quite sure MarkLogic has not been installed before:
 it's a brand new droplet.

 I went ahead and reinstalled the data directory, but the same thing
 happened on trying to create a new admin user. The server took about a
 minute to return the error.

 I noticed that some of the .xqy in the data directory has permissions as
 low as 600, so I set the whole directory to 777 to see what would happen.
 The only difference was the server returned the error more quickly.

 Also, the system was writing stuff to disk before the CHMOD because
 /var/opt/MarkLogic/Forests/Last-Login/Security/Journals contains the
 following:

 A 0 byte file, Journal1-1970010100-0-18446744073709551615-0

 A file named Label with contents:
 ?xml version=1.0 encoding=UTF-8?
 forest-label xmlns=http://marklogic.com/xdmp/forest/label
 version83886849/versionpublic-lock0/public-lockprivate-lock0/private-lockcheckpoint-FSN10/checkpoint-FSNcheckpoint-offset8416/checkpoint-offsetcheckpoint-sequence-key9457306095252104859/checkpoint-sequence-keybackup-time0/backup-timerestore-time0/restore-timemaster-forest12488019828191884476/master-forestmaster-precise-time14222648032855250/master-precise-timemaster-FSN10/master-FSNmaster-sequence-key9457306095252104859/master-sequence-keywas-synchronized-flagfalse/was-synchronized-flagforeign-master-cluster16048579413085239693/foreign-master-clusterforeign-master-database5988134361757721166/foreign-master-databaseforeign-master-forest12488019828191884476/foreign-master-forestforeign-master-precise-time14222648032855250/foreign-master-precise-timeforeign-master-FSN10/foreign-master-FSNforeign-master-sequence-key9457306095252104859/foreign-master-sequence-keyforeign-fast-query-timestamp18446744073709551615/foreign-fast-query-timestampmin-query-timestamp0/min-query-timestampconfigured-master-forest12488019828191884476/configured-master-forestrollback-timestamp18446744073709551615/rollback-timestamplag-limit0/lag-limitdatabase-key5988134361757721166/database-keyjournal-archive-path/word-size8/word-sizedisk-megabytes0/disk-megabytesfragment-count2/fragment-countpartition-key0/partition-keyplatformlinux/platformarchitecturex86_64/architecture/forest-label

 Thanks again,
 Ardal


 On Jan 25, 2015, at 10:25 PM, Danny Sokolsky wrote:

 Hi Ardal,

 Did the admin interface  prompt you for the name of an admin username and
 password?  Upon initial installation, when you first go to the Admin
 Interface on port 8001, it will prompt you to create an admin user.

 That message says that you are trying to log in with a user that does not
 have the admin role.  Are you sure MarkLogic has never been installed on
 that machine before?  If it was, there might be an existing security
 database there.

 Assuming this is a new installation, it might be easiest to start over.
 To do that, you can 1) shutdown MarkLogic 2) remove the data directory
 (/var/opt/MarkLogic), and then 3) start the server again.  Then you can go
 to port 8001 in a browser and see what happens.

 WARNING: I this is not a new installation, do not do what I said above
 because it will delete your data directory.

 -Danny

 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of*Ardal Powell
 *Sent:* Sunday, January 25, 2015 5:02 PM
 *To:* general@developer.marklogic.com
 *Subject:* [MarkLogic Dev General] ERR_EMPTY_RESPONSE from
 security-install.xqy

 Hi all,

 I have installed MLS 7.0 on a Digitalocean droplet running Ubuntu 14.04.1.
 Having some security problems I hope you can help with.

 The Admin Interface responded on port 8001 and installed the database but
 I'm unable to proceed to user setup because security-install-go.xqy
 returned an ERR_EMPTY_RESPONSE on posting the form data.

 Now, attempting to use Admin returns a 500 Error with the following
 details:

 *500: Internal Server Error*





 *SEC-NOADMIN: (err:FOER) User does not have admin role.In
 /MarkLogic/security.xqy on line 5340In sec:check-admin

Re: [MarkLogic Dev General] Bulk content processing in MarkLogic

2015-01-16 Thread David Ennis
HI.

Yes, Geert, thank you for translating my vague answer.

have 5000 docs, chunk them into 10 sets of 500 and pass those URIs to
xdmp:spawn-function or xdmp:spawn where you have the logic to iterate over
those individually.  That's the rough idea.

If you can try a sample like that, then you'll have a bit of understanding
of what taskbot does for you.

One other note:  I often make these batches a bit more controllable.  I
love serialized maps, so if I want accounting information or some other way
to control the processing, Ill store the uris for each batch as in a map of
maps and then I can also write accounting info as I go..




Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 16 January 2015 at 09:22, Geert Josten geert.jos...@marklogic.com
wrote:

  Hi Alexei,

  Naively spawning for each document doesn’t work well indeed. To improve
 that slightly, you should make batches of roughly 100 docs, and spawn
 processing of batches. I think that is what David meant.

  To take it up even one more level, you could have you spawning query
 spawn only a limited number of batches (10 maybe), and then spawn itself to
 do the remainder. All spawns end up on the task queue, which are processed
 in parallel already. The creation of tasks on the queue would be paced down
 when spawning the query that creates the batches, so only a very limited
 number of tasks would be on the queue on average. That would prevent
 overflow, and also leave room for other tasks, like evals from other
 processes and scheduled tasks.

  Batching is used by most tools, including Corb, MLCP, and I would expect
 also taskbot. I am less sure about the spawning of the batching. I know it
 is used internally by Information Studio, but that is designed for loading
 of content, not for processing content already in the database..

  Kind regards,
 Geert

   From: Alexei Betin abe...@elevate.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Friday, January 16, 2015 at 1:52 AM
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: Re: [MarkLogic Dev General] Bulk content processing in MarkLogic

   Thanks, Paul and David!



 Using simply xdmp:spawn-function() did not help much since I ran into
 “maximum tasks” limit when naively spawning a function for each document.



 But CoRB worked beautifully and it’s definitely parallelizing the job just
 the way I wanted.



 I am also going to take a look at Taskbot which seems really useful.



 Thanks again!



 *[image: Forward Slash]*

 *[image: Elevate]*

 *Alexei Betin*

 Principal Architect; Big Data
 P: (817) 928-1643 | Elevate.com http://www.elevate.com
 4150 International Plaza, Suite 300
 Fort Worth, TX 76109



 Privileged and Confidential. This e-mail, and any attachments thereto, is
 intended only for use by the addressee(s) named herein and may contain
 privileged and/or confidential information. If you have received this
 e-mail in error, please notify me immediately by a return e-mail and delete
 this e-mail. You are hereby notified that any dissemination, distribution
 or copying of this e-mail and/or any attachments thereto, is strictly
 prohibited.



 *From:* general-boun...@developer.marklogic.com [
 mailto:general-boun...@developer.marklogic.com
 general-boun...@developer.marklogic.com] *On Behalf Of *Paul Hoehne
 *Sent:* Thursday, January 15, 2015 10:50 AM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] Bulk content processing in
 MarkLogic



 There’s also the CORB facility.  I would try Taskbot, but if you’re not
 familiar with it, I would also try to do a version of it using
 xdmp:spawn-function.  Learning to use xdmp:spawn-function is s a sometimes
 over-looked but extremely useful function.



 *Paul Hoehne*

 Senior Consultant

 MarkLogic Corporation

 paul.hoe...@marklogic.com

 mobile: +1 571 830 4735

 www.marklogic.com



 Click http://po.st/hMGDFm to get your free NoSQL For Dummies e-book!



 *From: *David Ennis david.en...@hinttech.com
 *Reply-To: *MarkLogic Developer Discussion 
 general@developer.marklogic.com
 *Date: *Thursday, January 15, 2015 at 1:43 PM
 *To: *MarkLogic Developer Discussion general@developer.marklogic.com
 *Subject: *Re: [MarkLogic Dev General] Bulk content processing in
 MarkLogic



 HI.



 I usually spawn these types of things in batches.



 Also, There is also a nice utility by Michael Blakeley out there to help
 manage this and make good use of the resources of your particular setup -
 including a nice sample to start with:



 https://github.com/mblakele/taskbot



 It uses pretty

Re: [MarkLogic Dev General] Bulk content processing in MarkLogic

2015-01-15 Thread David Ennis
HI.

I usually spawn these types of things in batches.

Also, There is also a nice utility by Michael Blakeley out there to help
manage this and make good use of the resources of your particular setup -
including a nice sample to start with:

https://github.com/mblakele/taskbot

It uses pretty much the same functions you would likely use on your own -
but organized nicely in a reusable/configurable way.


Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 15 January 2015 at 19:33, Alexei Betin abe...@elevate.com wrote:

  Hello,



 I stumble upon what seems to be a straightforward task of making a bulk
 modification of XML documents in MarkLogic (such as adding a new element to
 every document in the collection). I’ve looked at CPF first, but it seems
 like it only supports event-based processing (triggers) and does not have
 any facility for batch processing.



 So I just write a simple xQuery as follows:



 for $x in collection()/A  return ( xdmp:node-delete( $x/test ),
 xdmp:node-insert-child( $x, testtest/test ) )



 but it runs out of memory on a large collection – “Expanded tree cache
 full”. So it looks like the above query is trying fetch all documents into
 memory first, then iterate over them.



 Whereas what I want is to perform the work on smaller chunks of data that
 fit into memory and, ideally, do several such chunks in parallel (think
 “map” without “reduce”).



 Is there another approach? I am reading about CoRB that seems to be just
 the thing I need, but I wonder if I am missing another potential solution
 here.



 Also, while CoRB description mentions that it can run updates on disk (not
 in memory), it does not mention parallelization – which eventually will be
 quite important for my use case.



 Thanks,



 *[image: Forward Slash]*

 *[image: Elevate]*

 *Alexei Betin*

 Principal Architect; Big Data
 P: (817) 928-1643 | Elevate.com http://www.elevate.com
 4150 International Plaza, Suite 300
 Fort Worth, TX 76109



 Privileged and Confidential. This e-mail, and any attachments thereto, is
 intended only for use by the addressee(s) named herein and may contain
 privileged and/or confidential information. If you have received this
 e-mail in error, please notify me immediately by a return e-mail and delete
 this e-mail. You are hereby notified that any dissemination, distribution
 or copying of this e-mail and/or any attachments thereto, is strictly
 prohibited.



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How to get all result in single hit through REST API

2015-01-09 Thread David Ennis
HI.

You could do one call with the pageLength set to zero. I believe this will
still give you the total count of all records in the result -but no data.

Then you could use that value to use for pageLenght.

Not sure if there is a hard-coded max somewhere in the REST code. that
would be the only hiccup, I believe.



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 9 January 2015 at 08:54, thangella.vinodre...@cognizant.com wrote:

  Hi,



 Mark Logic search REST API  by default returns 10 records per hit. We know
 that there is an attribute called “pageLength” to return the no of results
 to which it is set.



 But we want to return all documents from MarkLogic database without
 knowing its count. It’s not recommended to get all result in a single shot
 but currently our requirement is like that only.



 So, Is there any parametric value we have to pass in REST API search URL
 or any other way? Please suggest.





 Regards,

 Vinod Reddy.

 +91-9490342007


  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.

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] XDMP:http-get and 304 responses

2015-01-08 Thread David Ennis
Although not an ideal solution, but if it does end up being a bug that you
have to live with for now,  then perhaps one way that will help with the
delay for the time being at the expense of extra round-trips:

- first do a head request using hdmp:http-head()
- locally decide on the need to download the doc (assuming the
Last-Modified header is returned)
- then do a regular fetch without the If-Modified-Since header (since you
figured that out from the head request)

Again, not ideal, but if xdmp:http-get truly waits for the timeout, then
perhaps this is of value in the meantime.





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 8 January 2015 at 20:13, Geert Josten geert.jos...@marklogic.com wrote:

  Hi Chris,

  It is not uncommon to be strict in sending, tolerant in receiving with
 such things. I would recommend sending your case to Support. The delay
 sounds unnecessary, and inconvenient..

  Kind regards,
 Geert

   From: Chris Hudson-Silver chris.hudson-sil...@ixxus.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Thursday, January 8, 2015 at 6:22 PM
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: Re: [MarkLogic Dev General] XDMP:http-get and 304 responses

   Hi Gert,



 Thanks for your reply.



 I checked and the response did not have a content-length so I checked the
 HTTP spec to see what the content-length should be set to for a 304
 response.

 “The 304 response MUST NOT contain a message-body”:

 http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5

 “The presence of a message-body in a request is signaled by the inclusion
 of a Content-Length or Transfer-Encoding header”:

 http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3



 which makes me think that a 304 response should not have a Content-Length.



 Even so I tried forcing my remote repository to have a Content-Length of 0
 but the header was not getting back to MarkLogic. I thought this might be
 because it was detecting the lack of message body and therefore not setting
 the header so I decided to break the HTTP spec and include a body but again
 the Content-Length and body were missing in my response. Looking into the
 Application Server itself (tomcat) it looks as if a response with a 304
 response will always filter out the content body and Content-Length header
 (probably to force it to comply with the HTTP spec):


 https://github.com/apache/tomcat60/blob/94b4cf497377e48b116c0bed7ccada0f47cd9c10/java/org/apache/coyote/http11/Http11NioProcessor.java#L1649

 indicates that the following is used to remove the content body

 https://github.com/apache/tomcat60/blob/94b4cf497377e48b116c0bed7ccada0f47cd9c10/java/org/apache/coyote/http11/filters/VoidOutputFilter.java

 and the following will cause the content-length to be removed


 https://github.com/apache/tomcat60/blob/94b4cf497377e48b116c0bed7ccada0f47cd9c10/java/org/apache/coyote/http11/Http11NioProcessor.java#L1442



 So looks like I can’t force the remote server to set a zero content-length
 if that would cause the MarkLogic call not to wait for the full timeout.

 What do you think bug in Tomcat or MarkLogic?



 Thanks again,

 Chris



 *From:* Geert Josten [mailto:geert.jos...@marklogic.com
 geert.jos...@marklogic.com]
 *Sent:* 08 January 2015 10:44
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] XDMP:http-get and 304 responses



 Hi Chris,



 Does the response contain a Content-Length? If not, maybe MarkLogic waits
 the full timeout before it decides there is none. If it has one (with a
 value of zero), that might be a bug..



 Kind regards,

 Geert



 *From: *Chris Hudson-Silver chris.hudson-sil...@ixxus.com
 *Reply-To: *MarkLogic Developer Discussion 
 general@developer.marklogic.com
 *Date: *Thursday, January 8, 2015 at 11:12 AM
 *To: *general@developer.marklogic.com general@developer.marklogic.com
 *Subject: *[MarkLogic Dev General] XDMP:http-get and 304 responses



 Hi All,



 Recently I was working on a project that tracks a repository by calling a
 REST webservice that returns back metadata and download URLS for items that
 have changed in the remote repository since the last call. It then checks
 to see if the item has already been downloaded and if so will call the
 download URL with the HTTP cache headers set as the modification could have
 been just metadata not content. E.g:



 let $options := options
 xmlns=xdmp:httpheadersIf-Modified-SinceFri, 21 Nov 2014 16:53:12
 GMT/If-Modified-SinceIf-None-Match1416588792000/If-None-Match/headersrepair
 xmlns=xdmp:document

Re: [MarkLogic Dev General] function index in MarkLogic?

2015-01-08 Thread David Ennis
To expand on those answers by Justin and Geert:

I've played with this challenge a bit about a year ago and come to an
interesting solution that worked well enough for my needs:

- set up a trigger on update or insert
- analyze the doc to see if it matches your function (the code you are
using, for example)
- store the uri in a document as a type of index if it matches.

Consider it essentially a filtered verison of the URI lexicon

I used one 'document' per 'filter' for various lexicons

Sounds odd, but consider the following
With the proper index, I can use element-values passed to a
cts:document-query to create a filter completely from indexes.

I also cheat a bit and use serialized maps. a bit of extra content, but
then I can just use map-put and guarentee no duplicates. You could thin
that our much more by checking for an element before


Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 8 January 2015 at 21:27, Justin Makeig justin.mak...@marklogic.com
wrote:

 As Geert indicates, there is no exactly comparable functionality in
 MarkLogic today. You can think of the document—structure and values—as the
 API to the indexes. Thus, if you want to index something it needs to be
 (mostly) explicit in the document itself. (Word stemming is a counter
 example of something that's automatically derived index time.) I think your
 best bet will be to compute the derived values for inserts or updates and
 batch process your existing content. You can use CPF 
 http://docs.marklogic.com/guide/cpf or lower level triggers 
 http://docs.marklogic.com/guide/app-dev/triggers to manage the
 steady-state workflow or orchestrate externally depending on what you have
 in front of MarkLogic (e.g. an application/service layer in Java, for
 example).

 Justin

  On Jan 8, 2015, at 12:19 PM, Geert Josten geert.jos...@marklogic.com
 wrote:
 
  Hi Alexei,
 
  On the question whether MarkLogic allows indexing function results, then
 the answer is unfortunately no. Such a feature is on the wish list of many
 of us.
 
  The best alternative for upper-case would be using collations to ignore
 case, for instance http://marklogic.com/collation//S1 (ignore case and
 diacritics) or http://marklogic.com/collation//S2 (ignore case). You can
 use the collation builder in the admin interface to tweak the collation
 uri, or search the documentation to find out all options.
 
  Kind regards,
  Geert
 
  From: Alexei Betin abe...@elevate.com
  Reply-To: MarkLogic Developer Discussion 
 general@developer.marklogic.com
  Date: Thursday, January 8, 2015 at 8:47 PM
  To: general@developer.marklogic.com general@developer.marklogic.com
  Subject: [MarkLogic Dev General] function index in MarkLogic?
 
  Hello,
 
 
 
  Does MarkLogic has something similar to “function index” as exists in
 other databases such as Oracle? For example, in Oraclecreate a function
 index on a value of UPPER(field_name) as follows:
 
  CREATE INDEX cities_fn_idx ON cities (UPPER(name));
 
  which ensures that a query like the one below is efficient and not using
 the full table scan:
 
  SELECT name FROM cities WHERE UPPER(name) = 'HOUSTON';
 
 
 
  I’d like to do something similar with MarkLogic which could help speed
 up, e.g. the following simple query (which currently prohibitively slow
 despite an index on /A/City):
 
 
 
  collection()/A/[upper-case( City ) = 'HOUSTON']
 
 
 
  upper-case() is only an example, I am looking for a solution that would
 accommodate any function/transformation that to be used in a query
 condition from an existing element.
 
 
 
  Clearly, one solution would be to pre-compute the derived field, add it
 to all the documents in the collection, and create an a “function index”).
 
 
 
  Thanks,
 
 
 
  image005.jpg
  image006.jpg
  Alexei Betin
 
  Principal Architect; Big Data
  P: (817) 928-1643 | Elevate.com
  4150 International Plaza, Suite 300
  Fort Worth, TX 76109
 
 
 
  Privileged and Confidential. This e-mail, and any attachments thereto,
 is intended only for use by the addressee(s) named herein and may contain
 privilegedthereto, is strictly prohibited.
 
 
 
 
 image005.jpgimage006.jpg___
  General mailing list
  General@developer.marklogic.com
  http://developer.marklogic.com/mailman/listinfo/general


 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Exact match in search:search implementation

2015-01-06 Thread David Ennis
HI.

Peter, you are correct in what was missing in the search.  However, you are
right in being confused about the search:qtext.

brace yourself..

Another query console gotcha...  Using 'auto' formats it as html and
removes the extra whitespace..  When viewed in raw format, your
search:report reflects the double space and verifies your solution:

Your example expanded to show search parse as well yields the following
(expected) whitespace when viewed in raw format:

xquery version 1.0-ml;
declare namespace host = http://marklogic.com/xdmp/status/host;;
import module namespace search = http://marklogic.com/appservices/search;
 at /MarkLogic/appservices/search/search.xqy;

let $options := options xmlns=http://marklogic.com/appservices/search;
  term
term-optioncase-sensitive/term-option
term-optiondiacritic-sensitive/term-option
term-optionpunctuation-sensitive/term-option
term-optionwhitespace-sensitive/term-option
term-optionunstemmed/term-option
term-optionunwildcarded/term-option
  /term
  debugtrue/debug
  search-optionfiltered/search-option
/options

return (
  search:search('Hello  world',$options),
  search:parse('Hello  world',$options)
)

search:response snippet-format=snippet total=0 start=1
page-length=10
xmlns:search=http://marklogic.com/appservices/search;
  search:qtextHello  world/search:qtext
  search:report id=SEARCH-FLWOR(cts:search(fn:collection(),
cts:word-query(Hello  world,
(case-sensitive,diacritic-sensitive,punctuation-sensitive,whitespace-sensitive,unstemmed,unwildcarded,lang=en),
1), (filtered,cts:score-order(descending)), 1))[1 to
10]/search:report
  search:metrics
search:query-resolution-timePT0.00387S/search:query-resolution-time
search:facet-resolution-timePT0.5S/search:facet-resolution-time
search:snippet-resolution-timePT0S/search:snippet-resolution-time
search:total-timePT0.018433S/search:total-time
  /search:metrics
/search:response
cts:word-query xmlns:cts=http://marklogic.com/cts;
  cts:text xml:lang=enHello  world/cts:text
  cts:optioncase-sensitive/cts:option
  cts:optiondiacritic-sensitive/cts:option
  cts:optionpunctuation-sensitive/cts:option
  cts:optionwhitespace-sensitive/cts:option
  cts:optionunstemmed/cts:option
  cts:optionunwildcarded/cts:option
/cts:word-query







Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 6 January 2015 at 10:06, Peter Kester peter.kes...@marklogic.com wrote:

   Hi Shruti,

  MarkLogic does what it is supposed to do. See below sample

  xquery version 1.0-ml;

  xdmp:document-insert(/foo.xml, fooHello  world/foo);
 xdmp:document-insert(/foo2.xml, fooHello world/foo);

  xquery version 1.0-ml;
 declare namespace host = http://marklogic.com/xdmp/status/host;;
 import module namespace search = http://marklogic.com/appservices/search;
  at /MarkLogic/appservices/search/search.xqy;

  let $options := options xmlns=http://marklogic.com/appservices/search;
   term
 term-optioncase-sensitive/term-option
 term-optiondiacritic-sensitive/term-option
 term-optionpunctuation-sensitive/term-option
 term-optionwhitespace-sensitive/term-option
 term-optionunstemmed/term-option
 term-optionunwildcarded/term-option
   /term
   debugtrue/debug
   search-optionfiltered/search-option
 /options

 return search:search('Hello  world',$options)

  This will give you:
 search:response snippet-format=snippet total=1 start=1 page-length
 =10 xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns=xmlns:search=
 http://marklogic.com/appservices/search;
  search:result index=1 uri=/foo.xml path=fn:doc(/foo.xml) score=
 47104 confidence=0.5532626 fitness=0.6769772
  search:snippet
  search:match path=fn:doc(/foo.xml)/foo
  search:highlight
  Hello world
  /search:highlight
  /search:match
  /search:snippet
  /search:result
  search:qtext
  Hello world
  /search:qtext
  search:report id=SEARCH-FLWOR
  (cts:search(fn:collection(), cts:word-query(Hello world,
 (case-sensitive,diacritic-sensitive,punctuation-sensitive,whitespace-sensitive,unstemmed,unwildcarded,lang=en),
 1), (filtered), 1))[1 to 10]
  /search:report
  search:metrics
  search:query-resolution-time
  PT0.004736S
  /search:query-resolution-time
  search:facet-resolution-time
  PT0.51S
  /search:facet-resolution-time
  search:snippet-resolution-time
  PT0.000603S
  /search:snippet-resolution-time
  search:total-time
  PT0.021619S
  /search:total-time
  /search:metrics

Re: [MarkLogic Dev General] Subject: query console locking up on xquery of large document and on looping through many smaller documents

2015-01-06 Thread David Ennis
HI.

A few things.  Regarding size, instead of splitting it, you also have the
options of fragment roots, for example.

However, regardless of single documents, multiple documents or a fragmented
document, your example is still iterating over all occurrences of your
'str' element.

By using indexes and MarkLogic's search capabilities, then you isolate the
fragments that match completely from indexes and do not end up iterating
over the entire document(s)



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 6 January 2015 at 19:51, Ray Bednar ray.bed...@gmail.com wrote:



 I have a marklogic database document that is  50 megs and my query below

  xquery version 1.0-ml;
 for $m in
 doc(/dlap/angel.bfwpub.com.xml)//response//results//result//doc//arr/str
  where fn:contains(fn:string-join(($m/text()), ), 
 http://angel.bfwpub.com;)
   return

 results  { $m/../../@entityid  }   {  $m/../../@itemid  }  {$m/../@name
 } {$m }/results

 kept returning with a pop up in the query console of a script on this page
 may be busy and would not process all the results until the browser froze
  completely.

 I wrote a utility to break the 50 meg xml document into 50 approximately 1
 meg documents.

 I gave the resulting documents the same file name with an interger
 appended starting at 0 up to 49.
 I created the following xquery with a function

 xquery version 1.0-ml;


  declare function local:stuff ($word as xs:int , $s as xs:string)
  {
   let $a := fn:concat(DLAP/angel.bfwpub.com, $word, .xml)
   for $m in doc($a)//doc//arr/str
  where fn:contains(fn:string-join(($m/text()), ), $s)
   return

 results  { $m/../../@entityid  }   {  $m/../../@itemid  }  {$m/../@name
 } {$m }/results

  };
  for $f in (0 to 49)  (: 49 :)
  return local:stuff($f,http://angel.bfwpub.com;)

 I got the same problem as before.  By breaking it down into chunks of 5
 e.g. for $f in (0 to 4)
 and capturing the results and then continuing with  for $f in (5 to 9)  I
 was able to get all the results that I needed.
 I have some other documents which are much larger so my manual process
 maybe too time consuming or error prone.  Does anyone have a better
 solution.  any information will be greatly appreciated.

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Inserting triples into a document

2014-12-26 Thread David Ennis
HI.

Yeah.  But I keep them tidy together inside andother element.

Here is a little example (run twice in query console to see the result).
Also, you don't necessarily need the subject to be the uri of the doc as
you can already isolate on fragments, but I do it so that I can use them in
sparql queries naturally.


xquery version 1.0-ml;
declare namespace html = http://www.w3.org/1999/xhtml;;

import module namespace sem = http://marklogic.com/semantics;
   at MarkLogic/semantics.xqy;


let $uri := /semantic-test/doc.xml
let $triple := sem:triple(sem:iri($uri), sem:iri(likes), tomatos)

let $update := if(fn:boolean(xdmp:document-properties($uri)//semantics))
  then xdmp:document-set-property($uri,
xdmp:node-insert-child(xdmp:document-properties($uri)//semantics,
xml{$triple}/xml/*))
  else xdmp:document-set-property($uri, semantics{$triple}/semantics)


return sem:sparql('
  select $s
  where {$s $p tomatos}
')



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 24 December 2014 at 23:12, Alex Jouravlev al...@businessabstraction.com
wrote:

 Hi David,



 Do you mean you use xdmp:document-set-properties and
 xdmp:document-add-properties?



 Thank you,



 Alex Jouravlev
 Director, Business Abstraction Pty Ltd
 Phone:   +61-(2)-8003-4830
 Mobile: +61-4-0408-3258
 Web: http://www.businessabstraction.com
 LinkedIn: http://au.linkedin.com/in/alexjouravlev/

 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *David Ennis
 *Sent:* Tuesday, 23 December 2014 8:12 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] Inserting triples into a document



 Hi.



 You can store them anywhere in a document or properties fragment as long
 as they are in sem:triples format.



 http://docs.marklogic.com/sem:triple



 Its just an XML element of a certain namespace that causes it to be
 indexed as a triple.



 Example somewhere in your XML:

 sem:triple xmlns:sem=http://marklogic.com/semantics;

   sem:subjectsubject/sem:subject

   sem:predicatepredicate/sem:predicate

   sem:object

datatype=http://www.w3.org/2001/XMLSchema#string;object/sem:object

 /sem:triple



 I like to store them in properties fragments as I find it a bit tidy.



 Kind Regards,

 David Ennis






 Kind Regards,

 David Ennis





 *David Ennis*
 *Content Engineer*

 [image: HintTech]  http://www.hinttech.com/
 Mastering the value of content
 creative | technology | content

 Delftechpark 37i
 2628 XJ Delft
 The Netherlands
 T: +31 88 268 25 00
 M: +31 63 091 72 80

 [image: http://www.hinttech.com] http://www.hinttech.com
 https://twitter.com/HintTech  http://www.facebook.com/HintTech
 http://www.linkedin.com/company/HintTech



 On 23 December 2014 at 08:12, Alex Jouravlev 
 al...@businessabstraction.com wrote:

 Hi,



 Is it possible to insert triples into a given document? It doesn’t look
 like sem:rdf-insert does that. However some case studies suggest adding
 triples tro documents.



 Thanks



 Alex Jouravlev
 Mobile: +61-4-0408-3258
 LinkedIn: http://au.linkedin.com/in/alexjouravlev/




 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Inserting triples into a document

2014-12-23 Thread David Ennis
Hi.

You can store them anywhere in a document or properties fragment as long as
they are in sem:triples format.

http://docs.marklogic.com/sem:triple

Its just an XML element of a certain namespace that causes it to be indexed
as a triple.

Example somewhere in your XML:

sem:triple xmlns:sem=http://marklogic.com/semantics;
  sem:subjectsubject/sem:subject
  sem:predicatepredicate/sem:predicate
  sem:object
   datatype=http://www.w3.org/2001/XMLSchema#string;object/sem:object
/sem:triple


I like to store them in properties fragments as I find it a bit tidy.

Kind Regards,
David Ennis



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 23 December 2014 at 08:12, Alex Jouravlev al...@businessabstraction.com
wrote:

 Hi,



 Is it possible to insert triples into a given document? It doesn’t look
 like sem:rdf-insert does that. However some case studies suggest adding
 triples tro documents.



 Thanks



 Alex Jouravlev
 Mobile: +61-4-0408-3258
 LinkedIn: http://au.linkedin.com/in/alexjouravlev/



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Removing emailid from DL

2014-12-23 Thread David Ennis
PLease see the bottom of the email message - there is a link to
manage/remove yourself.



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 23 December 2014 at 10:14, sridhar.krish...@cognizant.com wrote:

  Can you please remove my email id sridhar.krish...@cognizant.com from
 the MarkLogic Developer Distribution List. else please let me now how can I
 get it removed.



 Thanks  Regards

 Sridhar

 US HOTLINE +1-973-776-3120: Ext: 415963 | Land Line: +91 0422 4625963 |

 VNET: 415963 | Mobile: +91 - 9940061552|sridhar.krish...@cognizant.com
 |

 Cognizant Technology Solutions | Coimbatore | Tamil Nadu | INDIA - 641035
  |


  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.

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] document insert inside a cpf module

2014-12-08 Thread David Ennis
HI.

Not sure how you are ingesting them, but perhaps you are seeing the same
hiccup that is described in this nice little writeup:


http://blog.davidcassel.net/2011/06/splitting-data-with-info-studio/





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 8 December 2014 at 14:29, diwakar.narayanasw...@wipro.com wrote:

  Hi,

 After ingesting a document(book), a pipeline executes an action
 module. The action module splits the document into chapters and ingest the
 chapters into MarkLogic one by one.


  Every thing is working fine, except the chapters are not getting
 ingested using xdmp:document-insert.

 Cant i use it here?


  Thanks,

 Diwakar N

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Marklogic times out in insertion of 20000 documents for Scenario2

2014-11-27 Thread David Ennis
HI.

Regarding number 4 in scenario 2: It is my understanding that installing
CPF - regardless of what pipelines are configured - causes overhead. If
nothing else, there are about 6 triggers installed (which a subset get run
on the insert).

Kind Regards,
David Ennis



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 27 November 2014 at 12:28, Rahul Gupta rahul.gu...@nagarro.com wrote:

  Can you please let me know why Marklogic times out in mentioned
 Scenario2 whereas it quickly performs Scenario1?



 *Scenario1: *

 1)  Create a new database.

 2)  Insert 2 documents in this database through QConsole using
 the following code.

 for $i in (1 to 2)

 let $uri := fn:concat(“/xml”, $i, “.xml”)

 let $document := element{fn:concat(“cpf_”, $i)} {$i}

 return

 xdmp:document-insert($uri, $document, xdmp:default-permissions(),
 “collections”)

 *3)  **It takes time 4-9 seconds on ML 7.0-4.1 for DUAl CORE
 Processor with 1 forest attached only.*



 *Scenario2:*

 1)  Install Cpf over this database and don’t mention any action on
 initial state. Rather give some action on any user-defined state.

 2)  Run the same code again.

 3)  All the documents inserted will go to initial state without any
 invoking of any action.

 *4)  **My understanding says installing cpf without any action being
 performed on initial state should give us same performance as Scenario 1
 which is not the case.*

 5)  It is very long time taking query which even times out. *Tested
 with 12000 and it takes 19 minutes.*





 Thanks,

 Rahul Gupta



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] request-time in xdmp:server-status output

2014-11-21 Thread David Ennis
HI.

The request time is returned in milliseconds.  I believe that the statement
just means that  it's a 1-minute rolling average (averaging the time of all
requests int he last minute).

*I further confirmed this the following way:*
- The Admin interface on port 8001 shows miliseconds as the unit
- Since the Admin interface is just like any other HTTP app server, I just
checked the source xqy and noted that the value(in ms) is also coming from
xdmp:server-status.

Kind Regards,
David Ennis





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 21 November 2014 08:35, Will Hawes wdha...@gmail.com wrote:

 http://docs.marklogic.com/xdmp:server-status states the following:

 request-time
 1 minute avarage of request time for this server.

 I expected this to be measured in seconds, but I'm seeing values in
 the range 4-5, where load testing shows requests taking an average of
 a few hundred milliseconds.

 Is request-time actually showing hundreds of milliseconds? How is it
 calculated?

 Thanks,
 Will
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Proxy server to access

2014-11-18 Thread David Ennis
HI.

I believe you can still specify a proxy url at the start of your url.

Have a look at the solution in this post:
https://www.mail-archive.com/general@developer.marklogic.com/msg07976.html


Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 18 November 2014 11:43, Lee Li Bin libin@xedge.com.sg wrote:

 Hi,



 Currently my application requires to go through the Proxy server to access
 the internet for federation search, we have issue connecting to internet
 with below XQUERY, is there any issue with the below code?

 let $url := 
 http://www.hklii.hk/cgi-bin/sinosrch.cgi?results=200;query=test;;



let $result := xdmp:http-get($url,

options xmlns=xdmp:document-get

 formatbinary/format

/options)[2]





 Regards,

 Li Bin



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] how to load content available in sub directories

2014-11-18 Thread David Ennis
HI.

If using MLCP - If -input_file_path names a directory, mlcp loads all the
documents in the input directory **and subdirectories by default**. Use the
-input_file_pattern option to filter the loaded documents based on a
regular expression.

This is likely the relevant part of the documentation that you may need:

https://docs.marklogic.com/guide/ingestion/content-pump#id_28344





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 18 November 2014 15:36, Arvind Kumar akmishra...@gmail.com wrote:

 Hi Abhinav,

 Thanks for information!

 Is this recursive in nature. Actually I have content with in
 sub-directories where i have requirement that it should load the all the
 xml files present in hierarchical sub-folder within root folder.

 Is there anything that need to be configure in MLCP while ingestion.

 Thanks and Regards,
 Arvind Kr.








 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] UDP?

2014-11-04 Thread David Ennis
HI.

If you do not find a solution within xQuery, a possible alternative would
be to write a UDP bridge as a small python service, perhaps.



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 4 November 2014 11:27, Whitby, Rob rob.whi...@springer.com wrote:

  Is it possible to send a UDP message from xquery?

  unsupported/non-documented is ok :)

  Cheers
 Rob

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] What's a best approach to search unstructured docs for numbers Greater Than N?

2014-10-29 Thread David Ennis
HI.

Related to Justin's approach:

1) I would start this by using a field with a path defined (and appropriate
indexes).
This would allow you to more easily tune where you look for the values over
time by adding more xpath expressions and using the exclude options.   But
see below - and the reason Justin was likely showing xPath expressions that
match elements that are values that can be cast properly.

2) However, I believe that anything related to indexes still requires that
the element you index do not have mixed content.  So, the generic approach
above without tuning to target elements that you know can be cast into the
correct datatype (integer, decimal, etc) will result in errors like this:
*Invalid cast: xs:untypedAtomic(250 9996.26426957374 Public Law 2012-02-14
Redesignates the Noxu...) cast as xs:integer*
So, if you really need to look in *each and every element of mixed content*
and want to get this via an index, I have a few suggestions:

1) Transform the documents and add the decimal value as an attribute.  This
is a relatively trivial recursive function that tests if an element's value
can be cast as a number and then adds the value as an attribute.  The test
(taken from FunxtX)is simply *string(number($value)) != 'NaN'*.

Your transformed document might look like this:
doc
  prices
beginningBalance *decimal-value='250'*250/beginningBalance
endingBalance *decimal-value='9996.26426957374'*
9996.26426957374/endingBalance
  /prices
  summary
summary-asPublic Law/summary-as
summary-date2012-02-14/summary-date
summary-textRedesignates the Noxubee National Wildlife
Refuge./summary-text
  /summary
  bankCharge* decimal-value='**1500.75'*1500.75/bankCharge
/doc

Then you only need to index the attribute decimal-value. And this attribute
would only exist for values that are truly interesting.

OR 2) Don't want to alter your document - store these values in the
properties fragment:
Example in properties and then index the decimal-values element(s):
*interesting-values*
*  decimal-value250**/decimal-value*
*  decimal-value9996.26426957374**/decimal-value*
*  decimal-value**1500.75**/decimal-value*
*/**interesting**-values*

for this option, it is also possible to store the original path if you
really need to keep the context of the numbers.  I would store this and any
other interesting information as attributes of the decimal-value elements:
*decimal-value xpath='/doc/prices/endingBalance**'
original-element-name='endingBalance'**9996.26426957374**/decimal-value*

This last format truly gives you flexability when mixed with the power of
fields as you can start to target and prioritize specific elements if
needed.



Kind Regards,
David Ennis





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 29 October 2014 00:15, Gary Russo garyru...@hotmail.com wrote:

 I have a database that consists of highly unstructured documents. The
 documents contain pricing data.



 My requirement is to search all nodes of every document to find a number
 that is greater than 1,000.



 The element names containing the numbers can be anything.



 Example Docs:



 *Doc 1*



 doc
   prices
 beginningBalance250/beginningBalance
 endingBalance9996.26426957374/endingBalance
   /prices
   summary
 summary-asPublic Law/summary-as
 summary-date2012-02-14/summary-date
 summary-textRedesignates the Noxubee National Wildlife Refuge.
 /summary-text
   /summary
   bankCharge1500.75/bankCharge
 /doc



 *Doc 2*



 doc
   cost
 startBalance250/startBalance
 endBalance9996.26426957374/endBalance
   /cost
   summary
 summary-asPublic Law/summary-as
 summary-date2012-02-14/summary-date
   /summary
   bankFee1500.75/bankFee
 /doc



 I can use a brute force XQuery code snippet like the following but I’d
 like to use the universal index.



 What is the recommended approach for something like this?





 *Brute Force XQuery:*



 let $values :=

   for $n in $doc1//node()/*/text()

 let $value := try { xs:float($n) } catch ($e) { () }

 where $value gt 1000

   return

 $value|| | ||xdmp:path($n)

 return $values









 *Gary Russo*

 *Enterprise NoSQL Developer*

 *http://garyrusso.wordpress.com http://garyrusso.wordpress.com*



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Diacritic-insensitive collation ignored

2014-10-28 Thread David Ennis
HI.

This is interesting and something I'm going to play around with.

However, the issue is probably a somewhat logical explanation when you
consider that there is no guaranteed order of execution in a FLWOR
statement - I believe.

- in the extract-metadata solution, the data you want exists before you
start to iterate over the results.

- in the FLWOR expression, there is much more involved in the possible
order of the results based on what you are doing in the expression - unless
you also explicitly add an order by statement. The crazy complexity of this
can be previewed here:  http://www.w3.org/TR/xquery/#id-orderby-return

- So, once you start doing things in the FLWOR expression such as variable
assignment and function calls and do not specifically include an order-by
statement, then all bets are off as to the final order.

Kind Regards,
David Ennis



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 28 October 2014 19:36, Hasegawa, Margarete margarete.haseg...@ptsem.edu
wrote:

  That's very interesting. I dropped the flwor and used extract-metadata
 to get the titles instead and the order of the results returned is
 different. What is it about the two different methods (flwor vs.
 extract-metadata) that causes the order to change?

  Thanks,
 Maggie

   From: Dave Cassel dave.cas...@marklogic.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Tuesday, October 28, 2014 2:05 PM
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: Re: [MarkLogic Dev General] Diacritic-insensitive collation
 ignored

Not sure, but perhaps running a flwor on the results of search:search
 is affecting the ordering. From the snippet you've shown, it looks like
 you're looping through to get the titles, which you could also do using
 extract-metadata
 http://docs.marklogic.com/guide/rest-dev/appendixb#id_94425. If you
 drop the FLWOR and just look at the results from search:search, do you get
 the order you expect?

  --
 Dave Cassel
 Developer Community Manager
 MarkLogic Corporation http://www.marklogic.com/
 Cell:  +1-484-798-8720


   From: Hasegawa, Margarete margarete.haseg...@ptsem.edu
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Tuesday, October 28, 2014 at 1:34 PM
 To: general@developer.marklogic.com general@developer.marklogic.com
 Subject: [MarkLogic Dev General] Diacritic-insensitive collation ignored

   Hi,

  I'm working on an application that uses the Search API and I am trying
 to set the collation on an element range index to be diacritic insensitive.
 However, the same results are returned in the same order regardless of the
 collation that I use. We are using Marklogic 7. Has anyone encountered a
 similar problem before? If so, any thoughts on how to solve it?

  Thanks,
 Maggie

  Here is the simplified version of the search:

  declare variable $options :=
   options xmlns=http://marklogic.com/appservices/search;
   constraint name=title
   word
 element ns=http://digital.library.ptsem.edu/ia; name=title/
   /word
 /constraint
 transform-results apply=empty-snippet/
 operator name=sort
  state name=title
sort-order xmlns=http://marklogic.com/appservices/search;
 type=xs:string
 element ns=http://digital.library.ptsem.edu/ia;
 name=sortTitle collation=http://marklogic.com/collation/en/S1/AS/T0020;
 /
/sort-order
  /state
 /operator
   /options;
 let $response:= search:search(title:Viage literario, $options, 1, 500)
 let $total := $response/@total
 for $result in $response/search:result
 let $uri := $result/@uri
 let $doc := fn:doc($uri)
 let $title := $doc/ia:doc/ia:metadata/ia:sortTitle
 let $vol := $doc/ia:doc/ia:metadata/ia:volumeInfo/ia:volume
 Return fn:string($title)

  Here are the results that I am seeing:

Viage literario á iglesias de España
  Viage literario á iglesias de España
  Viage literario á iglesias de España
  Viage literario á iglesias de España
  Viage literario a las iglesias de Espana
  Viage literario á iglesias de España
  Viage literario a las iglesias de Espana
  Viage literario á iglesias de España
  Viage literario á iglesias de España : Le Publica con algunas
 observaciones
  Viage literario á iglesias de España
  Viage literario a las iglesias de Espana
  Viage literario á iglesias de España
  Viage literario a las iglesias de Espana
  Viage literario a las iglesias de Espana
  Viage literario a las iglesias de Espana
  Viage literario a las iglesias de Espana
  Viage literario a las iglesias de Espana

Re: [MarkLogic Dev General] Creating REST END Points

2014-10-27 Thread David Ennis
HI.

This might be a good starting point:

http://developer.marklogic.com/try/rest/index

and

http://docs.marklogic.com/guide/rest-dev

But then again, it depends on how/what you are maintaining.  If it's an
existing system that was developed pre-Marklogic 6 that you are now
maintaining, then things are likely implemented differently.




Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 27 October 2014 12:23, Ashutosh Trivedi ashutosh.triv...@nagarro.com
wrote:

  Hi,



 I am new in MarkLogic and I have a requirement to create and handle the
 REST End Points in MarkLogic Server Manually.

 If anyone has handle it please provide the step.





 Thanks

 Ashutosh Trivedi

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] using xdmp:eval in REST Service

2014-10-17 Thread David Ennis
HI Pragya.

I did not supply you with the exact issue as I did not try to install and
run all 900 lines of code.  INstead, I looked at items that seemed suspect
for you to log and verify what is happening with the data between the
rewriter and the invoker.  I am still not convinced that you have the XML
you expect at the very early stages. IN fact, I'm not convinced that you
ever retrieve it from the start and even once you do, I still believe you
need to use xdmp:unquote. That's why I suggested you look in those two sets
of code (qualifying this suggestion by experience and not having actually
found your issue exactly.).

But now that there is a log related to some code, lets walk through this:
[as provided by you today]


I tried logging in invoker:
let $_populate-map := for $each-param in $urlParams
let $param-value :=
xdmp:get-request-field($each-param)
 let $_ :=
xdmp:log(fn:concat($param-value,$param-value))
...
logs:

2014-10-17 11:16:29.008 Info: rest-ingestion:
module-invoker.xqy?format=xmlmoduleName=add-documentrequestDirectory=addapiVersion=v1

2014-10-17 11:16:29.013 Info: rest-ingestion: $param-value*xml*

2014-10-17 11:16:29.013 Info: rest-ingestion: $param-valueadd-document

2014-10-17 11:16:29.013 Info: rest-ingestion: $param-valueadd

2014-10-17 11:16:29.013 Info: rest-ingestion: $param-valuev1

2014-10-17 11:16:29.013 Info: rest-ingestion:
$param-value39932186-9cab-44e9-8f4f-7ebf45dabf8f

2014-10-17 11:16:29.309 Info: rest-ingestion: Ingestion Service End
Point add-document.xqy  39932186-9cab-44e9-8f4f-7ebf45dabf8f

2014-10-17 11:16:29.309 Info: rest-ingestion:
Path/processing/39932186-9cab-44e9-8f4f-7ebf45dabf8f/validDocs/

2014-10-17 11:16:29.309 Info: rest-ingestion:
uri/docs/BONY_4076_REPO-GMR-2000.xml

So its xml at this stage.



1) Lets look at the log:
The first thing I note is that you state that you do have XML and you made
bold a line above.  I believe you are being mislead by showing
$param-value instead of the actual name of the parameter.  From what I
see, the *XML *that you made bold is nothing more than the value of the
FORMAT parameter from your query string and not at all related to your XML
content you are looking for. You can verify this with a cleaner log line
and see what request field name is matching the value.

2) OK.. The where IS the content? Lets go back to an earlier message:
You POST the data.
So, now we have to think about how MarkLogic handles the body of a POST
(not something for you to control in your code, but by the REQUEST header:
- IF and only IF the request header*
content-type: application/x-www-form-urlencoded* was present in the
request, then the content of the request body is available via
xdmp:get-request field()
- Otherwise: The content is still stuck in the body and needs to be
retrieved via xdmp:get-request-body()

So, since you use POST, you also have to go back and verify if you are
forcing the content-type: application/x-www-form-urlencoded header.  Only
then will you know where to troubleshoot further (because then you will
know where your content is actually available)

---

I hope this helps.

Kind Regards,
David Ennis



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 17 October 2014 07:50, Kapoor, Pragya pkapo...@innodata.com wrote:

  Hi David,


  I tried logging in invoker:
  let $_populate-map := for $each-param in $urlParams
 let $param-value :=
 xdmp:get-request-field($each-param)
  let $_ :=
 xdmp:log(fn:concat($param-value,$param-value))
 ...
  logs:

 2014-10-17 11:16:29.008 Info: rest-ingestion: 
 module-invoker.xqy?format=xmlmoduleName=add-documentrequestDirectory=addapiVersion=v1
 2014-10-17 11:16:29.013 Info: rest-ingestion: $param-value*xml*
 2014-10-17 11:16:29.013 Info: rest-ingestion: $param-valueadd-document
 2014-10-17 11:16:29.013 Info: rest-ingestion: $param-valueadd
 2014-10-17 11:16:29.013 Info: rest-ingestion: $param-valuev1
 2014-10-17 11:16:29.013 Info: rest-ingestion: 
 $param-value39932186-9cab-44e9-8f4f-7ebf45dabf8f
 2014-10-17 11:16:29.309 Info: rest-ingestion: Ingestion Service End Point 
 add-document.xqy  39932186-9cab-44e9-8f4f-7ebf45dabf8f
 2014-10-17 11:16:29.309 Info: rest-ingestion: 
 Path/processing/39932186-9cab-44e9-8f4f-7ebf45dabf8f/validDocs/
 2014-10-17 11:16:29.309 Info: rest-ingestion: 
 uri/docs/BONY_4076_REPO-GMR-2000.xml

 So its xml at this stage.

  At rewriter:


   case element(POST)
 return

Re: [MarkLogic Dev General] using xdmp:eval in REST Service

2014-10-16 Thread David Ennis
HI.

I Know that this does not answer the whole question - but since things are
getting serialized, have you tried xdmp:unquote on the serialized XML (the
$contents variable in the original example)?

Kind Regards,
David Ennis




On 16 October 2014 06:44, Kapoor, Pragya pkapo...@innodata.com wrote:

  Hi,


  I am using Postman Rest Client to call this service. I am using POST
 method and sending parameters in form-data.

 URL: http://{hostname}:8010/v1/addDocument
 http://10.190.57.71:8010/v1/addDocument


  ML Version: 7.0-2.3​


  I tried using xdmp:invoke instead of xdmp:eval but still the xml is
 getting serialized.


  Attached is the code I am using.


  Thanks

 Pragya
  --
 *From:* general-boun...@developer.marklogic.com 
 general-boun...@developer.marklogic.com on behalf of David Lee 
 david@marklogic.com
 *Sent:* Wednesday, October 15, 2014 5:26 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] using xdmp:eval in REST Service


 Could you show your code for how you run this via the REST interface ?

 Which version of ML, and what method of accessing REST ?



 One thing that stands out is the use of Eval ... this can get tricky when
 embedding in other code because of the multiple layer of string escaping
 needed ...

 You also don’t need the functx import inside the eval but that’s a
 different issue.

 Instead of xdmp:eval I prefer xdmp:invoke-function(

 http://docs.marklogic.com/xdmp:invoke-function



 This simplifies (eliminates) the need to construct XQuery from strings (so
 its safer from XQuery injection and less likely to be corrupted when
 created from

 other code.



 Your example could then become:



 let $DirectoryListing :=

  xdmp:invoke-function(

  function() {

   xdmp:directory($Path)

  } ,

  options xmlns=xdmp:eval

database{xdmp:database(Ingestion)}/database

  /options

 )



 With no need to pass in external parameters or add delcarations in the
 body or quote things.

 Try this first - ...  it’s a good trick to learn to write easier and safer
 code.



 But I suspect your real problem is something else - we need to see the
 code your running from REST



 The only xdmp:log() I see is for the docURI

xdmp:log(fn:concat(uri,$docUri))



 So the code your showing us isnt likely the actual code your running.



 Could you provide the code your running ?

 What library or language you using to call the REST APIS's ?

 What your showing looks like the results are being serialized as text
 before you get them into

 let $DirectoryListing :=








 -

 David Lee
 Lead Engineer
 *Mark**Logic* Corporation
 d...@marklogic.com
 Phone: +1 812-482-5224

 Cell:  +1 812-630-7622
 www.marklogic.com



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Kapoor, Pragya
 *Sent:* Wednesday, October 15, 2014 3:59 AM
 *To:* general@developer.marklogic.com
 *Subject:* [MarkLogic Dev General] using xdmp:eval in REST Service



 Hi,



 I need to pick the all the docs in directory path ($Path) from Ingestion
 DB and insert them in Db which is configured for rest
 services(rest-ingestion).



 The below code works fine from Qconsole, but from Rest service , the xml
 being picked from the Ingestion DB is not coming as xml when the code is
 hit from Rest service. In logs, only content is theres, xml elements are
 missing.(attached are the logs)



 Please let me know, what I am missing in this code.



 Thanks

 Pragya



 Code:



 import module namespace dls = http://marklogic.com/xdmp/dls;

   at /MarkLogic/dls.xqy;



 import module namespace functx = http://www.functx.com;

 at /MarkLogic/functx/functx-1.0-nodoc-2007-01.xqy;



 let $transId := '39932186-9cab-44e9-8f4f-7ebf45dabf8f'

 let $PrefixURI := /docs/



 let $Path := fn:concat('/processing/', $transId,'/validDocs/')

 let $DirectoryListing :=

 xdmp:eval('

  import module namespace functx = 
 http://www.functx.com;

 at
 /MarkLogic/functx/functx-1.0-nodoc-2007-01.xqy;

  declare variable $Path as xs:string external;



   xdmp:directory($Path)

  '

  ,

  (xs:QName(Path), $Path)

  ,

  options xmlns=xdmp:eval


  database{xdmp:database(Ingestion)}/database

  /options

 )

 for $FileEntry in $DirectoryListing

 let $Filename :=
 functx:substring-after-last(xdmp:node-uri($FileEntry),'/')

 let

Re: [MarkLogic Dev General] using xdmp:eval in REST Service

2014-10-16 Thread David Ennis
HI.

Yes, I had a look.  The first reason I thought of the xdmp:unquote was
because of the multipart form post. We have a system where we get XML
packed inside of json in the body of a post and use xdmp:unquote and this
seemed similiar.

I concluded that this might have been similiar looking at your code

*rewriter:*
...
 case element(POST)
return
let $urlParams := let $paramNames:=
xdmp:get-request-field-names()
  for $eachParam in
$paramNames
  let $paramValue
:= xdmp:get-request-field($eachParam)


*INvoker:*
...

  let $_populate-map := for $each-param in $urlParams
let $param-value :=
xdmp:get-request-field($each-param) - Still not XML at this stage, I
would assume
...

Kind Regards,
David



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 16 October 2014 13:15, Kapoor, Pragya pkapo...@innodata.com wrote:

  Hi,


  Yes, I tried using xdmp:unquote on $contents but still not working.

 Did you get a chance to look into the code which I attached in previous
 mail?

 ​

 Thanks

 Pragya
  --
 *From:* general-boun...@developer.marklogic.com 
 general-boun...@developer.marklogic.com on behalf of David Ennis 
 david.en...@hinttech.com
 *Sent:* Thursday, October 16, 2014 2:41 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] using xdmp:eval in REST Service

   HI.

 I Know that this does not answer the whole question - but since things are
 getting serialized, have you tried xdmp:unquote on the serialized XML (the
 $contents variable in the original example)?

 Kind Regards,
 David Ennis




 On 16 October 2014 06:44, Kapoor, Pragya pkapo...@innodata.com wrote:

  Hi,


  I am using Postman Rest Client to call this service. I am using POST
 method and sending parameters in form-data.

 URL: http://{hostname}:8010/v1/addDocument
 http://10.190.57.71:8010/v1/addDocument


  ML Version: 7.0-2.3​


  I tried using xdmp:invoke instead of xdmp:eval but still the xml is
 getting serialized.


  Attached is the code I am using.


  Thanks

 Pragya
  --
 *From:* general-boun...@developer.marklogic.com 
 general-boun...@developer.marklogic.com on behalf of David Lee 
 david@marklogic.com
 *Sent:* Wednesday, October 15, 2014 5:26 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] using xdmp:eval in REST Service


 Could you show your code for how you run this via the REST interface ?

 Which version of ML, and what method of accessing REST ?



 One thing that stands out is the use of Eval ... this can get tricky when
 embedding in other code because of the multiple layer of string escaping
 needed ...

 You also don’t need the functx import inside the eval but that’s a
 different issue.

 Instead of xdmp:eval I prefer xdmp:invoke-function(

 http://docs.marklogic.com/xdmp:invoke-function



 This simplifies (eliminates) the need to construct XQuery from strings
 (so its safer from XQuery injection and less likely to be corrupted when
 created from

 other code.



 Your example could then become:



 let $DirectoryListing :=

  xdmp:invoke-function(

  function() {

   xdmp:directory($Path)

  } ,

  options xmlns=xdmp:eval

database{xdmp:database(Ingestion)}/database

  /options

 )



 With no need to pass in external parameters or add delcarations in the
 body or quote things.

 Try this first - ...  it’s a good trick to learn to write easier and
 safer code.



 But I suspect your real problem is something else - we need to see the
 code your running from REST



 The only xdmp:log() I see is for the docURI

xdmp:log(fn:concat(uri,$docUri))



 So the code your showing us isnt likely the actual code your running.



 Could you provide the code your running ?

 What library or language you using to call the REST APIS's ?

 What your showing looks like the results are being serialized as text
 before you get them into

 let $DirectoryListing :=








 -

 David Lee
 Lead Engineer
 *Mark**Logic* Corporation
 d...@marklogic.com
 Phone: +1 812-482-5224

 Cell:  +1 812-630-7622
 www.marklogic.com



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com

Re: [MarkLogic Dev General] Is there a way to extract worksheet metadata from an Excel 97/2003?

2014-10-16 Thread David Ennis
HI.

I believe that with the conversion licence, you can do what you want
with: xdmp:excel-convert

Barring that, you could always run openoffice as a headless server for
conversion purposes.

Kind Regards,
David Ennis





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 16 October 2014 20:00, Gary Russo garyru...@hotmail.com wrote:

 I need to extract worksheet metadata called “defined name” from Excel
 97/2003 formatted spreadsheets.



 The ISYS xdmp:document-filter() API is limiting because it only extracts
 the text.



 It does not extract any worksheet metadata.



 Does anyone know of a workaround for this?



 My only thought is to upload the “Excel 97/2003” xls file and then convert
 it on the server to an “Excel 2010” xlsx format.



 Once it’s in an Excel 2010 format, I can easily extract the “defined name”
 metadata.



 This is what it looks like in “Excel 2010” files.



   definedNames
 definedName name=LastYrRevenue!$B$6:$B$15/definedName
 definedName name=ThisYrRevenue!$C$6:$C$15/definedName
 definedName name=VarianceRevenue!$D$6:$D$15/definedName
   /definedNames





 Thanks,

 Gary Russo





 *Gary Russo*

 *Enterprise NoSQL Developer*

 *Phone: 212-404-8639 212-404-8639*

 *Skype: garyprusso*

 *http://garyrusso.wordpress.com http://garyrusso.wordpress.com*



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] xdmp:output serialization options not working?

2014-10-14 Thread David Ennis
HI.

To clarify:  MarkLogic does not preserve your indentention, nor does it
guarantee that the document is the exact same upon return.  Yes, the same
content, but normalized as in the return document is actually assembled for
you.  Your document is ripped to bits and stored internally ina  different
format.

As an example(query console):
Insert this:
​​
doc
 line foo='bar' one=2line 1/line
lineline2/line
/doc

The query it:
doc
line foo=bar one=2line 1/line
lineline2/line
/doc

So, nice and pretty - but not actually 'preserved' from my input (notice
the indentation is more consistent and also note that the use of single
quotes was changed to double quotes).


The pretty return that you see is actually done in the query console code.

You can replicate this in your own code by setting the following:
declare option xdmp:output indent=yes;
declare option xdmp:output indent-untyped=yes;

More information about this can be found here:


http://developer.marklogic.com/blog/controlling-output-options



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 14 October 2014 21:56, David Sewell dsew...@virginia.edu wrote:

 Let me restate the problem.

 If I use an editor to manually create this XML document and save it to
 MarkLogic
 via WebDav or other means:

 ?xml version=1.0 encoding=UTF-8?
 doc
lineline 1/line
lineline2/line
 /doc

 then when I subsequently open that document from the database via WebDav
 or a
 doc() call, it arrives with its indentation preserved. I want to know how
 to
 generate a new file via XQuery such that it will have indentation when
 subsquently opened via WebDav or a doc() call.

 (It's not mission-critical, but I'm auto-generating a 50MB data file that I
 would like to be able to open in oXygen via WebDav with its elements
 already
 indented, since thing go much faster that way.)

 DAvid

 On Tue, 14 Oct 2014, Mary Holstege wrote:

  On Tue, 14 Oct 2014 12:28:52 -0700, David Sewell dsew...@virginia.edu
  wrote:
 
  Given this code:
 
  xquery version 1.0-ml;
  declare option xdmp:output indent-untyped=yes;
  declare option xdmp:output omit-xml-declaration=yes;
  xdmp:document-insert(
 /test.xml,
 doc
   lineline 1/line
   lineline2/line
 /doc
  ) ;
 
  doc(/test.xml)
 
  The output I'm getting is
 
  ?xml version=1.0 encoding=UTF-8?
  doclineline 1/linelineline2/line/doc
 
  which is disobeying both serialization optinons I specified. ML version
  7.0-4.
  Are other people seeing this? Am I missing something?
 
  David
 
 
 
  Two things:
  (1) If you are running this in QConsole all bets are off, because the
  serialization
  options apply in the query that does the serialization and everything in
  QConsole
  is run in a separate eval.
 
  (2) The serialization options are before the semi-colon, that is, they
  only apply to
  the xdmp:document-insert part of this file. If you want them to apply to
  the
  serialization of doc(/test.xml) you need to put them into that query.
 
  //Mary
  ___
  General mailing list
  General@developer.marklogic.com
  http://developer.marklogic.com/mailman/listinfo/general
 

 --
 David Sewell, Editorial and Technical Manager
 ROTUNDA, The University of Virginia Press
 PO Box 400314, Charlottesville, VA 22904-4314 USA
 Email: dsew...@virginia.edu   Tel: +1 434 924 9973
 Web: http://rotunda.upress.virginia.edu/
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] cts:element-range-query for months in a date

2014-10-10 Thread David Ennis
I would suggest that you pre-process your documents to include an attribute
of the xs:gMonth datatype (just the month digits) and add a range index on
this.

The the query is absolutely specific:  *cts:element-attribute-query([your
attribute], , 10)*



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 10 October 2014 18:08, Danny Sinang d.sin...@gmail.com wrote:

 We have a publicationDate element in the form -MM-DD.

 How do I issue a cts:element-range-query against it to list all documents
 whose publicationDate month is greater than 10 ?



 Regards,
 Danny





 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] dls library

2014-10-07 Thread David Ennis
HI Shruti.

I understand that you use a separate layer for 'authentication' for your
app - but it still stands that you are using DLS - which is meant to have a
separate *MarkLogic* user per DLS user.

How you authenticate and how you use users need not be the same thing
Some examples:
1) MarkLogic users 'authenticated' against LDAP
2) switching users in your application logic when set to application level
authentication)
Neither of these authenticate using MarkLogic internals (well,LDAP is
actually through the internal system, but authenticates externally) - yet
they can take advantage of the awesome features available via internal
users(groups/policies/extensions(such as DLS)

Lets see if some others can reply and shed some more light on this for you
as well.

Kind Regards,
David Ennis





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 6 October 2014 12:27, shruti kapoor shrutikapoor@gmail.com wrote:

 Hi David,

 In my application, there are multiple modules like Rsuite, Marklogic which
 are connected by REST end points. There is separate layer for
 authentication so we donot require multiple users on Marklogic level. But
 multiple users need to use multiple versions of same documents that are
 stored in Marklogic.

 On Mon, Oct 6, 2014 at 12:52 PM, David Ennis david.en...@hinttech.com
 wrote:

 HI.

 The DLS library works on MarkLogic User IDs (in fact, the user id must
 match a user from the system (http://marklogic.com/xdmp/security
 namespace on the userid element is returned in all cases).

 If you are not using individual users and need to use DLS, then perhaps
 you need to re-think:
 1)  Do I need DLS or can I accomplish my needs with business logic.
 2) Can I use real MarkLogic users in my application?  (you can switch
 users by dynamically logging them in, for instance)

 Short of changing either of the above(which I suggest you opt for 2
 above), I see one possible ugly 'hack':  When checking out a document, you
 have the ability to log arbitrary data in the annotation field.  You could
 use this for further tracking.. Another hybrid approach could be using
 collections to assist in understanding which virtual user 'has the
 document' (is it checked out and part of MY collection). But then again, if
 you are adding such logic, you are likely getting away from the core use of
 DLS and I would still suggest 1 or 2 above.



 Kind Regards,
 David Ennis


 David Ennis
 *Content Engineer*

 [image: HintTech]  http://www.hinttech.com/
 Mastering the value of content
 creative | technology | content

 Delftechpark 37i
 2628 XJ Delft
 The Netherlands
 T: +31 88 268 25 00
 M: +31 63 091 72 80

 [image: http://www.hinttech.com] http://www.hinttech.com
 https://twitter.com/HintTech  http://www.facebook.com/HintTech
 http://www.linkedin.com/company/HintTech

 On 6 October 2014 09:09, shruti kapoor shrutikapoor@gmail.com
 wrote:

 Hi all,

 My application requires me to use a single admin account for multiple
 users, but how could I allow multiple users to checkout the same document
 using dls:document-checkout(). I do not need to create multiple users.


 --

 Regards,
 *Shruti Kapoor*

 *Software Engineer*
 *Innodata India Pvt. Ltd.*

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general




 --

 Regards,
 *Shruti Kapoor*

 *Software Engineer*
 *Innodata India Pvt. Ltd.*

 7th floor, Stellar IT Park,

 Sector 62, Noida, Uttar Pradesh 201309, India
 Cell: (+91) 9990340628

 Email: skapo...@innodata.com http://www.anmsoft.com/  | Web:
 www.innodata.com http://www.anmsoft.com/

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] dls library

2014-10-06 Thread David Ennis
HI.

The DLS library works on MarkLogic User IDs (in fact, the user id must
match a user from the system (http://marklogic.com/xdmp/security namespace
on the userid element is returned in all cases).

If you are not using individual users and need to use DLS, then perhaps you
need to re-think:
1)  Do I need DLS or can I accomplish my needs with business logic.
2) Can I use real MarkLogic users in my application?  (you can switch users
by dynamically logging them in, for instance)

Short of changing either of the above(which I suggest you opt for 2 above),
I see one possible ugly 'hack':  When checking out a document, you have the
ability to log arbitrary data in the annotation field.  You could use this
for further tracking.. Another hybrid approach could be using collections
to assist in understanding which virtual user 'has the document' (is it
checked out and part of MY collection). But then again, if you are adding
such logic, you are likely getting away from the core use of DLS and I
would still suggest 1 or 2 above.



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 6 October 2014 09:09, shruti kapoor shrutikapoor@gmail.com wrote:

 Hi all,

 My application requires me to use a single admin account for multiple
 users, but how could I allow multiple users to checkout the same document
 using dls:document-checkout(). I do not need to create multiple users.


 --

 Regards,
 *Shruti Kapoor*

 *Software Engineer*
 *Innodata India Pvt. Ltd.*

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] order by clause ignored?

2014-10-06 Thread David Ennis
HI Ron.

That's a great write-up.

An example of this in real-terms that comes to mind is the use of
cts:element-values in a FLWOR statement and the 'concurrent' option with an
order-by clause.  We are essentially telling the server via the concurrent
option to go off and dance around in another thread etc and only ask that
by the time the final results get to us that they are in some sort of
order.  So, with this in combination with lazy evaluation, we can see that
what happens is not necessarily in a certain order(because we even said tot
he server via the 'concurrent' tab to go off and do this in whatever way it
sees fit).  This can even get more fun if we decide to use cts:frequency
within this FLWOR statement.  Now the server is again evaluating and
returning in a completely unpredictable manner. But of course, by the time
we drop out of the FLWOR statement, the final order-by is applied.

Regards,
David



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 5 October 2014 15:23, Ron Hitchens r...@ronsoft.com wrote:


It's important to remember that a for expression in XQuery, and
 similar expressions such as foreach in other functional languages, do not
 represent an imperative order of evaluation as in procedural languages.  An
 XQuery for is not a loop, it's a selector than applies an expression to
 each of a set of selected values, producing a sequence of result values.

In a functional language like XQuery, side effects are not allowed
 (ignoring MarkLogic extensions like map:map and xdmp:set for the moment).
 If there are no side effects that must be accounted for between iterations
 of the loop, then there is no particular reason to evaluate each
 iteration of the loop in sequence.  In fact, they can run in any order or
 in parallel (hint: multi-core optimization).

When an order by clause is used, that controls the order of the items
 in the final result sequence.  But it does not mandate the evaluation order
 of the loop iterations.  Once all the values from all iterations have
 been computed, they can then be sorted into the requested order.  Because
 there are no side effects allowed, it doesn't matter which order they were
 actually evaluated in, or if they were done concurrently.

It is entirely reasonable and correct for log messages or wall-clock
 timestamps to be out of order from the order you intuitively expect.  As
 long as the resulting sequence is in the order your code specified, then
 it's correct.  Writing a log message is a sort of soft side effect.  If
 doesn't modify the state of the running program but it's causing an action
 that's independent of the evaluation of the functional result.

You should always think of a for as a single expression that produces
 a sequence of values.  Don't use it as a flow control mechanism.  Work with
 the ordered result sequence you get from a FLWOR, don't use it to control
 code execution order.

Hope that helps.

 ---
 Ron Hitchens {r...@overstory.co.uk}  +44 7879 358212

 On Oct 2, 2014, at 8:41 PM, Michael Blakeley m...@blakeley.com wrote:

  I try not to rely on evaluation order anywhere, if I can help it. But
 I'm not sure whether MarkLogic's behavior matches the spec or not.
 
  According to http://www.w3.org/TR/xquery/#id-orderby-return the
 resulting order determines the order in which the return clause is
 evaluated.
 
  I like tests, so here's one:
 
  for $i at $x in 1 to 5
  let $_ := xdmp:sleep(1)
  let $start := xdmp:elapsed-time()
  order by $x descending
  return text { $x, $start, xdmp:elapsed-time() }
  =
  5 PT0.006194S PT0.006221S
  4 PT0.004826S PT0.004854S
  3 PT0.003606S PT0.00364S
  2 PT0.002314S PT0.002325S
  1 PT0.001134S PT0.001211S
 
  With 7.0-4, the smallest elapsed-time values are at the end and both
 elapsed-time values match closely. To me this suggests that the return
 clause was evaluated before the results were sorted, not after.
 
  -- Mike
 
  On 2 Oct 2014, at 11:19 , Rachel Wilson rachel.wil...@bbc.co.uk wrote:
 
  Thanks Mike,
 
  Are you saying never to do anything in the return statement that depends
  on the order - that the order by clause only orders the final results.
  It's so surprising because  it does *mostly* work, until I added the
 order
  by clause it was *completely* wrong.  And it's worked fine for other
  simple data sets - just not against production data sadly :-)
 
  I think I've been lead astray in my expectations by the order by
 examples
  for the return statement section in this article
  http://www.stylusstudio.com/xquery_flwor.html
 
  Oh and a quick check - I'm assuming this is the same

Re: [MarkLogic Dev General] order by clause ignored?

2014-10-02 Thread David Ennis
HI.

For the sample given, you can also just pack it all in a single sequence
where the odd numbered indexes are the content dates and the even numbered
indexes are the dates.

Then a few of the sequence related access functions
Iteration is then just done on the odd numbers, etc,.

If you use the FunctX library, then you already have a toolbox of neat
things like finding out the position of document 'XYZ', etc

KInd Regards,
David




Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 2 October 2014 18:42, Michael Blakeley m...@blakeley.com wrote:

 The order of operations in a FLWOR isn't guaranteed. The return expression
 could be evaluated before the sorting is done.

 You might also be interested to know that maps are unordered. So you can
 put those items into the map in any order you like, but the keys will end
 up in whatever internal order the map uses. That should be consistent, but
 won't be under your control.

 As an alternative you can order the keys when processing the map. Or
 consider using json:object instead. That's like a map but has an ordered
 sequence of keys.

 -- Mike

 On 2 Oct 2014, at 09:17 , Rachel Wilson rachel.wil...@bbc.co.uk wrote:

  I realise this is more of an xquery question but everyone here is
 stumped :-s
 
  I have a query that is trying to calculate some earliest and latest
 dates that an event occurred.  The events are represented in xml like this:
 
  publication
publicationDateTime2013-08-14T15:06:51.921302Z/publicationDateTime
documents
  document
  idb119c2a3-5436-59d2-9771-a67f8e2b4172/id
  version1/version
  /document
  /documents
  /publication
 
  There are two events for the this particular document (i.e. with the
 same document id), and therefore two publication documents on different
 days.  In order to work out the first and last dates I'm sorting all my
 publication docs by publication date, then taking the sorted publication
 documents in order I'm iterating through the publication document ids in
 order and remembering them in the correct maps for earliest seen and latest
 seen dates.  However the results in the map are as if the publication
 documents are coming out in document order.
 
  If I run this query the document dates are coming out in the right order
 as I'd expect:
  --
  let $earliestPubDates := map:map()
  let $latestPubDates := map:map()
  let $buildMaps :=
 for $x in doc()/publication
 let $publishedDate := $x/publicationDateTime/string()
 let $documents := $x/documents/document
 order by $x/publicationDateTime
 return
   (: map building stuff commented out in order to see how the dates
 are being ordered :)
   $publishedDate
 
  return $buildMaps
  -
  returns:
  2013-08-14T15:06:51.921302Z
  2014-09-03T14:46:07.757612Z
 
 
 
  However, after someone showed me how to debug the loop a little with an
 error statement, I'm finding that the first publication processed is the
 later one, not the earlier one.  It looks like the order by in this case is
 being ignored.  Could someone tell me how and why?
 
 
 
 
 
  let $earliestPubDates := map:map()
  let $latestPubDates := map:map()
 
  let $buildMaps :=
 for $x in doc()/publication
 let $documents := $x/documents/document
 order by $x/publicationDateTime
 return
for $contentId in $documents/id/string()
let $publishedDate := $x/publicationDateTime/string()
let $putEarliest := if (not(map:contains($earliestPubDates,
 $contentId))) then (
   let $dummy := map:put($earliestPubDates,
 $contentId, $x/publicationDateTime)
   let $a := error(Adding earliest published
 date  || $x/publicationDateTime)
   return $dummy
) else ()
let $putLatest := map:put($latestPubDates, $contentId,
 $publishedDate)
return ()
 
  return $buildMaps
  --
  Returns (in an error stack trace): Adding earliest published date
 2014-09-03T14:46:07.757612Z
 
 
  Is it something to do with when the order by is applied to the statement?
 
  Any help gratefully received
  Rachel
  ___
  General mailing list
  General@developer.marklogic.com
  http://developer.marklogic.com/mailman/listinfo/general

 ___
 General

Re: [MarkLogic Dev General] Query Console unusual error message

2014-10-01 Thread David Ennis
HI.

I've seen that in Firefox before if I've returned a very Large XML file.
My assumption is that it is the adding of the styles on-the-fly.  OUr
solution is to view the doc as raw.

Kind Regards,
David Ennis



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 1 October 2014 16:23, Schwartz, Christine christine.schwa...@ptsem.edu
wrote:

  Hi,



 Our developer was using Query Console in Firefox (on a MAC) and received
 this error message several times.



 A script on this page may be busy, or it may have stopped responding. You
 can stop the script now, or you can continue to see if the script will
 complete.



 Script:
 http://markdev2.ptsem.edu:8000/common/output-formatter/lib/sax.js:47



 We’ve never seen this message before, so not sure what’s going on, but it
 appears to be an issue with Query Console’s JavaScript.



 Thanks for any help/advice.



 Chris



 Christine Schwartz

 Metadata Librarian and XML Database Administrator

 Princeton Theological Seminary Library

 25 Library Place

 Princeton, NJ 08540

 christine.schwa...@ptsem.edu





 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Passing empty value to function not working

2014-09-26 Thread David Ennis
​Hi

MarkLogic allows for function overloading.  Perhaps that could be your
solution..

Kind Regards,
David Ennis​



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 26 September 2014 13:00, Kapoor, Pragya pkapo...@innodata.com wrote:

  Hi,


  I need to pass an empty value to util function, which is not working.


  declare function xutils:validateSession($sessionId as xs:string) {

   if($sessionId ne  ) then
   let $document := fn:doc($config:USER_SESSIONS)
  errorCode
   code500/code
   descriptionserver error/description
   /errorCode
  else
 errorCode
   code517/code
   descriptionSession Id can't be empty/description
   /errorCode

 };

  I am calling this function from some other file and it is returing an
 empty sequence.But if I make this function local:validateSession($sessionId
 as xs:string)  then its working.

  Calling file:
  import module namespace config = config
 at /rest-apis/utils/config.xqy;

   let $node := 'inputString

 sessionId/sessionId
/inputString'



  let $node := xdmp:unquote($node)
  let $sessionId := $node//sessionId/text()
  ​return
 let $validateFlag := xutils:validateSession($sessionId)
 return

  $validateFlag

  Please advice.

  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.

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] cts:element-attribute-values result order

2014-09-24 Thread David Ennis
HI.

cts:element-attribute-values retrieves the list of results from the range
index itself.

using cts:document-query() limits those results to the
element-attribute-values references only in those fragments.

However, cts:element-attribute-values is unaware of any specific details of
how they are used in any particular document, so I don't believe you can
get the result you want from starting with a cts:element-attribute-values
query.

The only way I know to access the values in the order they were in the
document would be to access the document directly.  You may be able to do
this more efficiently by setting a fragment root on the element containing
your list.

Kind Regards,
David Ennis



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 24 September 2014 09:54, Prasanth N V R prasanth.nv...@gmail.com wrote:

 Hi,

 Am using cts:element-attribute-values() with cts:document-query().

 The document contains many attribute-values and the result is returned in
 ascending order by default.

 But I need the result in the order how it is stored in the document.
 Is there any way.

 Thanks,
 Prasanth

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Reg MarkLogic Hadoop examples

2014-09-17 Thread David Ennis
HI.

Perhaps this will help you?


https://docs.marklogic.com/guide/mapreduce.pdf


Kind Regards,
David Ennis





Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 17 September 2014 14:55, karthik.nagaraj...@cognizant.com wrote:

  Hi,



 I was able to find some MarkLogic – Hadoop examples in
 https://github.com/marklogic/HadoopExamples.

 But, it is too old. After April 2014, there are no updates.



 Is there any link where I can find latest MarkLogic – Hadoop examples?



 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.

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How to access XML config files from a modules database instead of content database?

2014-09-15 Thread David Ennis
​HI.

Not sure if this is what you mean - but you can access content from another
database using things like xdmp:eval and the database option.

Kind Regards,
David Ennis



Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 15 September 2014 18:15, Tim t...@aaom.net wrote:

 Hi Folks,

 I'm wondering how to access XML configuration files from a modules database
 while the code is being executed in the context of a content database? Is
 there
 a specific import command that allows me to do this?

 Tim M.


 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Identify the uris which does not have particular element.

2014-09-10 Thread David Ennis
HI.

This is the general sample people see for which you can build on:

cts:element-query(xs:QName('id'),cts:and-query( () ))

This does into take into count position within the structure - just if the
element exists or not .


An earlier thread with all of the history and example :
http://markmail.org/search/?q=Re%3A%20%5BMarkLogic%20Dev%20General%5D%20check%20element%20existance#query:Re%3A%20%5BMarkLogic%20Dev%20General%5D%20check%20element%20existance+page:1+mid:64mculffepgjsxp7+state:results







Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] http://www.hinttech.com
https://twitter.com/HintTech  http://www.facebook.com/HintTech
http://www.linkedin.com/company/HintTech

On 10 September 2014 10:42, priya dharshni dharshnipriya...@gmail.com
wrote:


 Hi ,


   I want to identify the uris which does not have the particular
 element.Say, i want to get uris which does not have id' element.

  xml in db :
   employee
   nametest/name
   id123/id
   /employee

   cts:uris('',
   (),



 cts:not-query(cts:element-value-query(xs:QName(id),*))
 )
 The above query pulls all the uris with and without id element.Please
 let me know how to fix this.

 Regards,
 Priya.

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MD5 - Hash Question

2014-07-18 Thread David Ennis
HI.

For what has been described, perhaps fn:deep-equal can help as it
more-or-less takes into account the 'pitfalls' listed by David Lee:

- for attributes, order does not matter
- whitepace is ignored in element definitions as well as between elements
(essentially ignored if not an atomoc value, I would assume)
- (presumably because the comparison is done on the internal
representation), then it is also true that things like single-quote or
double-quote make no difference (not the case if you were doing a hash
check)

Therefore, document are equal if all of the nodes, child nodes, etc are
present with the exact same attributes and the same values in all places -
while ignoring order of attributes as well as un-needed whitespace.

In a Nutshell:
foo  bar a=b c='d'baz/bar/foo
equals
foo bar  c='d' a='b'baz/bar/foo
(and of course this follows for deep structures as well)

So, perhaps a solution would be a check in MarkLogic:
A =  internal doc
B = fetch doc from Hadoop via http/odbc/whatever and do a deep-diff on it.
(or, expose deep-diff via some ML API and then just have some system that
fetches form hadoop and asks ML if the doc matches the one it has)

Kind Regards,
David Ennis


On 17 July 2014 19:56, David Lee david@marklogic.com wrote:

  I will reply with a shorter version of what came up recently on another
 list.

 ML uses UTF8 internally for xs:string which is what xdmp:quote() returns,

 But that’s misleading.  Its irrelevant because the encoding of a string is
 not exposed at the XQuery layer.

 We could be using anything and the behavior would be the same.

 The only time encoding comes into play is when serializing or
 desterilizing from *bytes* (i.e to/from a file or text document)



 Unless your using text or binary documents then generating a hash on them
 is pointless.

 You're not going to get the same hash as the original file .  This is true
 for any processor of XML or JSON or structured documents that does any
 parsing or serializing.



 Documents stored in the database are not byte-equal to the source document.

 This is true at multiple levels.   At the store on the disk level a
 Document doesn’t resemble the source document at all,

 Any more than a CSV file resembles the block structure of an Oracle
 partition - let alone byte equal.

 For some primitive document types - namely binary, what you get back
 should be equal to what you put in - exactly, But even text documents might
 undergo character set translation , Unicode normalization so what you get
 back may Not be byte equal ...

 Structured docs are more complex,  XML and JSON first undergo charset
 translation like text, then they are parsed Into an internal node structure
 - and then stored in a very concise format.

 Even ignoring the disk format and MarkLogic ... ALL XML and JSON
 processors share this issue.

 The Text Serialized form of a document is not the same thing as its
 value.   You can rarely, if ever, do a round trip

 On JSON or XML and get back byte for byte what you started with - Its
 *critical* to understand that the byte/text format

 Of documents is the transport layer, not the document model itself.  And
 with that concept, there are many equivalent ways to express the same
 document model.   Very simple example, in XML attributes have no ordering
 guarantee (nor in JSON),

 Spaces between attributes like foo  a=b c=d/  are ignored so
 foo c=d a=b/ is the same document.



 To wrap this up, calculating a hash of a document before storing it , and
 after retrieving it doesn’t give you the answer you want.

 The hashes will almost certainly be different - whether or not the
 document is the same thing ...



 To provide better advise on how to compare for document equality I need
 more specifics such as what format the document is in, and how you want to
 define equality.





 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Sujith
 *Sent:* Thursday, July 17, 2014 11:20 AM
 *To:* MarkLogic Developer Discussion
 *Subject:* [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

Re: [MarkLogic Dev General] finally ready to customize

2014-07-13 Thread David Ennis
HI.

Have you considered using Roxy to 'capture' the app?  The you have the
source available to much more easily update and re-deploy.

Here is a good article to get you started:

http://blog.davidcassel.net/2013/08/capturing-an-app-building-application-with-roxy/

Kind Regards,
David Ennis


On 13 July 2014 23:14, cory cardio clcardi...@gmail.com wrote:

 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.jsbunch-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

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MLCP import speed improvements

2014-06-30 Thread David Ennis
HI.

Of course, increasing D nodes or the number of forests per node will give
more throughput, but not if there is another bottleneck elsewere.

With that, It will help people a bit if they know a little more about your
setup.
Number of D Nodes, forests per node, etc



KInd Regards,
David Ennis


On 30 June 2014 11:18, Eugen Tautu eugen.ta...@softvision.ro wrote:

  Hello,

 I've been trying to use the MLCP tool to import about 1 million XML
 documents at a time from the file system into a MarkLogic server that has
 the XDBC app server installed.
 The issue I'm facing is that, while the import does work, it takes a
 really long time (about 3-4 hours, even more), so my question is if there's
 any way to improve the speed?
 The XML documents that I'm trying to load are small, at about 100 bytes
 each, the largest one reaching about 1-2 KB.
 I've tried tinkering with the batch_size, transaction_size and
 thread_count parameters, but it doesn't seem to help too much.

 Thanks,
 Eugen Tautu


 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Definition for Shallow time and deep time

2014-06-17 Thread David Ennis
Further to what Ron Hutchins explains:

The lazy evaluation in MarkLogic can sometimes cause confusion in results
of the profiler (and actually as well as some error messages).

To get more granular results in the profiler, you can make MarkLogic less
lazy by wrapping xdmp:eager around some of your expressions.

Kind Regards,
David Ennis




On 17 June 2014 14:35, Ron Hitchens r...@ronsoft.com wrote:


In XQuery, everything is an expression: values, sequences of values,
 functions, function calls, etc.  An XQuery program is a tree of
 expressions, where some expressions are composed of other expressions.
  Here is an example of a main module which is a FLWOR expression:

 for $book := /book[@status = 'pre pub']
 let $title := $book/metadata/title
 let $authors := $book/metadata/author
 let $author-list := format-author-list ($authors)
 return book-summary ($title, $author-list, $book/abstract)

This FLWOR is made up of several sub-expressions: the XPath
 ' /book[@status = 'pre pub']', the function call 'format-author-list()',
 etc.  Each sub-expresson may be further composed of an expression tree.

The profiler is hooked into the low-level expression evaluator in
 MarkLogic.  It records time information when each expression begins
 evaluation and when the evaluation completes.  As a given expression is
 evaluated, there is time spent working on that expression (shallow time)
 and time spent waiting for sub-expressions to to be evaluated.

Deep time: The wall clock time elapsed between when an expression
 begins evaluation and the time it finishes.
Shallow time: Time spent evaluating an expression when not waiting for
 sub-expressions.

There are a few special cases in the numbers that I remember (things
 may have changed since I wrote the profiler several years ago). For
 example, recursive calls are not measured as sub-expressions (but they are
 counted), they accumulate as a single shallow time.  And calls to builtin
 functions never have a shallow/deep breakdown because they are atomic
 expressions at the profiler level.  Time spent waiting for data from
 d-nodes will show as shallow time against a builtin (such as cts:search) or
 an XPath expression.

Another thing to keep in mind is that MarkLogic makes heavy use of lazy
 evaluation.  This means that expressions may not be evaluated in the same
 order as shown in the code.  For example, assigning the value of an
 expensive function call to a variable may show as taking almost no time,
 but at a later point, when that variable is referenced, that is where the
 deep time will be assigned.  This is because the expensive function may not
 actually be invoked until the value of the variable is finally needed to
 satisfy evaluation of another expression.

Later versions of MarkLogic also make greater use of concurrency, which
 can shift things around as well.  This is because, since XQuery is a
 functional language, multiple sub-expressions could be evaluated at the
 same time.  This could potentially yield a deep time that is less than the
 sum of the deep times of the sub-expressions.

In the profiler output, it's typically the expressions with the larger
 shallow times that you want to look at.  If an expression has a very large
 deep time, but almost no shallow time, then it's not actually doing very
 much work.  All the work is being done in the sub-expressions (this is true
 of many FLWOR expressions, for example).  Go look at those sub-expressions
 to see where the time is being spent.  This is why profiler output is
 typically ordered by shallow time descending.

One last thing to note: on Windows, the time resolution is pretty poor,
 which tends to make the time measurements somewhat inaccurate.  What you
 typically see is that things that run fairly quickly will round to zero,
 which effectively make it useless for fine-grained measurement.  It's still
 useful for analyzing things that are slow, but gets frustrating when you
 are making improvements.  This is where deep time can help by measuring the
 elapsed time of a compound expression even when you can't see the micro
 effects.  I don't know if this has improved in ML7 or with some flavors of
 Windows, but it was still an issue for me about a year ago.

Hope that helps.

 ---
 Ron Hitchens {r...@overstory.co.uk}  +44 7879 358212

 On Jun 17, 2014, at 11:22 AM, priya dharshni dharshnipriya...@gmail.com
 wrote:

 Hi All ,

   Please let me know the exact definition for shallow and deep time shown
 while profiling the xquery in qconsole.

 On mouse hover it shows me -

 Shallow time is - Time spent in the expression

 deep time is - Combined time spent in expression and Sub expression.

 What is meant by sub expression here? Is that the query invoked from one
 module to other module?

 Also in many occurrences the deep time is greater than the shallow time.

 Please clarify.
 ___
 General mailing list

Re: [MarkLogic Dev General] newbie question: Sparql from Java

2014-06-12 Thread David Ennis
HI.

Whatever you are trying to return at this point is not a type that can be
understood (like node or map).

Before returning it, you need to transform or serialize it.

The quickest and dirtiest way to start to see what is going on is to
serialize it.

Assume you have $var

return $var

Change that to
return res{$var}/res

Wrapping it in an XML element causes MarkLogic to serialize complex
objects.  Then you can look and see what is being returned.

We usually pack things into map:map and transform this to json for
transport.

Kind Regards,
David


On 12 June 2014 18:45, Marc Limotte mslimo...@gmail.com wrote:

 I'm trying this solution out now.  It seems to run the query, but then I
 get this exception:

 Caused by: java.io.IOException: Nodes of type 'object' are not supported
 in XCC result sequences

 at
 com.marklogic.xcc.impl.AbstractResultSequence.nodeFactory(AbstractResultSequence.java:237)

 at
 com.marklogic.xcc.impl.AbstractResultSequence.instantiateResultItem(AbstractResultSequence.java:191)

 at
 com.marklogic.xcc.impl.CachedResultSequence.init(CachedResultSequence.java:56)

 at
 com.marklogic.xcc.impl.handlers.GoodQueryResponseHandler.handleResponse(GoodQueryResponseHandler.java:48)

 at
 com.marklogic.xcc.impl.handlers.EvalRequestController.serverDialog(EvalRequestController.java:83)

 at
 com.marklogic.xcc.impl.handlers.AbstractRequestController.runRequest(AbstractRequestController.java:86)

 ...


 What does this mean and any suggestions on how to fix it?


 thanks,

 marc




 On Thu, Jun 5, 2014 at 1:49 PM, Michael Blakeley m...@blakeley.com
 wrote:

 You could call https://docs.marklogic.com/sem:sparql through an XCC
 moduleInvoke, something like this:

 xquery version 1.0-ml;
 (: sparql.xqy :)
 import module namespace sem=http://marklogic.com/semantics;
   at /MarkLogic/semantics.xqy ;
 (: Add more variables to support bindings, etc. as needed :)
 declare variable $SPARQL as xs:string external ;
 sem:sparql($SPARQL)
 (: end :)

 Then in Java:

 Session session = contentSource.newSession(mydatabase);
 Request request = session.newModuleInvoke(sparql.xqy);
 request.setNewStringVariable('SPARQL', mySparqlQuery);
 // add more variables to support bindings, etc. as needed.
 ResultSequence rs = session.submitRequest(request);
 while (rs.hasNext()) {
 ResultItem item = rs.next();
 // handle the item
 }
 session.close();

 Wrap that up in a utility class, parameterize it as needed, and you'll
 never have to think about it again.

 -- Mike

 On 5 Jun 2014, at 09:43 , Marc Limotte mslimo...@gmail.com wrote:

  Hi.
 
  I'd like to run a SPARQL query from Java.  I've found various bits of
 documentation (including
 http://developer.marklogic.com/learn/semantics-exercises/sparql-101).
  But the docs all seem to cover running SPARQL from the console or maybe
 REST or Xquery.  Can someone point me in the right direction for running a
 SPARQL query in Java?
 
  I don't need detailed instructions, just an overview or a pointer to
 the right documentation.
 
  thanks for any help,
  Marc
 
  ___
  General mailing list
  General@developer.marklogic.com
  http://developer.marklogic.com/mailman/listinfo/general

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] newbie question: Sparql from Java

2014-06-12 Thread David Ennis
Cool!  No Problem.  Glad it helped.

-David


On 12 June 2014 20:25, Marc Limotte mslimo...@gmail.com wrote:

 Thanks, David.

 Your res trick helped.  Apparently what I have is a JSON object.  So I
 am able to use json:transform-from-json on it, and then asW3cDocument() on
 the result Item.

 marc



 On Thu, Jun 12, 2014 at 1:11 PM, David Ennis david.en...@dayon.nl wrote:

 HI.

 Whatever you are trying to return at this point is not a type that can be
 understood (like node or map).

 Before returning it, you need to transform or serialize it.

 The quickest and dirtiest way to start to see what is going on is to
 serialize it.

 Assume you have $var

 return $var

 Change that to
 return res{$var}/res

 Wrapping it in an XML element causes MarkLogic to serialize complex
 objects.  Then you can look and see what is being returned.

 We usually pack things into map:map and transform this to json for
 transport.

 Kind Regards,
 David


 On 12 June 2014 18:45, Marc Limotte mslimo...@gmail.com wrote:

 I'm trying this solution out now.  It seems to run the query, but then I
 get this exception:

 Caused by: java.io.IOException: Nodes of type 'object' are not supported
 in XCC result sequences

 at
 com.marklogic.xcc.impl.AbstractResultSequence.nodeFactory(AbstractResultSequence.java:237)

 at
 com.marklogic.xcc.impl.AbstractResultSequence.instantiateResultItem(AbstractResultSequence.java:191)

 at
 com.marklogic.xcc.impl.CachedResultSequence.init(CachedResultSequence.java:56)

 at
 com.marklogic.xcc.impl.handlers.GoodQueryResponseHandler.handleResponse(GoodQueryResponseHandler.java:48)

 at
 com.marklogic.xcc.impl.handlers.EvalRequestController.serverDialog(EvalRequestController.java:83)

 at
 com.marklogic.xcc.impl.handlers.AbstractRequestController.runRequest(AbstractRequestController.java:86)

 ...


 What does this mean and any suggestions on how to fix it?


 thanks,

 marc




 On Thu, Jun 5, 2014 at 1:49 PM, Michael Blakeley m...@blakeley.com
 wrote:

 You could call https://docs.marklogic.com/sem:sparql through an XCC
 moduleInvoke, something like this:

 xquery version 1.0-ml;
 (: sparql.xqy :)
 import module namespace sem=http://marklogic.com/semantics;
   at /MarkLogic/semantics.xqy ;
 (: Add more variables to support bindings, etc. as needed :)
 declare variable $SPARQL as xs:string external ;
 sem:sparql($SPARQL)
 (: end :)

 Then in Java:

 Session session = contentSource.newSession(mydatabase);
 Request request = session.newModuleInvoke(sparql.xqy);
 request.setNewStringVariable('SPARQL', mySparqlQuery);
 // add more variables to support bindings, etc. as needed.
 ResultSequence rs = session.submitRequest(request);
 while (rs.hasNext()) {
 ResultItem item = rs.next();
 // handle the item
 }
 session.close();

 Wrap that up in a utility class, parameterize it as needed, and you'll
 never have to think about it again.

 -- Mike

 On 5 Jun 2014, at 09:43 , Marc Limotte mslimo...@gmail.com wrote:

  Hi.
 
  I'd like to run a SPARQL query from Java.  I've found various bits of
 documentation (including
 http://developer.marklogic.com/learn/semantics-exercises/sparql-101).
  But the docs all seem to cover running SPARQL from the console or maybe
 REST or Xquery.  Can someone point me in the right direction for running a
 SPARQL query in Java?
 
  I don't need detailed instructions, just an overview or a pointer to
 the right documentation.
 
  thanks for any help,
  Marc
 
  ___
  General mailing list
  General@developer.marklogic.com
  http://developer.marklogic.com/mailman/listinfo/general

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Element Query with Element attribute range query is not returning proper results

2014-06-10 Thread David Ennis
HI.

Can you please share the information you have for the index you set up on
@mat:date-value ?

Kind Regards,
David


On 9 June 2014 07:17, Amit Kumar Dev amit_...@infosys.com wrote:

 Thanks! Chris,

 I can use path range index, but I am having so many elements which are
 causing the same issue.
 I am not sure why my element query with attribute range index is not
 returning proper result.

 Query looks fine to me. I also enabled the word position and element
 word position index then also getting false result in response.

 Kindly suggest can we get correct results by using the below query or I
 have to go for path range index.
 Query:
 cts:and-query
 cts:element-query
 cts:elementmat:employee/cts:element
 cts:element-query

 cts:elementmat:joining/cts:element

 cts:elementmat:joining-date/cts:element

 cts:element-attribute-range-query operator==

 cts:elementmat:date/cts:element

 cts:attributemat:date-value/cts:attribute
 cts:value
 xsi:type=xs:date2010-11-09/cts:value

 /cts:element-attribute-range-query
 /cts:element-query
 /cts:element-query
 /cts:and-query

 Thanks and Regards
 Amit Dev

 Date: Sat, 7 Jun 2014 15:25:09 -0400
 From: Christopher Hamlin cbham...@gmail.com
 Subject: Re: [MarkLogic Dev General] Element Query with Element
 attribute range query is not returning proper results
 To: MarkLogic Developer Discussion general@developer.marklogic.com

 Hi Amit,


 Can you use a path range index?

 I think they were introduced in version 6, and

 cts:valid-index-path
 ('/mat:employee/mat:joining/mat:joining-date/mat:date/@mat:date-value',
 fn:true())

 returns true for me (in version 7).


 - Chris
 -- next part --
 An HTML attachment was scrubbed...
 URL:
 http://developer.marklogic.com/pipermail/general/attachments/20140607/40849761/attachment-0001.html
 Message-ID:
 CADX+0Qwtz7oQZZh_ogHyXqt_e=
 mz5bu0o-qo5qhmmacf1zd...@mail.gmail.com
 Content-Type: text/plain; charset=utf-8

 On Sat, Jun 7, 2014 at 3:06 AM, Amit Kumar Dev amit_...@infosys.com
 wrote:

   Hi,
 
 
 
  I am trying to search for date element which come under specific
  hierarchy of elements.
 
  I constructed query to get Date element from
  /mat:employee/mat:joining/mat:joining-date/mat:date/@mat:date-value
 
 
 
  But I am getting search results for date other than ?2010-11-09?.
 
 
 
  Below is the query:
 
  cts:and-query
 
  cts:element-query
 
 
  cts:elementmat:employee/cts:element
 
  cts:element-query
 
 
  cts:elementmat:joining/cts:element
 
 
  cts:elementmat:joining-date/cts:element
 
 
  cts:element-attribute-range-query operator==
 
 
  cts:elementmat:date/cts:element
 
 
  cts:attributemat:date-value/cts:attribute
 
 
  cts:value xsi:type=xs:date2010-11-09/cts:value
 
 
  /cts:element-attribute-range-query
 
  /cts:element-query
 
  /cts:element-query
 
  /cts:and-query
 
 
 
  Whether above query is not searching for exact xpath since I have
  ?mat:date? element for other places also in xml.
 
  E.g.
  /mat:employee/mat:resignation/mat:resignation-date/mat:date/@mat:date-
  value
 
 
 
  I am using MarkLogic 6.0 and having proper element attribute range
  index for ?mat:date?.
 
 
 

  CAUTION - Disclaimer *
 This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
 solely
 for the use of the addressee(s). If you are not the intended recipient,
 please
 notify the sender by e-mail and delete the original message. Further, you
 are not
 to copy, disclose, or distribute this e-mail or its contents to any other
 person and
 any such actions are unlawful. This e-mail may contain viruses. Infosys
 has taken
 every reasonable precaution to minimize this risk, but is not liable for
 any damage
 you may sustain as a result of any virus in this e-mail. You should carry
 out your
 own virus checks before opening the e-mail or attachment. Infosys reserves
 the
 right to monitor and review the content of all messages sent to or from
 this e-mail
 address. Messages sent to or from this e-mail address may be stored on the
 Infosys e-mail system.
 ***INFOSYS End of Disclaimer INFOSYS***
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Multilanguae sorting

2014-06-10 Thread David Ennis
HI.

Separate from language support, you can specify the collation to use on
specific string  indexes.

https://docs.marklogic.com/guide/search-dev/encodings_collations

In my opinion, This is really the magic needed for granular control sorting.

As well as defaults, you can define the collation on the index and then
refer to a specific collation in your search.

Let me know if this helps.  Otherwise, provide an XML sample and how you
want it sorted.  Then there will be enough information for someone to
provide a proper sample.

Kind Regards,
David Ennis


On 10 June 2014 12:16, Ashish Bhardwaj napster.ash...@gmail.com wrote:

 Hi,

 Can anyone tell me what are the ways of doing a language specific sorting
 on a particular data using Marklogic XQuery?

 I am new to MarkLogic and have gone through a lot of documentation around
 collations in Marklogic but how to run a query which can do language
 specific sorting is something which is nowhere mentioned in documentation.
 I would appreciate if someone can give me a few examples.

 Thanks,
 Ashish

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Retire a forrest gives CDMP-JNLTXNFULL

2014-06-10 Thread David Ennis
HI Peter.

Is this the rebalance built into MarkLogic7?

If you have the luxury of emptying the database and re-loading, consider
that as it could be faster overall.

Otherwise, perhaps you could re-purpose
https://github.com/mblakele/task-rebalancer for the job.

For this, you just need to force the forest ID in the assignment variable
of rebalance.xqy. This is, of course the most elegant solution, but it
leverages things like the spawning of tasks already in place.

The heart of this is just to overwrite a document with itself (including
properties, security/etc), so you could also make a stripped-down version
for your purpose using Michael Blakeley's taskbot.

Kind Regards,
David


On 10 June 2014 16:33, Peter Kester peter.kes...@marklogic.com wrote:

  Hi all,

  I'v got a database with 3 forrests. We want to go back to 1 forrest so
 we retired two forests.
 The first forrest got rebalances OK and has 0 documents at the moment.
  The second forrest gives an error:
  There is currently an exception: XDMP-FORESTERR: Error in rebalance of
 forest STRLF3-content-localhost.localdomain-1: XDMP-JNLTXNFULL: The journal
 has exceeded its limit for in-process transaction records:
 txn_size=20.496MB, current_size=0MB, limit=8MB
  Information on this page may be missing.

  And the forrest won't rebalance. After a while the rebalanced kicks in
 again and will fail with the same error.
 How can I fix this? Should I increase the current journal size of 128 MB
 (I think that this is the default value) for the database?
 Locking = fast
 journaling = fast
 Journal-size = 128
 Preallocate journals = false

  Total memory for the server is 8G.
 There are about 1.7 million docs in the db
 The failing forrest is 4.6 GB in size with about 60 docs.
 The other forrest holds 1.1 million docs in the db and is about 8 GB in
 size.

  Thanks in advance,

  Peter

 *Peter Kester*
 Senior Consultant
 peter.kes...@marklogic.com

 +31 611188543

 http://nl.linkedin.com/in/peetkes/

 [image: Description: Description: cid:image001.png@01CCB980.BB82DD90]

 [image: Description: Description: MarkLogic Corporation]
 Graadt van Roggenweg, 328-334, 3531 AH Utrecht
 http://www.marklogic.com/

  New generation databases, you just need to think differently www.
 nosqlfordummies.com http://t.co/YKkJ0Wxseo

   http://world.marklogic.com/

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] S3 and xdmp:external-binary

2014-06-04 Thread David Ennis
HI Geert.

Thank You.  I'll be on the AWS server this week and will have a look at
getting enough information to clarify if there is reason to open a ticket.
Likely there is reason to open such a  ticket because the error-messages in
some cases refer to the bucket all in lowercase when the S3 request used
uppercase.

Kidn Regards,
David Ennis


On 4 June 2014 10:00, Geert Josten geert.jos...@gmail.com wrote:

 Hi David,



 I'd expect MarkLogic and S3 to either ignore the case, or be able to
 handle it. I can't really comment on the third slash, but it is pretty
 common on the file protocol.



 I recommend filing a bug if you haven't done so already. That will give
 our engineers something to look at..



 Cheers,

 Geert



 *Van:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *Namens *David Ennis
 *Verzonden:* woensdag 21 mei 2014 10:01
 *Aan:* MarkLogic Developer Discussion
 *Onderwerp:* Re: [MarkLogic Dev General] S3 and xdmp:external-binary



 Hi David and Danny.



 @Danny: The version is 7.0-2.3 as launched from the AMI at Amazon.



 @David:

 I'll walk through all of the steps below.  IN Short, you are correct -
 they work if I use a lowercased bucket.. But see the last bit where I came
 to the conclusion that I needed the third slash and some fun oddities
 related to odd behaviour if I use a capital.



 *1) Sample files uploaded via local aws - shows bucket is set up and files
 in place:*



 david@davidennis:$ aws s3 cp /tmp/a.jpg
 s3://FT-Acceptance-test-bucket/a.jpg

 upload: ../../../../../../../../../tmp/a.jpg to
 s3://FT-Acceptance-test-bucket/a.jpg

 david@davidennis:$ aws s3 cp /tmp/b.jpg
 s3://FT-Acceptance-test-bucket/b.jpg

 upload: ../../../../../../../../../tmp/b.jpg to
 s3://FT-Acceptance-test-bucket/b.jpg

 david@davidennis:$ aws s3 ls s3://FT-Acceptance-test-bucket

 2014-05-21 09:06:481998228 a.jpg

 2014-05-21 09:06:581998228 b.jpg



 [ 2 files uploaded locally and listed back ]



 *2) Test - List Directory*

 xdmp:filesystem-directory(

   s3://FT-Acceptance-test-bucket/

 )//*:filename/text()



 *Fails..* Se the error below: SVC-S3ERR in another test



 *But (3rd slash):*

 xdmp:filesystem-directory(

   s3:///FT-Acceptance-test-bucket/

 )//*:filename/text()



 Expected result was returned:

 a.jpg b.jpg

 *3) Test - get file:*

 let $bin := xdmp:external-binary(

   s3://FT-Acceptance-test-bucket/a.jpg

 )

 return xdmp:binary-size($bin)



 *Fails..* Se the error below: SVC-S3ERR in another test



 *But (3rd slash):*

 let $bin := xdmp:external-binary(

   s3:///FT-Acceptance-test-bucket/a.jpg

 )

 return xdmp:binary-size($bin)



 Fails.. In the way I originally described

 [1.0-ml] XDMP-MISSINGFILE:
 xdmp:external-binary(s3:///FT-Acceptance-test-bucket/a.jpg) -- Missing
 file s3:///FT-Acceptance-test-bucket/a.jpg



 However, see (2) above.. it's not missing..



 +

 *The Third Slash came in from an early test*

 xdmp:document-get(s3://FT-Acceptance-test-bucket/a.jpg)



 Returns:

 1.0-ml] SVC-S3ERR:
 xdmp:document-get(s3://FT-Acceptance-test-bucket/a.jpg) -- S3 error: GET
 http://FT-Acceptance-test-bucket.s3.amazonaws.com/ 403 Forbidden
 Code=SignatureDoesNotMatch Message=The request signature we calculated
 does not match the signature you provided. Check your key and signing
 method. StringToSignBytes=47 45 54 0a 0a 0a 57 65 64 2c 20 32 31 20 4d 61
 79 20 32 30 31 34 20 30 37 3a 32 36 3a 31 30 20 47 4d 54 0a 2f 66 74 2d 61
 63 63 65 70 74 61 6e 63 65 2d 74 65 73 74 2d 62 75 63 6b 65 74 2f
 RequestId=856A04B796D59029
 HostId=5hRlNGvYu5MReGgPtrAlMbPEcg34ztDo05LD5aqYaYc9pNzK0LqgDyk/zpUGaGQG
 SignatureProvided=ubNAsl3tx2TqcT4es2ZaD74tY/s= StringToSign=GET Wed, 21
 May 2014 07:26:10 GMT /ft-acceptance-test-bucket/
 AWSAccessKeyId=AKIAIP2.



 *But (3rd slash)*

 *xdmp:document-get(s3:///FT-Acceptance-test-bucket/a.jpg)*

 Works!



 That is where I went astray on my early test



 *But wait - it gets more fun -* There is something with capital letters
 that is inconsistent amoung xdmp functions and S3. Take these 2 buckets:

 M-david-ennis-test-bucket (fails the same as the above and works in the
 same cases as the ///)

 *david-ennis-test-bucket *(all lowercase) works as expected in all cases.



 So, The hiccup seems that S3 stuff in MarkLogic is that it forces
 lowercase on the bucketname - yet (for some functions) allows a third slash
 to find the Case-sensitive file.



 Bets practice is to use all lowercase for bucket names - so I will do
 that. However, other tools do not have the same issue (work seamlessly with
 any case mix).  MarkLogic, at best, is inconsistent in some ways of
 handling the bucket name since I see different results between
 external-binary and document-get when calling a bucket with a capital
 letter.



 Perhaps I missed the requirement for all lowercase in the MarkLogic docs.



 Thanks for the help!



 David



 On 21 May 2014 03:43, David Lee david

Re: [MarkLogic Dev General] New Feature Request: Unique Value Range Indexes

2014-06-04 Thread David Ennis
HI.

I believe you can do that here:

http://developer.marklogic.com/mailman/listinfo/general

Kind Regards,
David Ennis


On 4 June 2014 23:09, Analyze That | Johan van den Brink 
jo...@analyzethat.nl wrote:

 Hi guys,

 How can I unsubscribe from this mailing list?


 Met vriendelijke groet,


 Johan van den Brink
 Consultant
 Analyze That -  Analytics | Data Integration | Reporting | Process Mining
 Kerkewijk 8
 3901 EG Veenendaal
 T: (06) 49 92 30 30
 T: (0318) 52 55 87
 M: jo...@analyzethat.nl
 W: www.analyzethat.nl
 L: http://nl.linkedin.com/in/brinkjohanvanden

 -Original Message-
 From: general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] On Behalf Of Whitby, Rob
 Sent: woensdag 4 juni 2014 19:59
 To: MarkLogic Developer Discussion
 Subject: Re: [MarkLogic Dev General] New Feature Request: Unique Value
 Range Indexes

 How about something like this?

 declare function unique-uri() {
   let $uri := /doc/ || xdmp:random() || .xml
   return if (fn:not(fn:doc-available($uri))) then $uri else unique-uri() };

 I guess because indexes are distributed across forests, ensuring
 uniqueness is not that easy?

 Rob
 
 From: general-boun...@developer.marklogic.com [
 general-boun...@developer.marklogic.com] on behalf of Ron Hitchens [
 r...@ronsoft.com]
 Sent: 04 June 2014 18:01
 To: MarkLogic Developer Discussion
 Subject: [MarkLogic Dev General] New Feature Request: Unique Value Range
  Indexes

I'm working on a project, one aspect of which requires minting unique
 IDs and assuring that no two documents with the same ID wind up in the
 database.  I know how to accomplish this using locks (I'm pretty sure) but
 any such implementation is awkward and prone to subtle edge case errors,
 and can be difficult to test.

It seems to me that this is something that MarkLogic could do much more
 reliably and quickly than any user-level code.  The thought that occurred
 to me is a variation on range indexes which only allow a single instance of
 any given value.

Conventional range indexes work by creating term lists that look like
 this (see Jason Hunter's ML Architecture paper), where each term list
 contains an element (or attribute) value and a list of fragment IDs where
 that term exists.

 aardvark | 23, 135, 469, 611
 ant  | 23, 469, 558, 611, 750
 baboon   | 53, 97, 469, 621
 etc...

By making a range index like this but which only allows a single
 fragment ID in the list, that would ensure that no two documents in the
 database contain a given element with the same value.  That is, attempting
 to add a second document with the same element or attribute value would
 cause an exception.  And being a range index, it would provide a fast
 lexicon of all the current unique values in the DB.

Such an index would look something like this:

 abc3vk34 | 17
 bkx46lkd | 52
 bz1d34nm | 37
 etc...

Usage could be something like this:

 declare function create-new-id-doc ($id-root as xs:string) as xs:string {
 try {
 let $id := $id-root || - || mylib:random-string(8)
 let $uri := /idregistry/id- || $id
 let $_ :=
 xdmp:document-insert ($uri,
 registered-id
 id{ $id }/id
 created{ fn:current-dateTime() }/created
 /registered-id
  return $id
 } catch (e) {
 create-new-id-doc ($id-root)
 }
 };

This doesn't require that I write any (possibly buggy) mutual exclusion
 code and I can be confident that once the xdmp:document-insert succeeds
 that the ID is unique in the database and that the type (as configured for
 the range index) is correct.

Any love for Unique Value Range Indexes in the next version of
 MarkLogic?

 ---
 Ron Hitchens {r...@overstory.co.uk}  +44 7879 358212

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


  1   2   >