Re: [MarkLogic Dev General] How to specify Collection along with the document URI when inserting a marklogic document

2018-05-10 Thread shabana khan
Hi Bharath,

You can add document and collection in single step itself. If you look at
the syntax of xdmp.documentInsert(), you will seen that you can pass
collection in options node itself :

declareUpdate();
xdmp.documentInsert(
   'document URI',
  document,
  { collections : 'name of collection'})


Thanks and Regards,
Shabana Khan
LinkedIn <https://in.linkedin.com/pub/shabana-khan/40/229/454>




On Thu, May 10, 2018 at 12:47 PM, Bharath Umesh <bharat...@gmail.com> wrote:

> Thanks, Christopher.
>
> I was able to add document and add this document to its collection in 2
> steps.
>
> declareUpdate();
> xdmp.documentInsert(' {..}
> );
> xdmp:document-add-collections("", "");
>
> Is this correct?
>
> Thanks,
> Bharath
>
>
>
>
> On Wed, May 9, 2018 at 6:08 PM, Christopher Hamlin <cbham...@gmail.com>
> wrote:
>
>> The second and third examples at
>> https://docs.marklogic.com/xdmp:document-insert shows collections
>> being set.
>>
>> Do those work for you?
>>
>> On Wed, May 9, 2018 at 7:48 AM, Bharath Umesh <bharat...@gmail.com>
>> wrote:
>> > Hi
>> >
>> > How do I specify Collection info  along with the document URI when
>> inserting
>> > a marklogic document.
>> >
>> >
>> > Thanks,
>> > Bharath
>> >
>> > ___
>> > 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] Regarding limiting no of co-occurrences returned.

2017-11-29 Thread shabana khan
Hi All,

The problem seems to be with the values that I am passing in query those
values have some duplicacy so, *cts:value-co-occurrences()* seems to be
working fine.
Thanks to all of you for your suggestions.

Thanks and Regards,
Shabana Khan
LinkedIn <https://in.linkedin.com/pub/shabana-khan/40/229/454>




On Wed, Nov 29, 2017 at 3:30 AM, Christopher Hamlin <cbham...@gmail.com>
wrote:

> Yeah, TDE is a great suggestion if you you are on 9.
>
> You can control extraction context, and so keep separate the kind of
> "repeating rows" that can be difficult with tuples.
>
> For example see:  http://docs.marklogic.com/guide/app-dev/TDE#id_71415
>
> On Tue, Nov 28, 2017 at 4:02 PM, Erik Hennum <erik.hen...@marklogic.com>
> wrote:
> > Hi, Shabana:
> >
> > If you are on MarkLogic 9, you might consider using TDE to project the
> rows you want from the documents.
> > You can then use the Optic API to retrieve rows from documents qualified
> by a cts.query().
> >
> > Erik Hennum
> >
> >
> >
> > 
> > From: general-boun...@developer.marklogic.com <
> general-boun...@developer.marklogic.com> on behalf of Christopher Hamlin <
> cbham...@gmail.com>
> > Sent: Tuesday, November 28, 2017 8:05:14 AM
> > To: MarkLogic Developer Discussion
> > Subject: Re: [MarkLogic Dev General] Regarding limiting no of
> co-occurrencesreturned.
> >
> > You'll get tuples for the cross product over the document (that is,
> > the co-occurrences within the whole document).
> >
> > So, is it the case that you have more than one occurrence of the two
> > values you are returning, in the same document?
> >
> > If so, sometimes you can do some work by using the 'proximity' and
> > 'ordered' options.
> >
> > The query you pass restricts the fragments.  Unless you have
> > fragmentation, this equates to co-occurrences across all documents
> > matching the query.
> >
> > /ch
> >
> > On Tue, Nov 28, 2017 at 7:53 AM, shabana khan <shabana.0...@gmail.com>
> wrote:
> >> Hi All,
> >>
> >> I am using cts:value-co-occurrences() for fetching pair of values for
> data
> >> set in my project.I have a query too for restricting resultant pair only
> >> from specific section.
> >> But the problem I am facing is that duplicate results are being
> returned for
> >> each occurrence of values.
> >> Basically, I am looking for a way by which each pair of value should
> occur
> >> only once in result. I looked at the available options and tried using
> >> "limit=N" but that seems to have no effect on this.
> >> Filtering at later stage is not possible since it slows down the query
> if I
> >> go for selecting unique records based on some value.
> >>
> >> Is there some way to achieve it. If anyone has faced this problem
> please do
> >> share what you did exactly to get unique pair of values.
> >> Any heads-up will be appreciated.
> >>
> >> Thanks and Regards,
> >> Shabana Khan
> >> LinkedIn
> >>
> >>
> >>
> >>
> >> ___
> >> 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
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Regarding limiting no of co-occurrences returned.

