Re: [MarkLogic Dev General] How to use uri-match in the java api?

2017-04-03 Thread Andreas Hubmer
Hi Erik,

Thanks for your response.

Performance should not be an issue because we are using trailing wildcards.
So all index matches are consecutive.

Regards,
Andreas


2017-04-03 20:58 GMT+02:00 Erik Hennum :

> Hi, Andreas:
>
> The REST API doesn't support the cts:*-match() functions out of the box.
>
> If you really need to match values in a range index, you can implement a
> resource service extension that takes the appropriate parameters and makes
> the call.
>
> To perform well at scale for a range index with many values (such as the
> uri lexicon), you might think about passing in or constructing a
> constraining query so the comparison is only on some values instead of all
> values in the range index.
>
>
> Erik Hennum
>
>
> --
> *From:* general-boun...@developer.marklogic.com [
> general-boun...@developer.marklogic.com] on behalf of Andreas Hubmer [
> andreas.hub...@ebcont.com]
> *Sent:* Monday, April 03, 2017 1:09 AM
> *To:* MarkLogic Developer Discussion
> *Subject:* Re: [MarkLogic Dev General] How to use uri-match in the java
> api?
>
> Hi,
>
> Using queryManager.values I can invoke cts:uris, but how could I invoke
> cts:uri-match with a wildcarded uri through the Java API?
>
> Thanks,
> Andreas
>
>
>
> 2017-03-31 17:22 GMT+02:00 Justin Makeig :
>
>> Apologies, I read too fast. You were asking about "Java", not
>> "JavaScript". (Car is to carpet as Java is to JavaScript.)
>>
>> You'll need to specify a URI values constraint.
>>
>> http://marklogic.com/appservices/search";>
>> 
>> 
>> 
>>   …
>> 
>>
>> And then queryManager.values("uris", new JacksonHandle()) to use it. (Hat
>> tip: Sam Mefford.)
>>
>> Take a look at 
>> and .
>>
>> Justin
>>
>> > On Mar 31, 2017, at 8:08 AM, Justin Makeig 
>> wrote:
>> >
>> > 
>> >
>> > In general, the built-in functions map one-to-one between JavaScript
>> and XQuery. (There are exceptions.) Because hyphens aren't friendly in
>> JavaScript property names, we do a kabab-case to camel-case translation for
>> all of the names in JavaScript, i.e. cts:uri-match() in XQuery is
>> cts.uriMatch() in JavaScript.
>> >
>> > Justin
>> >
>> >> On Mar 31, 2017, at 3:31 AM, Andreas Felix 
>> wrote:
>> >>
>> >> Hi,
>> >> i need to fetch uris by wildcard, eg. foo*
>> >> In xquery i use the cts:uri-match function for this.
>> >> Does anybody know how so solve this with the Java-API?
>> >>
>> >> Regards
>> >> Andreas
>> >> ___
>>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Scramble production data for testing in ML 8.x

2017-04-03 Thread Shiv Shankar
Hi,
I am aware we have redact option in ML9.x to scramble the data while doing
ingestion using MLCP; Is there any similar options available in ML 8.x? .
Any other alternative approaches to scramble the production data (sensitive
data) into testing environment?

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


Re: [MarkLogic Dev General] How to use uri-match in the java api?

2017-04-03 Thread Erik Hennum
Hi, Andreas:

The REST API doesn't support the cts:*-match() functions out of the box.

If you really need to match values in a range index, you can implement a 
resource service extension that takes the appropriate parameters and makes the 
call.

To perform well at scale for a range index with many values (such as the uri 
lexicon), you might think about passing in or constructing a constraining query 
so the comparison is only on some values instead of all values in the range 
index.


Erik Hennum



From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of Andreas Hubmer 
[andreas.hub...@ebcont.com]
Sent: Monday, April 03, 2017 1:09 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] How to use uri-match in the java api?

Hi,

Using queryManager.values I can invoke cts:uris, but how could I invoke 
cts:uri-match with a wildcarded uri through the Java API?

Thanks,
Andreas



2017-03-31 17:22 GMT+02:00 Justin Makeig 
mailto:justin.mak...@marklogic.com>>:
Apologies, I read too fast. You were asking about "Java", not "JavaScript". 
(Car is to carpet as Java is to JavaScript.)

You'll need to specify a URI values constraint.

http://marklogic.com/appservices/search";>



  …


And then queryManager.values("uris", new JacksonHandle()) to use it. (Hat tip: 
Sam Mefford.)

Take a look at  and 
.

Justin

> On Mar 31, 2017, at 8:08 AM, Justin Makeig 
> mailto:justin.mak...@marklogic.com>> wrote:
>
> 
>
> In general, the built-in functions map one-to-one between JavaScript and 
> XQuery. (There are exceptions.) Because hyphens aren't friendly in JavaScript 
> property names, we do a kabab-case to camel-case translation for all of the 
> names in JavaScript, i.e. cts:uri-match() in XQuery is cts.uriMatch() in 
> JavaScript.
>
> Justin
>
>> On Mar 31, 2017, at 3:31 AM, Andreas Felix 
>> mailto:andreas.fe...@ebcont.com>> wrote:
>>
>> Hi,
>> i need to fetch uris by wildcard, eg. foo*
>> In xquery i use the cts:uri-match function for this.
>> Does anybody know how so solve this with the Java-API?
>>
>> Regards
>> Andreas
>> ___

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


