Re: [MarkLogic Dev General] finding the number of occurences of an element in an xml

2016-11-17 Thread Justin Makeig
The code below illustrates how you can calculate co-occurrences between an 
element and the URI of the documents that contain instances of that element. 
Then, for each URI it counts the total occurrences. Note, that you'll need to 
have the URI lexicon enabled and an element range index on x. 

Justin

(: Insert some dummy data :)
let $docs := (
  BBB,
  B,
  C,
  
)
return 
  for $doc at $i in $docs 
  return xdmp:document-insert($i || '.xml', $doc)
;
(: Calculate counts of  grouped by document URIs. Requires element range 
index on xs:QName('x') :)
let $co-occurr := cts:value-co-occurrences(cts:uri-reference(), 
cts:element-reference(xs:QName('x')), 'map')
for $uri in map:keys($co-occurr)
return $uri || ': ' || fn:count(map:get($co-occurr, $uri))



--
Justin Makeig
Director, Product Management
MarkLogic
jmak...@marklogic.com


> On Nov 17, 2016, at 11:19 PM, Raghu  wrote:
> 
> Hi All,
> 
> I've got around 40 million XML documents out of which few documents are 
> having an element say element x twice (they are supposed to have only one 
> element x), I need to find the list of documents are there with multiple 
> occurrences of that element x. what would be the ideal way to query them?
> 
> Thanks in adavance
> ___
> 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] finding the number of occurences of an element in an xml

2016-11-17 Thread Raghu
Hi All,

I've got around 40 million XML documents out of which few documents are
having an element say element x twice (they are supposed to have only one
element x), I need to find the list of documents are there with multiple
occurrences of that element x. what would be the ideal way to query them?

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


Re: [MarkLogic Dev General] Error setting up slush-generator

2016-11-17 Thread Geert Josten
Hi Banu,

I think you are running a too old version of Ruby. You need 1.9.3 at the least. 
Can you check with `ruby -v`?

Cheers,
Geert

From: 
>
 on behalf of Banu Bhandaru 
>
Reply-To: MarkLogic Developer Discussion 
>
Date: Thursday, November 17, 2016 at 11:55 PM
To: "general@developer.marklogic.com" 
>
Subject: [MarkLogic Dev General] Error setting up slush-generator

Hello Everyone

Sorry for the email blast. I’m setting up my first app using slush generator 
and I’m seeing the attached error.

I’m running the slush generator for create the framework for an app and I’m 
getting the attached error during the creation. It goes all the way after that 
but the attached error concerns me.

The following are the steps I took
1)   Installed all the pre-reqs for slush as root
a.   nodejs
b.   gulp
c.   slush
d.   bower
e.   git
f.ruby
g.   slush-marlogic-node

2)   Ran the following as regular user
a.   bower install
b.   slush marklogic-node myapp

Now, I’m executing the following commands and the attached error repeats.

./ml local bootstrap
./ml local deploy modules

What am I missing in my config?

Thanks in advance for the help
Regards
Banu Bhandaru
214 498 749
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Error setting up slush-generator

2016-11-17 Thread Banu Bhandaru
Hello Everyone

Sorry for the email blast. I’m setting up my first app using slush generator 
and I’m seeing the attached error.

I’m running the slush generator for create the framework for an app and I’m 
getting the attached error during the creation. It goes all the way after that 
but the attached error concerns me.

The following are the steps I took
1)   Installed all the pre-reqs for slush as root
a.   nodejs
b.   gulp
c.   slush
d.   bower
e.   git
f.ruby
g.   slush-marlogic-node

2)   Ran the following as regular user
a.   bower install
b.   slush marklogic-node myapp

Now, I’m executing the following commands and the attached error repeats.

./ml local bootstrap
./ml local deploy modules

What am I missing in my config?

Thanks in advance for the help
Regards
Banu Bhandaru
214 498 749
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] General Digest, Vol 149, Issue 25

2016-11-17 Thread Shiv Shankar
Thanks Greet,
I see a very good video in YouTube
https://www.youtube.com/watch?v=duYcb4BsftI

Regards
Shan.

On Thu, Nov 17, 2016 at 6:46 AM, 
wrote:

> Send General mailing list submissions to
> general@developer.marklogic.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://developer.marklogic.com/mailman/listinfo/general
> or, via email, send a message with subject or body 'help' to
> general-requ...@developer.marklogic.com
>
> You can reach the person managing the list at
> general-ow...@developer.marklogic.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of General digest..."
>
>
> Today's Topics:
>
>1. More insights on MarkLogic 9.0 (Shiv Shankar)
>2. Sharing Modules (Jangam, Yogesh  CWR)
>3. Re: Sharing Modules (Geert Josten)
>4. Re: More insights on MarkLogic 9.0 (Geert Josten)
>5. fn:current-dateTime() (sweet frd)
>
>
> --
>
> Message: 1
> Date: Wed, 16 Nov 2016 19:44:55 -0500
> From: Shiv Shankar 
> Subject: [MarkLogic Dev General] More insights on MarkLogic 9.0
> To: general@developer.marklogic.com
> Message-ID:
> 

[MarkLogic Dev General] Sharing Modules

2016-11-17 Thread Gary Vidal
You can share modules across database by assigning all app-servers to share
same modules database.  Consider the following folder structure:
/global-modules/
/app-1
/app-2
/app-3

If you assign your app-servers to "/" then all apps can share global as
well as any other app code.

Now maintenance may be the issue and ensuring you dont overwrite global.
So assign read/exec to all modules but only assign each applications
 insert/update role to specific application.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] fn:current-dateTime() (sweet frd)

2016-11-17 Thread Gary Vidal
fn:current-dateTime() will never change within the same
session/transaction.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] More insights on MarkLogic 9.0

2016-11-17 Thread Geert Josten
Hi Praveen,

You can find details about MarkLogic World 2017 here: 
http://www.marklogic.com/blog/marklogic-world-2017/

Release schedules are not shared, even I don’t know. But I’d be surprised if it 
wouldn’t be released within next half year. There will be plenty noise when it 
hits the ground..

Cheers,
Geert

From: Gontla Praveen 
>
Date: Thursday, November 17, 2016 at 3:23 PM
To: MarkLogic Developer Discussion 
>, 
Geert Josten >
Subject: Re: [MarkLogic Dev General] More insights on MarkLogic 9.0

Hi Greet,

When is the next Marklogic World Tour ? Where can i  find the schedule for ML 9 
release updates ?

Thanks,
Praveen.

On Thu, Nov 17, 2016 at 3:34 AM, Geert Josten 
> wrote:
Hi Shan,

Not much has been made public yet. I expect more will be released around next 
MarkLogic World tour. There are several blogs out there though:

https://www.google.nl/search?q=MarkLogic%209

And there is quite some material available through https://ea.marklogic.com/

Cheers,
Geert

From: 
>
 on behalf of Shiv Shankar 
>
Reply-To: MarkLogic Developer Discussion 
>
Date: Thursday, November 17, 2016 at 1:44 AM
To: "general@developer.marklogic.com" 
>
Subject: [MarkLogic Dev General] More insights on MarkLogic 9.0

Hi,
Any deeper-insight documents on MarkLogic 9.0 features?

Regards
Shan.

___
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] More insights on MarkLogic 9.0

2016-11-17 Thread Gontla Praveen
Hi Greet,

When is the next Marklogic World Tour ? Where can i  find the schedule for
ML 9 release updates ?

Thanks,
Praveen.

On Thu, Nov 17, 2016 at 3:34 AM, Geert Josten 
wrote:

> Hi Shan,
>
> Not much has been made public yet. I expect more will be released around
> next MarkLogic World tour. There are several blogs out there though:
>
> https://www.google.nl/search?q=MarkLogic%209
>
> And there is quite some material available through https://ea.marklogic.
> com/
>
> Cheers,
> Geert
>
> From:  on behalf of Shiv Shankar
> 
> Reply-To: MarkLogic Developer Discussion 
> Date: Thursday, November 17, 2016 at 1:44 AM
> To: "general@developer.marklogic.com" 
> Subject: [MarkLogic Dev General] More insights on MarkLogic 9.0
>
> Hi,
> Any deeper-insight documents on MarkLogic 9.0 features?
>
> Regards
> Shan.
>
> ___
> 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] fn:current-dateTime()

2016-11-17 Thread Florent Georges
Hi,

The current date and time is the same through the evaluation of the
entire query.  So if "submodule.xay" is a library module, imported in
the main module, that will give you the exact same value.

If it is not a library module, and you invoke, spawn, schedule a task,
eval or anything else, it depends on that "anything else"...

Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2o.consulting/ - New website!


On 17 November 2016 at 12:46, sweet frd wrote:
> Hi All,
>
> I have a module somemodule.xqy which has the following line for logic
>
> fn:current-dateTime()
>
>
> Will there be a difference in output for the below scenarios
>
> (a) Invoke the above xquery (somemodule.xqy) in main module
>
> (b) Directly invoke the function fn:current-dateTime() in the main module
>
>
> Regards,
> N. Sumathi.
>
> ___
> 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] fn:current-dateTime()