2017-11-28 Thread shabana khan
Hi All,

I am using *cts:value-co-occurrences()* for fetching pair of values for
data set in my project.I have a query too for restricting resultant pair
only from specific section.
But the problem I am facing is that duplicate results are being returned
for each occurrence of values.
Basically, I am looking for a way by which each pair of value should occur
only once in result. I looked at the available options and tried using
*"limit=N"
*but that seems to have no effect on this.
Filtering at later stage is not possible since it slows down the query if I
go for selecting unique records based on some value.

Is there some way to achieve it. If anyone has faced this problem please do
share what you did exactly to get unique pair of values.
Any heads-up will be appreciated.

Thanks and Regards,
Shabana Khan
LinkedIn <https://in.linkedin.com/pub/shabana-khan/40/229/454>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Reagrding ingesting one more attributes to the XMLs

2017-08-28 Thread shabana khan
Hi Siva,

I am not sure what you are trying to achieve exactly but if you don't want
to use node-replace and have a fixed structured existing XMLs then you can
go for typeswitch() function to add the new namespace to the book node.

Hope it helps!

Thanks,
Shabana

Thanks and Regards,
Shabana Khan
LinkedIn <https://in.linkedin.com/pub/shabana-khan/40/229/454>




On Mon, Aug 28, 2017 at 4:42 PM, Mani, Sivasubramani (ELS) <
s.m...@elsevier.com> wrote:

> HiTeam,
>
>
>
> I need to add one more attributes to the old XML tag. Without using  node
> replacement. But I don’t know how to add it, kindly suggest XDMP methods
> regarding the same.
>
>
>
>
>
> eg: My file is book.xml
>
> 
>
> http://www.team.com/xml/document/schema; 
> xmlns:dp="http://www.team.com/xml/common/doc-properties/schema;>
>
> TCP/IP Illustrated
>
> StevensW.
>
> Addison-Wesley
>
> 65.95
>
> 
>
>
>
> 
>
> Advanced Programming in the Unix environment
>
> StevensW.
>
> Addison-Wesley
>
> 65.95
>
> 
>
>
>
> 
>
>
>
>
>
> I need to add one more name space (i.e. xmlns) in the above xml without
> using node replacement. Kindly suggest xdmp methods regarding the same.
>
>
>
>
>
>
>
> Thanks & Regards,
>
> Siva
>
>
>
> ___
> 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] Regarding versioning of documents without using DLS.

2017-07-10 Thread shabana khan
Hi All,

Has anyone come across a scenario where you need to support editing of
documents but keeping the original document intact but not using DLS for
versioning thing.

We need to track the different states in which a document can be possibly
present at any point : that requires some kind of versioning being attached
to the most recent copy of document.

But we don't intend to use DLS for that and plan to combine collection plus
permissions to be able to see the documents from the final collection only.

 We do have a rough draft covering different scenarios but not a concrete
plan.

Any suggestions will be highly appreciated to give us a good start.

Thanks and Regards,
Shabana Khan
LinkedIn <https://in.linkedin.com/pub/shabana-khan/40/229/454>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Regarding encoding in Marklogic

2017-04-26 Thread shabana khan
Hi Mani,

It works correctly for me.
The junk letters show up if the encoding is not utf-8, for ANSI encoding it
shows these junk characters.
Could you share some more details of your problem.

Thanks and Regards,
Shabana Khan
LinkedIn <https://in.linkedin.com/pub/shabana-khan/40/229/454>




On Wed, Apr 26, 2017 at 4:48 PM, Mani, Sivasubramani (ELS) <
s.m...@elsevier.com> wrote:

> Hi Team,
>
>
>
> I saved the node value “*M’hamed el Aisati*”  using xdmp:save() after
> that while open the file it shows some junk letters instead of  “*M’hamed
> el Aisati*” , even I use utf-8 encode option in the xdmp:save.
>
> Kindly do the needful.
>
>
>
> Thanks & Regards,
>
> Siva
>
>
>
> ___
> 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] Error while sending AJAX request to Marklogic