[MarkLogic Dev General] Community Newsletter

2017-04-03 Thread Dave Cassel
Hello Community,

I'm sure you've heard that MarkLogic World is coming up in Chicago, London, and 
Tokyo. If you've never been, this video will give you an idea what people like 
about the event.

Content

  *   Kurt Cagle wrote about Custom Functions in MarkLogic 
SPARQL
  *   Karl Erisman reviews MarkLogic 9's row-oriented views and the Optic 
API
  *   Lee Pollington reviews XML's path through the hype curve in My Trusted 
Companion: XML (Which Is Now 
Everywhere)

Software Releases

  *   MarkLogic versions 8.0-6.3 and 
7.0-6.9 are 
available on DMC. Check 
help.marklogic.com to see the list of 
fixes in these releases.
  *   Rob Rudin has released version 2.6.0 of 
ml-gradle,  his 
MarkLogic application deployment project
  *   Paxton Hare released version 1.1.1 of the Data Hub 
Framework. 
If you haven't poked around with this project, take ten minutes and go through 
the tutorial or watch MLU's 
video 
series.
 Time well spent.
  *   Rob Rudin strikes again. Looking for a simpler way to migrate from an 
RDBMS to MarkLogic? Rob's 
ml-migration-starter, 
currently available with a 1.1.0 release, is a starter kit for doing just that.
  *   Sanju Thomas presents a new project: 
kafka-connect-marklogic,
 which lets you pull data from Kafka (stream processing) into MarkLogic.

Events

  *   Chicago, April 5: Data Hubs vs. Data Lakes - There's a difference! Which 
one is right for you?
  *   Webinar, May 4: Powering Content in the Publishing and Media 
Industries

MLU
In case you missed their announcement, MarkLogic University is now offering 
half-day, hands-on workshops on Performance and on Data Modeling. This format 
is a great way to get hands-on practice guided by experts. Check out the 
schedule at https://mlu.marklogic.com/registration/.

Dave.

--
Dave Cassel, @dmcassel
Technical Community Manager
MarkLogic Corporation
http://developer.marklogic.com/
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How to use uri-match in the java api?

2017-04-03 Thread Andreas Hubmer
Hi,

Using queryManager.values I can invoke cts:uris, but how could I invoke
cts:uri-match with a wildcarded uri through the Java API?

Thanks,
Andreas



2017-03-31 17:22 GMT+02:00 Justin Makeig :

> Apologies, I read too fast. You were asking about "Java", not
> "JavaScript". (Car is to carpet as Java is to JavaScript.)
>
> You'll need to specify a URI values constraint.
>
> http://marklogic.com/appservices/search";>
> 
> 
> 
>   …
> 
>
> And then queryManager.values("uris", new JacksonHandle()) to use it. (Hat
> tip: Sam Mefford.)
>
> Take a look at 
> and .
>
> Justin
>
> > On Mar 31, 2017, at 8:08 AM, Justin Makeig 
> wrote:
> >
> > 
> >
> > In general, the built-in functions map one-to-one between JavaScript and
> XQuery. (There are exceptions.) Because hyphens aren't friendly in
> JavaScript property names, we do a kabab-case to camel-case translation for
> all of the names in JavaScript, i.e. cts:uri-match() in XQuery is
> cts.uriMatch() in JavaScript.
> >
> > Justin
> >
> >> On Mar 31, 2017, at 3:31 AM, Andreas Felix 
> wrote:
> >>
> >> Hi,
> >> i need to fetch uris by wildcard, eg. foo*
> >> In xquery i use the cts:uri-match function for this.
> >> Does anybody know how so solve this with the Java-API?
> >>
> >> Regards
> >> Andreas
> >> ___
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] question about permissions

2017-04-03 Thread Erik Zander
Hi Gary,

Yes that was the issue, and I should know this…
Thanks for the help.

Regards
Erik

Från: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] För Gary Vidal
Skickat: den 31 mars 2017 13:38
Till: general@developer.marklogic.com
Ämne: Re: [MarkLogic Dev General] question about permissions

You have no document permissions. When you inserted the content you probably 
used the admin role which means all docs in database have no permissions.  YOu 
can confirm this by just running xdmp:document-get-permissions($uri) on any 
document.

To solve this problem always load your content with permissions explicitly. If 
you dont have that luxury to reload you can use the task-server to spawn 
functions to add them.  Make sure you have enough task queue depth on task 
server.


let $perms := (
  xdmp:permission("role","read"),
  ...
)
return
 for $uri in cts:uris()
 return xdmp:spawn-function(function(){
xdmp:document-set-permissions($uri,$perms)
},
 
   update-auto-commit
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general