2016-11-17 Thread Geert Josten
Hi,

No, the output will be the same. In fact all calls to that function throughout 
the request will return the same value (effectively the request timestamp). 
Wrapping the call in another function will create a marginal overhead though, 
but depending on how often it would get called, not by much, or not noticeable 
at all..

Cheers,
Geert

From: 
>
 on behalf of sweet frd 
>
Reply-To: MarkLogic Developer Discussion 
>
Date: Thursday, November 17, 2016 at 12:46 PM
To: MarkLogic Developer Discussion 
>
Subject: [MarkLogic Dev General] fn:current-dateTime()

Hi All,

I have a module somemodule.xqy which has the following line for logic

fn:current-dateTime()


Will there be a difference in output for the below scenarios

(a) Invoke the above xquery (somemodule.xqy) in main module

(b) Directly invoke the function fn:current-dateTime() in the main module


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


[MarkLogic Dev General] fn:current-dateTime()

2016-11-17 Thread sweet frd
Hi All,

I have a module somemodule.xqy which has the following line for logic

fn:current-dateTime()


Will there be a difference in output for the below scenarios

(a) Invoke the above xquery (somemodule.xqy) in main module

(b) Directly invoke the function fn:current-dateTime() in the main module


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


Re: [MarkLogic Dev General] More insights on MarkLogic 9.0

2016-11-17 Thread Geert Josten
Hi Shan,

Not much has been made public yet. I expect more will be released around next 
MarkLogic World tour. There are several blogs out there though:

https://www.google.nl/search?q=MarkLogic%209

And there is quite some material available through https://ea.marklogic.com/

Cheers,
Geert

From: 
>
 on behalf of Shiv Shankar 
>
Reply-To: MarkLogic Developer Discussion 
>
Date: Thursday, November 17, 2016 at 1:44 AM
To: "general@developer.marklogic.com" 
>
Subject: [MarkLogic Dev General] More insights on MarkLogic 9.0

Hi,
Any deeper-insight documents on MarkLogic 9.0 features?

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


Re: [MarkLogic Dev General] Sharing Modules

2016-11-17 Thread Geert Josten
Hi Yogesh,

It might be easiest to handle this outside of MarkLogic. There are lots of ways 
to make reusable code snippets available. You have Github for public sharing, 
which can be used together with the MLPM tool for MarkLogic libraries 
(http://registry.demo.marklogic.com/), but you can probably think of various 
ways of doing this internally as well, if necessary..

You can also share modules within an ML cluster, but I’d be reluctant with 
that. You’d use super/sub-databases for that. Put the shared code in a 
sub-database. Keep in mind though, that whenever you touch the shared code, all 
app-servers using that will be affected. For constants this might be good (for 
some system-wide configuration or such), but for shared code this might be less 
a good idea. It would be tricky to do regression testing on multiple apps for 
each code change. You’d probably want to use a sharing strategy that uses 
versioning. The above MLPM tool would allow that, it was inspired by how NPM 
works..

Cheers,
Geert

PS: small disclaimer, MLPM and its registry are not covered by MarkLogic 
Support, they are a community effort..

From: 
>
 on behalf of "Jangam, Yogesh CWR" 
>
Reply-To: MarkLogic Developer Discussion 
>
Date: Thursday, November 17, 2016 at 9:12 AM
To: "general@developer.marklogic.com" 
>
Subject: [MarkLogic Dev General] Sharing Modules

Is there any recommended way of sharing module / functionality implementations 
across different DB on same ML server.
For example you could have a XQY code that does custom string 
conversion/manipulation or a map of constants/literals. How can this be shared ?


Yogesh Jangam
CREDIT SUISSE
Information Technology | Content Management APAC, VICC 23
S2, Rajiv Gandhi Infotech Park (Cs Sez) | Pune 411 057 | Asia-Pacific
Phone +91 20 6690 2130,*6882130
yogesh.jan...@credit-suisse.com | 
www.credit-suisse.com



==
Please access the attached hyperlink for an important electronic communications 
disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Sharing Modules

2016-11-17 Thread Jangam, Yogesh CWR
Is there any recommended way of sharing module / functionality implementations 
across different DB on same ML server.
For example you could have a XQY code that does custom string 
conversion/manipulation or a map of constants/literals. How can this be shared ?


Yogesh Jangam
CREDIT SUISSE
Information Technology | Content Management APAC, VICC 23
S2, Rajiv Gandhi Infotech Park (Cs Sez) | Pune 411 057 | Asia-Pacific
Phone +91 20 6690 2130,*6882130
yogesh.jan...@credit-suisse.com | 
www.credit-suisse.com

=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general