2017-02-23 Thread shabana khan
Hi All,

We are trying to send an ajax request to MarkLogic server for accessing
some data.
When we call the service, we are getting this error :

XMLHttpRequest cannot load {ML service}No 'Access-Control-Allow-Origin'
header is present on the requested resource.Origin
'http://localhost:{port-no}' is therefore not allowed access.

Can anyone suggest as to what can be done at MarkLogic end or do we need to
resolve this while sending the request.

Thanks and Regards,
Shabana Khan
LinkedIn <https://in.linkedin.com/pub/shabana-khan/40/229/454>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Regarding Search API response in Ml-8

2016-10-06 Thread shabana khan
Hi All,

We are planning to move our application on ML-8. The JSON response being
returned by Search REST API In ML-6 was giving us :

   -
   - content:
   - {
   - resource:
   - {
   - identifier:


The UI team was using this "content" field for getting the data.
Now in ML-8 in place of "content",we get "matches" :

matches: {
resource: {
identifier:

For this he UI will need to make changes everywhere across the application
So, we are looking for some feasible solution on Marklogic side itself so
that we get our response as "content" as we were getting in Marklogic 6.
Can anyone suggest something if someone faced similar issues.

   -
  -
  -

Thanks and Regards,
Shabana Khan
LinkedIn <https://in.linkedin.com/pub/shabana-khan/40/229/454>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Regarding compilation of schema for validation.

2016-05-10 Thread shabana khan
Hi Erik,

Thanks for your input.

The requirement is like we need to do 2-step validation :
1. Validation against the schema which we have in place.
2. Validation against the schematron.

Currently it is being validated against the schema but it is not checking
for the schematron part present in the schema file. So, we are planning to
compile it into xslt and then validate the document.

Thanks and Regards,
Shabana Khan
LinkedIn <https://in.linkedin.com/pub/shabana-khan/40/229/454>




On Tue, May 10, 2016 at 1:14 AM, Erik Hennum <erik.hen...@marklogic.com>
wrote:

> Hi, Shabana:
>
> > We need to compile our XSD file into XSLT so that we can use a compiled
> version for validation
>
> Is there a reason you can't use the MarkLogic builtin support for
> validating a document
> against an XSD?
>
> If you insert an XML Schema into the schema database for your content
> database and
> restart the server, you should be able to validate documents against the
> schema using
> either an XQuery validate expression:
>
> https://www.w3.org/TR/xquery-30/#id-validate
>
> or the MarkLogic validate function:
>
> http://docs.marklogic.com/xdmp:validate
>
> The builtin validation will almost certainly be faster than an XSLT
> invocation.
>
> The other question is whether your Schematron compiler supports compiling
> an XSD.
>
>
> Hoping that helps,
>
>
> Erik Hennum
>
>
> ----------
> *From:* general-boun...@developer.marklogic.com [
> general-boun...@developer.marklogic.com] on behalf of shabana khan [
> shabana.0...@gmail.com]
> *Sent:* Monday, May 09, 2016 7:18 AM
> *To:* General@developer.marklogic.com
> *Subject:* [MarkLogic Dev General] Regarding compilation of schema for
> validation.
>
> Hi All,
>
> We need to compile our XSD file into XSLT so that we can use a compiled
> version for validation
> When we use *sch:compile-schema($schematron) *and give schematron as
> input it successfully generates the XSLT.
> But we have as input an XSD which comprises both schematron part and
> schema part like we do have *pattern elements *and *schema elements *as
> well*.*
> We are getting errors :
> *sc:compile-schema($schematron) -- Invalid coercion*
>
> Can anyone give suggestion regarding this.
>
>
>
>
>
>
>
> ___
> 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] Regarding compilation of schema for validation.

2016-05-09 Thread shabana khan
Hi All,

We need to compile our XSD file into XSLT so that we can use a compiled
version for validation
When we use *sch:compile-schema($schematron) *and give schematron as input
it successfully generates the XSLT.
But we have as input an XSD which comprises both schematron part and schema
part like we do have *pattern elements *and *schema elements *as well*.*
We are getting errors :
*sc:compile-schema($schematron) -- Invalid coercion*

Can anyone give suggestion regarding this.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general