Re: [MarkLogic Dev General] (no subject)

2015-07-27 Thread Erik Hennum
Hi, Moshir: > I think its not possible to do binding search with qbe Yes, currently, that is a limitation. You can use structured query with parsed query (or use a general-purpose parser like Jison to do your own query parsing). > I'm sure score ranking is pretty simple You can use the qb.sc

[MarkLogic Dev General] Difference in output of sem:sparql-values and sem:sqarql

2015-07-27 Thread Tyagi, Devesh
Hi, let $params := map:new(map:entry("predicate",sem:iri("http://www.bsi.org/predicates/hasTaxonomyName";))) sem:sparql-values("select ?subject ?predicate ?object where {?subject ?predicate ?object}", $params) returns 3 columns namely (subject, predicate, object) where as sem:sparql-value

Re: [MarkLogic Dev General] Caching of results

2015-07-27 Thread Christopher Hamlin
Hello, Caching can be explored using xdmp:query-meters: http://docs.marklogic.com/xdmp:query-meters?q=query-meters&v=8.0&api=true = Chris On Mon, Jul 27, 2015 at 9:55 AM, Tyagi, Devesh wrote: > Hi, > > > While profiling a query I noticed that first execution gives the total time > of execution

[MarkLogic Dev General] Caching of results

2015-07-27 Thread Tyagi, Devesh
Hi, While profiling a query I noticed that first execution gives the total time of execution. Subsequent queries result in 0 seconds of time in execution. So I am assuming the results are cached for the queries. Can someone point out the source where I can find out more about caching. Regard

Re: [MarkLogic Dev General] XQuery evaluation

2015-07-27 Thread Geert Josten
Maybe also worth mentioning, map:new: map:new( map:entry(Ĺ’hasTaxonomyName', 'http://www.bsi.org/predicates/hasTaxonomyName') ) Cheers On 7/27/15, 1:39 PM, "general-boun...@developer.marklogic.com on behalf of Florent Georges" wrote: >declare variable $map := > let $m := map:map() > let

Re: [MarkLogic Dev General] XQuery evaluation

2015-07-27 Thread Tyagi, Devesh
Thanks Florent, This was really helpful. Regards, Devesh From: general-boun...@developer.marklogic.com on behalf of Florent Georges Sent: Monday, July 27, 2015 5:09 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] XQuery eval

Re: [MarkLogic Dev General] XQuery evaluation

2015-07-27 Thread Florent Georges
Hi, Depends what you want to do with it (especially whether the map is to be updated after its initialization). I recommend you encapsulate the map with a function "get" that takes the name of the entry and return the corresponding value (so the way it is implemented will not affect the other par

Re: [MarkLogic Dev General] XQuery evaluation

2015-07-27 Thread Ken Tune
Tyagi You could use server fields - see xdmp:set/get-server-field. ( http://docs.marklogic.com/xdmp:set-server-field ) Or you can save a map as a document ( first part of below ) and access it as per second part of below, which could be wrapped into a small utility function. let $map := map:e

Re: [MarkLogic Dev General] XQuery evaluation

2015-07-27 Thread Tyagi, Devesh
Thanks Florent and Geert, The real motive behind this question is to implement a globally available map for all the functions of the xquery module. Any suggestions about how to implement it? May be I can put it in a different Xquery module and import it? Regards, Devesh ___

Re: [MarkLogic Dev General] XQuery evaluation

2015-07-27 Thread Florent Georges
Hi, Yet a cleaner solution would be to make the init function to return the map to assign to the global variable, so there is no hidden dependency: declare variable $global-map := my:init(); declare function my:init() { let $map := map:map() ... return $

Re: [MarkLogic Dev General] XQuery evaluation

2015-07-27 Thread Geert Josten
Hi Devesh, XQuery specification allows lazy evaluation, and MarkLogic makes heavy use of that. Just don’t put the call to your init function in a declare variable, but simply call it before the local:test. Something like: let $init := local:initialize-variables() return local:test() Cheers, Ge

[MarkLogic Dev General] XQuery evaluation

2015-07-27 Thread Tyagi, Devesh
Hi, I have the following piece of code in XQuery: declare variable $triple-predicate-prefix := "http://www.bsi.org/predicates/";; declare variable $triple-predicate-suffix-hasTaxonomyName := "hasTaxonomyName"; declare variable $triple-predicates-map := map:map(); declare variable $initializ