[MarkLogic Dev General] Error by DM SDK on ML 8.0.6
Hi, I keep getting below error while loading the data from a file into ML 8.x using DataMovement SDK. Same code is working fine with 9.x. Any advice? Error. Exception in thread "main" com.marklogic.client.ResourceNotFoundException: Local message: Could not read resource at internal/forestinfo. Server Message: Request failed. Error body not received from server at com.marklogic.client.impl.JerseyServices.checkStatus( JerseyServices.java:4297) ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] DataHub Issue
Hi, I am getting below error when I try to load the input flow in my Linux box. Same is working in local ( Mac OS) and checked the path/file permissions. All are accessable. Any advise? ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.marklogic.client.ResourceNotFoundException: Local message: Could not read resource at resources/flow. Server Message: The requested flow was not found] with root cause com.marklogic.client.ResourceNotFoundException: Local message: Could not read resource at resources/flow. Server Message: The requested flow was not found Here is the DataHub generated MLCP command. mlcp.sh import -mode local -host localhost -port 8010 -username user -password -input_file_path /home/xyz/data-hub/input/employee -input_file_type "delimited_text" -output_collections "Claims,load-claims,input" -output_permissions "rest-reader,read,rest-writer,update" -output_uri_replace "/home/xyz/data-hub/input/employee,''" -document_type "json" -generate_uri true -transform_module "/com.marklogic.hub/mlcp-flow-transform.xqy" -transform_namespace "http://marklogic.com/data-hub/mlcp-flow-transform"; -transform_param "entity=Employee,flow=load-employee,flowType=input" ___ 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 155, Issue 32
Thanks Gary, Looks like ML 8.5.5 /9.x doesn't have cts:maximum-value, cts:minimum-value. I tried with cts:min, cts:max, throwing XDMP-NONMIXEDCOMPLEXCONT error. Any advise? Thanks Shan. On Wed, May 24, 2017 at 7:44 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. Ignoring empty/null values while search (Gary Vidal) >2. Priorities for queries (Gary Vidal) >3. Re: Schema validation fails for certain XMLs > (Karunanithi, Bharathi) >4. Re: Schema validation fails for certain XMLs #CGO# > (Jain, Abhishek) > > > -- > > Message: 1 > Date: Wed, 24 May 2017 06:56:47 -0400 > From: Gary Vidal > Subject: [MarkLogic Dev General] Ignoring empty/null values while > search > To: general@developer.marklogic.com > Message-ID: > mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Shiv, > > The problem is quite simple to solve. The first thing is to determine what > is empty. Mostly empty can be the non-existence of the element and second > an empty element. Simply just add an additional negated > cts.notQuery(cts.propertyValueQuery(...)). This will filter out empty > dob > documents during projection of results. > > Q2. > > What you are expecting cannot be done simply because age is a temporal > value and MarkLogic operates on stored values. So you cannot simple > determine age without coding it for each document. But lets make some > assumptions that dob is just xs:date value and the simplest way to extract > out each bucket is quite simple: > > xquery version "1.0-ml"; > (:Get current year:) > let $today := fn:current-date() > (:Get Current Range of DOB to get years:) > let $dob-ranges := cts:value-ranges( >cts:json-property-reference("dob"), >() > ) > (:Get range of years to calculate > Any arithmetic between to dates results in a duration. > :) > let $years := fn:years-from-duration($today - > $dob-ranges/cts:minimum-value) to fn:years-from-duration($today - > $dob-ranges/cts:maximum-value) > let $year-dates := $years ! ($today - > xs:yearMonthDuration(fn:concat("P",.,"Y"))) > let $year-ranges := cts:value-ranges( >cts:json-property-reference("dob"), >$year-dates >) > let $year-map := json:object-define($years ! fn:string(.)) > return ( > (:Iterate all year-ranges and calculate age :) >for $yr in $year-ranges >let $year := fn:years-from-duration($today - $yr/cts:maximum-value) >return > map:put($year-map,$year,cts:frequency($yr)), > $year-map > ) > > (:Enjoy:) > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20170524/7f2b48be/attachment-0001.html > > -- > > Message: 2 > Date: Wed, 24 May 2017 06:58:17 -0400 > From: Gary Vidal > Subject: [MarkLogic Dev General] Priorities for queries > To: general@developer.marklogic.com > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > Oleksii, > > Why dont you just create 2 app servers. 1 for query traffic and 1 for > admin > > Regards > > Gary > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20170524/c07cea6b/attachment-0001.html > > -- > > Message: 3 > Date: Wed, 24 May 2017 11:27:53 + > From: "Karunanithi, Bharathi" > Subject: Re: [MarkLogic Dev General] Schema validation fails for > certain XMLs > To: MarkLogic Developer Discussion > Message-ID: > namprd02.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > Can I please get any help on the below issue? > > From: general-boun...@developer.marklogic.com [mailto:general-bounces@ > developer.marklogic.com] On Behalf Of Karunanithi, Bharathi > Sent: Tuesday, May 23, 2017 5:20 PM > To: MarkLogic Developer Discussion > Subject: [MarkLogic Dev General] Schema validation fails for certain XMLs > > Hi Team, > > I am getting the following validation error in MarkLogic 8.0-6.4 hosted on > a AWS EC2 instance. But certain xml files fails the validation against the > Schema particularly in this environment alone. > Same XML passes the validation in other ML environments and also from > other standalone validation tools using Schemas. > > The used Schema files are attached in Zip format. Major Schema file being >
[MarkLogic Dev General] Ignoring empty/null values while search
Hi, How can I skip empty/null values as my dob property has empty ("") string for some of the documents and below error is giving error XDMP-LEXVAL: xs.date("") -- Invalid lexical value "" Query: cts.search(cts.andQuery([cts.jsonPropertyRangeQuery("dob", '>', fn.currentDate().subtract(xs.yearMonthDuration("P25Y"))),cts.collectionQuery("col-1")])); And Q2: Any sample for group-by age by extracting date from dob? Thanks Shan. ___ 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 155, Issue 24
Hi Justin, Thanks for introducing jsonPropertyReference. I see some of the dob is empty ("") and it is kicking exception. I see a bit of challenging here. I could able aggregate numbers/count by using cts.values, but facing difficulties in aggregating by datewise and grouping them. The scenario is content: {"dob":"1977-06-20", "dob":"", "dob":"1980-06-20","dob":"1977-06-20"} Expected result is {"0": 20, "1": 2, "4": 0}; I am using the below workaround for the age, but we want to achieve similar to this using dob by ignoring any missing dobs. Any help? var ageQuery = cts.andQuery([ cts.elementRangeQuery(xs.QName('age'), ">=", 0), cts.elementRangeQuery(xs.QName('age'), "<=", 100) ]); var result = {}; for (var agegroup of cts.values(cts.elementReference(xs.QName('age')), null, null, query)){ var query = cts.andQuery([ ageQuery, cts.jsonPropertyValueQuery('age', agegroup) ]); result[agegroup] = cts.estimate(query); } result; Thanks Shan. On Tue, May 23, 2017 at 3:24 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. Search by age wise from dob property (Shiv Shankar) >2. Re: Search by age wise from dob property (Justin Makeig) >3. Processing Large Number of Docs to GetStatistics (Eliot Kimber) >4. Re: Priorities for queries (Geert Josten) > > > -- > > Message: 1 > Date: Mon, 22 May 2017 16:08:11 -0400 > From: Shiv Shankar > Subject: [MarkLogic Dev General] Search by age wise from dob property > To: MarkLogic Developer Discussion > Message-ID: > mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi, > There is a dob json property in the documents and I need to search on dob > based on age wise i.e age > 30, age >30 and age <50. Any samples to > calculate age and compare in the search queries? > > Thanks > Shan. > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20170522/34d2f34c/attachment-0001.html > > -- > > Message: 2 > Date: Mon, 22 May 2017 20:33:06 + > From: Justin Makeig > Subject: Re: [MarkLogic Dev General] Search by age wise from dob > property > To: MarkLogic Developer Discussion > Message-ID: <600acf55-4384-4294-bbf9-74700a4a8...@marklogic.com> > Content-Type: text/plain; charset="us-ascii" > > const person = { dob: xs.date("1979-02-03") }; > const thrirtyYearsAgo = fn.currentDate().subtract(xs. > yearMonthDuration("P30Y")); > person.dob < thrirtyYearsAgo; // true > > You can do date math with xs.duration types. In the above case, I'm > subtracting 30 years from the current date. xs.date.prototype.subtract() > returns an xs.date. You can compare that xs.date to any other xs.date. To > do this comparison in MarkLogic's indexes you'll need to create a range > index <https://docs.marklogic.com/guide/concepts/indexing#id_51573>. A > range index, as its name implies, queries efficiently for ranges of typed > values, for example, dates less than thirty ago from today. > > cts.rangeQuery(cts.jsonPropertyReference('dob'), '<', thrirtyYearsAgo); > // requires a range index of type xs:date on the dob JSON property > > > Justin > > > > On May 22, 2017, at 1:08 PM, Shiv Shankar > wrote: > > > > Hi, > > There is a dob json property in the documents and I need to search on > dob based on age wise i.e age > 30, age >30 and age <50. Any samples to > calculate age and compare in the search queries? > > > > Thanks > > Shan. > > > > > > > > ___ > > General mailing list > > General@developer.marklogic.com > > Manage your subscription at: > > http://developer.marklogic.com/mailman/listinfo/general > > > > -
[MarkLogic Dev General] Search by age wise from dob property
Hi, There is a dob json property in the documents and I need to search on dob based on age wise i.e age > 30, age >30 and age <50. Any samples to calculate age and compare in the search queries? Thanks Shan. ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] Different estimates while doing search
Hi, I've created a range index on ptype and ran the below queries and I am getting the difference in count. What could be the reason? Any advice? // This one is getting lesser results cts.estimate(cts.andQuery([cts.jsonPropertyRangeQuery('ptype', "=", "25"),cts.collectionQuery(["COLLECTION-1"])])); // This one is getting accurate results. cts.estimate(cts.andQuery([cts.jsonPropertyValueQuery("ptype","25"),cts.collectionQuery("COLLECTION-1")])); Regards Shan. ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
Re: [MarkLogic Dev General] Scramble production data for testing in ML 8.x
Thanks Greet. - Hi Shan, Rather than doing it on ingest, you should do the scrambling on export (note: redaction is an export option as well). Unfortunately, MLCP does not allow transformation at export, but it does allow that on copy. You could write your own transform that obfuscates sensitive data. Another alternative might be using CORB2.. Kind regards, Geert ___ 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
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] General Digest, Vol 153, Issue 19
Hi Greet, First thing is it is in dateTime. I tried with another field that has date only. Same issue with the below query as it is fetching all records that are not matching also. I tested with LT, LS. No difference. Secondly, tried extracting only first 10 digits to compare the date only out of dateTime, I see no option when using with REST search query. Please advise if we have source with dateTime and searching only with date in REST call. Thanks Shan. On Thu, Mar 16, 2017 at 5:28 PM, 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. Re: Element Range Index query not working (Dave Cassel) > > > -- > > Message: 1 > Date: Thu, 16 Mar 2017 21:28:22 + > From: Dave Cassel > Subject: Re: [MarkLogic Dev General] Element Range Index query not > working > To: MarkLogic Developer Discussion > Message-ID: > Content-Type: text/plain; charset="us-ascii" > > http://developer.marklogic.com/mailman/listinfo/general > > -- > Dave Cassel, @dmcassel<https://twitter.com/dmcassel> > Technical Community Manager > MarkLogic Corporation<http://www.marklogic.com/> > http://developer.marklogic.com/ > > > From: mailto:general- > boun...@developer.marklogic.com>> on behalf of Mat Gritt < > mat.gr...@solnet.co.nz<mailto:mat.gr...@solnet.co.nz>> > Reply-To: MarkLogic Developer Discussion <mailto:general@developer.marklogic.com>> > Date: Thursday, March 16, 2017 at 5:12 PM > To: MarkLogic Developer Discussion <mailto:general@developer.marklogic.com>> > Subject: Re: [MarkLogic Dev General] Element Range Index query not working > > How do I unsubscribe to this list? > > Thank you for your help > > > Mat > > From: mailto:general- > boun...@developer.marklogic.com>> on behalf of Geert Josten < > geert.jos...@marklogic.com<mailto:geert.jos...@marklogic.com>> > Reply-To: MarkLogic Developer Discussion <mailto:general@developer.marklogic.com>> > Date: Friday, 17 March 2017 at 10:09 AM > To: MarkLogic Developer Discussion <mailto:general@developer.marklogic.com>> > Subject: Re: [MarkLogic Dev General] Element Range Index query not working > > Hi Shan, > > You search on a date that is larger than the two dates in the data, and > also specify GT (Greater Than). That will not match either of the > startDates. Have you tried with LT or LE? > > Not sure if it is relevant, but you provide a date to a dateTime query. > > Kind regards, > Geert > > From: mailto:general- > boun...@developer.marklogic.com>> on behalf of Shiv Shankar < > shiv.shivshan...@gmail.com<mailto:shiv.shivshan...@gmail.com>> > Reply-To: MarkLogic Developer Discussion <mailto:general@developer.marklogic.com>> > Date: Thursday, March 16, 2017 at 8:53 PM > To: MarkLogic Developer Discussion <mailto:general@developer.marklogic.com>> > Subject: [MarkLogic Dev General] Element Range Index query not working > > Hi, > My below query below is failing by fetching all data. > > sample data: > { > "pid": 1, > "fname": "", > "lname": "", > "pinfo": [ > { > "screen": "1", > "startDate": "2003-02-13T19:18:21.810Z", > "endDate": "" > }, > { > "screen": "2", > "startDate": "2002-02-13T19:18:21.810Z", > "endDate": "" > } > ] > } > > > Search > Post: > {"query":{"queries":[{"range-query":{"type":"dateTime"," > json-property":"startDate","value":"2004-05-25","range-operator":"GT"}}]}} > > Note: created element range index on startDate. > > Any advise for REST service to compare between the two dates ( that has > timestamp) ( I did with QBE also)? > > Thanks > Shan. > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20170316/3b141182/attachment.html > > -- > > ___ > General mailing list > General@developer.marklogic.com > Manage your subscription at: > http://developer.marklogic.com/mailman/listinfo/general > > > End of General Digest, Vol 153, Issue 19 > > ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] Element Range Index query not working
Hi, My below query below is failing by fetching all data. sample data: { "pid": 1, "fname": "", "lname": "", "pinfo": [ { "screen": "1", "startDate": "2003-02-13T19:18:21.810Z", "endDate": "" }, { "screen": "2", "startDate": "2002-02-13T19:18:21.810Z", "endDate": "" } ] } Search Post: {"query":{"queries":[{"range-query":{"type":"dateTime","json-property":"startDate","value":"2004-05-25","range-operator":"GT"}}]}} Note: created element range index on startDate. Any advise for REST service to compare between the two dates ( that has timestamp) ( I did with QBE also)? Thanks Shan. ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
Re: [MarkLogic Dev General] Finding target geocodes using REST API
Hi Erik, Thanks for the quick update. Is there a way I can enable below geospatial document vocabularies using REST? var lat=; var long=; cts.search(cts.andQuery([ cts.jsonPropertyPairGeospatialQuery("geoCoordinates", "lat", "lng", cts.circle(20, cts.point(lat, long))),cts.collectionQuery(["ADDRESS_COLLECTION"])])); Thanks Shan. --- Hi, Shiv: QBE doesn't support geospatial document vocabularies at present. You may want to raise this issue through your support contact. Erik Hennum On Fri, Feb 24, 2017 at 11:09 AM, Shiv Shankar wrote: > Hi, > I could able to achieve finding the nearest addresses based on the > starting geo codes in a circle with in the given distance using SJava > Script API in the qconsole and I wanted to achive the same using REST. I > see very less documentation and I found these part of Options in a QBE. Any > help on this please? > > My address structure > "address":{ > "fullAddress":"Unknown address", > "geoCoordinates" : > { > "lat": 41.335747 > "lng:-72.06697 > } > > > > http://localhost:8081/LATEST/qbe?query={"$query":{}} > { > "parent-property": "geoCoordinates", > "lat-property": "lat", > "lon-property": "lng", > "geo-option": "5 miles" > } > > Thanks > Shan. > ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] Finding target geocodes using REST API
Hi, I could able to achieve finding the nearest addresses based on the starting geo codes in a circle with in the given distance using SJava Script API in the qconsole and I wanted to achive the same using REST. I see very less documentation and I found these part of Options in a QBE. Any help on this please? My address structure "address":{ "fullAddress":"Unknown address", "geoCoordinates" : { "lat": 41.335747 "lng:-72.06697 } http://localhost:8081/LATEST/qbe?query={"$query":{}} { "parent-property": "geoCoordinates", "lat-property": "lat", "lon-property": "lng", "geo-option": "5 miles" } Thanks Shan. ___ 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 152, Issue 18
HI Sam, Thanks for the reply. -Shan. On Wed, Feb 8, 2017 at 1:28 PM, 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. Re: XML to JSON using MLCP (Sam Mefford) >2. Re: Is xdml:unquote appropriate for handling accent > characters? (Kari Cowan) >3. Re: Is xdml:unquote appropriate for handling accent > characters? (Indrajeet Verma) > > > -- > > Message: 1 > Date: Tue, 7 Feb 2017 22:53:37 + > From: Sam Mefford > Subject: Re: [MarkLogic Dev General] XML to JSON using MLCP > To: MarkLogic Developer Discussion > Message-ID: > Content-Type: text/plain; charset="windows-1252" > > Have you looked at using a transform? Here's an example from the docs< > https://docs.marklogic.com/guide/mlcp/import#id_17589> that converts from > binary to XML, so I'm guessing you can convert from XML to JSON. > > Sam Mefford > Senior Engineer > MarkLogic Corporation > sam.meff...@marklogic.com<mailto:sam.meff...@marklogic.com> > Cell: +1 801 706 9731 > www.marklogic.com<http://www.marklogic.com> > > This e-mail and any accompanying attachments are confidential. The > information is intended > solely for the use of the individual to whom it is addressed. Any review, > disclosure, copying, > distribution, or use of this e-mail communication by others is strictly > prohibited. If you > are not the intended recipient, please notify us immediately by returning > this message to > the sender and delete all copies. Thank you for your cooperation. > > > On 2/7/2017 3:16 PM, Shiv Shankar wrote: > Hi, > I am using nested xml and used -input_file_type aggregates since it is a > nested XML. I see them inserting as XML documents. Is there way I can > insert them as json documents using MLCP? > > > Thanks > Shan. > > > > ___ > General mailing list > General@developer.marklogic.com<mailto:General@developer.marklogic.com> > Manage your subscription at: > http://developer.marklogic.com/mailman/listinfo/general > > > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20170207/44ea05ff/attachment-0001.html > > -- > > Message: 2 > Date: Wed, 8 Feb 2017 18:10:58 + > From: Kari Cowan > Subject: Re: [MarkLogic Dev General] Is xdml:unquote appropriate for > handling accent characters? > To: MarkLogic Developer Discussion > Message-ID: <864f9079-bee8-44be-a3e5-c3d9a986b...@alm.com> > Content-Type: text/plain; charset="utf-8" > > I guess I can make it palatable with the function I added below ? then > have them unfurl it on the front end. When I pulled actual doc source ? > even though ?Pok?mon? displayed in Qconsole, it was actually encoded as > è > > declare function do:makeXMLsafe( $Str as xs:string ) { > let $Str:=fn:escape-html-uri($Str) > return $Str > }; > > >> changes ?Pok?mon? to ?Pok%C3%A9mon? > > Is there any better way to deal with it? > > > From: on behalf of Kari Cowan < > kco...@alm.com> > Reply-To: MarkLogic > Date: Tuesday, February 7, 2017 at 2:34 PM > To: MarkLogic > Subject: Re: [MarkLogic Dev General] Is xdml:unquote appropriate for > handling accent characters? > > (note outlook stripped out the unknown character below, in the > node it was ?Pok?mon? > > > From: Kari Cowan > Date: Tuesday, February 7, 2017 at 2:31 PM > To: MarkLogic > Subject: Is xdml:unquote appropriate for handling accent characters? > > The doc contains a node with text including an accent grave, example: > > VOIR DIRE: Pok?mon Drive? > > I tried to handle it with: > let $theTitle:=xdmp:unquote($theTitle, "", ("repair-full")) > > But I still get an output with an unknown character in xml > > VOIR DIRE: Pokmon Drive? > > >> XML Parsing Error: not well-formed > > Anyone have a tip they can share on how to handle it? > -- next
[MarkLogic Dev General] XML to JSON using MLCP
Hi, I am using nested xml and used* -input_file_type aggregates* since it is a nested XML. I see them inserting as XML documents. Is there way I can insert them as json documents using MLCP? Thanks Shan. ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] sort-order is not working as expected
Hi, I am using sort-order option in "search" query, but the results are not in order as expected i.e it is same order for Ascending/descending. I created an range-index too. Any advise? Query: http://localhost:8080/LATEST/qbe?query={ "search":{"$query":{"$filter":true,"options":{"sort-order":[{"direction":"ascending","element":"age"}]&collection=TEST-COLL Thanks Shan. ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] MarkLogic 9.0 release
Hi, Any updates on MarkLogic 9.0 GA? Thanks Shan. ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
Re: [MarkLogic Dev General] sort-order is not working with REST
Hi Eric, Yes, range index is there for that field. --Shan. On Wed, Jan 4, 2017 at 2:03 PM, Shiv Shankar wrote: > Thanks Eric, > With this change, I could get the data, but no order change though the > sort-order specified ascending/descending. > Lets say firstName is "abc", "xyz", the query returning the response in > the same order irrespective of sort-order. Am I missing anything? > > Regards > Shan. > > On Wed, Jan 4, 2017 at 12:05 PM, Shiv Shankar > wrote: > >> Hi, >> I am trying to use sort-order in $query. It is returning 0 records. All >> my documents are JSON. Any inputs? >> >> {"$query":{"options":{"sort-order":[{"direction":"descending >> ","element":{"name":"firstName","score": null}}]}}} >> >> Tried with >> {"$query":{"options":{"sort-order":[{"direction":"descending >> ","json-property":"firstName"}]}}} >> >> Note: I created Index on that field too. >> >> >> Regards >> Shan. >> > > ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
Re: [MarkLogic Dev General] sort-order is not working with REST
Thanks Eric, With this change, I could get the data, but no order change though the sort-order specified ascending/descending. Lets say firstName is "abc", "xyz", the query returning the response in the same order irrespective of sort-order. Am I missing anything? Regards Shan. On Wed, Jan 4, 2017 at 12:05 PM, Shiv Shankar wrote: > Hi, > I am trying to use sort-order in $query. It is returning 0 records. All > my documents are JSON. Any inputs? > > {"$query":{"options":{"sort-order":[{"direction":" > descending","element":{"name":"firstName","score": null}}]}}} > > Tried with > {"$query":{"options":{"sort-order":[{"direction":" > descending","json-property":"firstName"}]}}} > > Note: I created Index on that field too. > > > Regards > Shan. > ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] sort-order is not working with REST
Hi, I am trying to use sort-order in $query. It is returning 0 records. All my documents are JSON. Any inputs? {"$query":{"options":{"sort-order":[{"direction":"descending","element":{"name":"firstName","score": null}}]}}} Tried with {"$query":{"options":{"sort-order":[{"direction":"descending","json-property":"firstName"}]}}} Note: I created Index on that field too. Regards Shan. ___ 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 150, Issue 24
Thank you Eric, Regards Shan. On Wed, Dec 21, 2016 at 3:00 PM, 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. Re: Search for empty falues (Erik Hennum) > > > -- > > Message: 1 > Date: Wed, 21 Dec 2016 01:40:59 + > From: Erik Hennum > Subject: Re: [MarkLogic Dev General] Search for empty falues > To: MarkLogic Developer Discussion > Message-ID: > marklogic.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi, Shiv: > > > I need to search for empty values for a given key > > You might need to use a cts.query() constructor instead of QBE for this > kind of query. > > Given this test document: > > xdmp.documentInsert('/test/testdoc.json', {test1:"value", test2:null, > test3:""}); > > If "empty" means null, you can use: > > jsearch.documents().where(cts.jsonPropertyValueQuery('test2', > null)).result(); > > If "empty" means an empty string, you can use: > > jsearch.documents().where(cts.jsonPropertyValueQuery('test3', > "")).result(); > > If "empty" means the absence of a property, you can use: > > jsearch.documents().where(cts.notQuery(cts. > jsonPropertyScopeQuery('test4', cts.trueQuery(.result(); > > > Hoping that helpsl, > > > Erik Hennum > > > > From: general-boun...@developer.marklogic.com [general-bounces@developer. > marklogic.com] on behalf of Shiv Shankar [shiv.shivshan...@gmail.com] > Sent: Tuesday, December 20, 2016 10:13 AM > To: MarkLogic Developer Discussion > Subject: [MarkLogic Dev General] Search for empty falues > > Hi, > I need to search for empty values for a given key, Tried below, but > resulted nothing. I see values with empty in the collection. Any advice? > > jsearch.documents().where(jsearch.byExample({EMP_ID: ""})).result(); > > Thanks > Shan. > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20161221/82a29b80/attachment-0001.html > > -- > > ___ > General mailing list > General@developer.marklogic.com > Manage your subscription at: > http://developer.marklogic.com/mailman/listinfo/general > > > End of General Digest, Vol 150, Issue 24 > > ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] Search for empty falues
Hi, I need to search for empty values for a given key, Tried below, but resulted nothing. I see values with empty in the collection. Any advice? jsearch.documents().where(jsearch.byExample({EMP_ID: ""})).result(); Thanks Shan. ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
Re: [MarkLogic Dev General] mlcp Transaction Errors - SVC-EXTIME and XDMP-NOTXN #CGO#
Hi Abhishek, I had this thread configuration in my list, but did not try with that. Since it worked for you, let me try. Thanks for confirming. Shan. On Tue, Dec 6, 2016 at 11:00 AM, Jain, Abhishek < abhishek.b.j...@capgemini.com> wrote: > Hi shiv, > > I have answer a similar query earlier. Will surEly work for you as well. > Please check below.. > > Sent with Good Work (www.blackberry.com) > On 23 Sep 2016 8:45 pm, Stuart Myles wrote: > > Thanks! This helped me prevent the errors from occurring and - as a bonus > - significantly sped up my ingestion. > > I couldn't use exactly the mlcp command line you suggested, since - in the > version of mlcp I'm using - -input_file_type xml isn't allowed, I had to > use -input_file_type documents instead. Also, my input files don't need to > be split. However, bumping up the threads used (to 30 in my case) made the > transaction / timeout complaints go away. And now I'm ingesting 100,000 > documents in 12 minutes, rather than one hour. Much better! > > Regards, > > Stuart > > > > On Fri, Sep 23, 2016 at 3:34 AM, Jain, Abhishek < > abhishek.b.j...@capgemini.com> wrote: > >> Hi Stuart, >> >> >> >> MLCP comes with various options, and can be used in various combinations >> depending on the file size, memory available and >> >> Other number of nodes, forest etc. >> >> >> >> If you want to try a quick solution you can try this mlcp command : >> >> *mlcp import -host yourhost -port 8000 -username userName -password >> PASSWORD -input_file_type xml -input_file_path TempData -thread_count >> -thread_count_per_split 3 -batch_size 200 -transaction_size 20 >> -max_split_size 33554432 -split_input true* >> >> change username, input file type etc accordingly. >> >> It’s always good to use splits and threads when working with huge dataset. >> >> Some performance matrix you can consider while using above mlcp : >> >> 1. In app server settings you can check if connection time out is >> set to 0. >> >> 2. Default spilt size is 32MB, if you can change *-max_split_size >> 33554432 *( it take in bytes, if your file is bigger ) >> >> 3. Make sure split and thread ratio remains 1:2 or 1:3 for example >> >> If your document size is 10 MB, and your split size is 1000,000 (1 MB) >> then 10/1 = 10 splits >> >> Then you should create 20 or 30 thread for best CPU utilization. >> >> 4. The above mlcp does well with 150 Million rows, should work for >> you as well. >> >> 5. I assume you have a nice good RAM > 4GB alteast. >> >> >> >> Thanks and Regards, >> >> [image: Email_CBE.gif]Abhishek Jain >> >> Associate Consultant >> >> Capgemini India | Hyderabad >> >> >> >> *From:* general-boun...@developer.marklogic.com [mailto: >> general-boun...@developer.marklogic.com] *On Behalf Of *Stuart Myles >> *Sent:* Thursday, September 22, 2016 11:52 PM >> *To:* MarkLogic Developer Discussion >> *Subject:* [MarkLogic Dev General] mlcp Transaction Errors - SVC-EXTIME >> and XDMP-NOTXN >> >> >> >> When I'm loading directories of slightly fewer than 100,000 XML files >> into a large MarkLogic instance, I often get timeout and transaction >> errors. If I re-run the same directory of files which got those errors, I >> typically don't get any errors. >> >> >> >> So, I have a few questions: >> >> >> >> * Can I get prevent the errors from happening in the first place - e.g. >> by tuning MarkLogic parameters or altering my use of mlcp? >> >> * If I do get errors, what is the best way to get a report on the files >> which failed, so I can retry just those ones? Is the best option for me to >> write some code to pick out the errors from the log file? And, if so, am I >> guaranteed to get all of the files reported? >> >> >> >> Some Details >> >> >> >> The command line template is >> >> >> >> mlcp.sh import -username {1} -password {2} -host localhost -port {4} >> -input_file_path {5} -output_uri_replace \"{6},'{7}'\" >> >> >> >> Sometimes, the imports run just fine. However, often I get a large number >> of SVC-EXTIME errors followed by a XDMP-NOTXN error. For example: >> >> >> >> 16/09/22 17:54:03 ERROR mapreduce.ContentWriter: SVC-EXTIME: Time limit >> exceeded >> >> 16/09/22 17:54:03 WARN mapreduce.ContentWriter: Failed document >> 029ccd8ac3323658277ca28fead7a73d.0.xml in file:/mnt/ingestion/MarkLogicI >> ngestion/smyles/todo/2014_0005.done/029ccd8ac3323658277c >> a28fead7a73d.0.xml >> >> 16/09/22 17:54:03 ERROR mapreduce.ContentWriter: SVC-EXTIME: Time limit >> exceeded >> >> 16/09/22 17:54:03 WARN mapreduce.ContentWriter: Failed document >> 02eb4562784255e249c4ec3ed472f9aa.1.xml in file:/mnt/ingestion/MarkLogicI >> ngestion/smyles/todo/2014_0005.done/02eb4562784255e249c4 >> ec3ed472f9aa.1.xml >> >> 16/09/22 17:54:04 INFO contentpump.LocalJobRunner: completed 33% >> >> 16/09/22 17:54:21 ERROR mapreduce.ContentWriter: XDMP-NOTXN: No >> transaction with identifier 9076269665213828952 >> >> >> >> So far, I'm just rerunning the entire directory again. Most of the time, >> it ingests f
[MarkLogic Dev General] MLCP is taking longer to upload 5GB
Hi, It took me more that 5 hours for 5 GB of data when I loaded with below command. And I see ForestReserve is getting spiked up while loading the data. I am using default params ( disabled all Indexes , FYI). Any advice to optimise and reduce the usage of ForestReserve. ./bin/mlcp.sh import -host localhost -port 8006 -username $ML_USERNAME -password $PWD -mode local -input_file_path /mlcp-8.0-5/archive -generate_uri -input_file_type delimited_text -output_uri_replace "^.*/arhive,''" -output_uri_prefix /URI -output_collections MY-COLLECTION -document_type json -tolerate_errors=true Thanks Shan. ___ 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 30
Thanks Greet, I am looking to Corb2 also. Regards Shan. On Mon, Nov 21, 2016 at 3:00 PM, 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. validate epub file using XSD (Rajesh Kumar) >2. Re: validate epub file using XSD (Geert Josten) >3. validate epub file using XSD (Rajesh Kumar) >4. Update entire collection in one singlerequest (Shiv Shankar) >5. Re: Update entire collection in one single request (Geert Josten) > > > -- > > Message: 1 > Date: Mon, 21 Nov 2016 12:35:34 +0530 > From: Rajesh Kumar > Subject: [MarkLogic Dev General] validate epub file using XSD > To: general@developer.marklogic.com > Message-ID: > fof1jeft...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Team, > > Is there any way to validate ePUB file using XSD in MarkLogic? and > transfrom using XSLT? > > Kindly let me know if there is any sample available. > > Regards, > Rajesh > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20161121/b6ccfe39/attachment-0001.html > > -- > > Message: 2 > Date: Mon, 21 Nov 2016 07:54:33 + > From: Geert Josten > Subject: Re: [MarkLogic Dev General] validate epub file using XSD > To: MarkLogic Developer Discussion > Message-ID: > Content-Type: text/plain; charset="windows-1252" > > Hi Rajesh, > > It would be something along the lines of unzipping the epub file with > xdmp:zip-manifest and xdmp:zip-get (assuming no encryption and such), and > then running code to apply xsd and xslt appropriately (which you?d have to > provide yourself). There are many ways to do so, but a few lines in QC > could already get you started. > > If your aim is to thoroughly validate epub, I?d recommend > https://github.com/IDPF/epubcheck, but that runs in Java. It does > consistency checks that go beyond XSD validation.. > > For your interest, Norm Walsh created an epub reader app on top of > MarkLogic a few years ago: https://github.com/ndw/epubreader > > Cheers, > Geert > > From: mailto:general- > boun...@developer.marklogic.com>> on behalf of Rajesh Kumar < > rajava...@gmail.com<mailto:rajava...@gmail.com>> > Reply-To: MarkLogic Developer Discussion <mailto:general@developer.marklogic.com>> > Date: Monday, November 21, 2016 at 8:05 AM > To: "general@developer.marklogic.com<mailto:general@developer. > marklogic.com>" mailto:general@developer. > marklogic.com>> > Subject: [MarkLogic Dev General] validate epub file using XSD > > Hi Team, > > Is there any way to validate ePUB file using XSD in MarkLogic? and > transfrom using XSLT? > > Kindly let me know if there is any sample available. > > Regards, > Rajesh > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20161121/9eb29c54/attachment-0001.html > > -- > > Message: 3 > Date: Mon, 21 Nov 2016 19:28:43 +0530 > From: Rajesh Kumar > Subject: [MarkLogic Dev General] validate epub file using XSD > To: general@developer.marklogic.com > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > Thanks Geert, > > Is there any example available to achieve the same functionality as > epubchecker ( java) within MarkLogic XQuery? > > Regards, > Rajesh > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20161121/5a1f5633/attachment-0001.html > > -- > > Message: 4 > Date: Mon, 21 Nov 2016 10:48:17 -0500 > From: Shiv Shankar > Subject: [MarkLogic Dev General] Update entire collection in one > single request > To: general@developer.marklogic.com > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8&quo
[MarkLogic Dev General] Update entire collection in one single request
Hi, Is there a xquery/JavaScript command to update a field in entire collection/all documents based on criteria in MarkLogic 8.0.5? I can achieve this with Jsearch in loop, but wanted to check if there is any single command? Thanks Shan. ___ 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
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: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi, > Any deeper-insight documents on MarkLogic 9.0 features? > > Regards > Shan. > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20161116/b84c83c5/attachment-0001.html > > -- > > Message: 2 > Date: Thu, 17 Nov 2016 08:12:56 + > From: "Jangam, Yogesh CWR" > Subject: [MarkLogic Dev General] Sharing Modules > To: "general@developer.marklogic.com" > > Message-ID: > <558b94cbfcb3ba498460b1bbf41029e036e24...@sgw20014212.gbl. > ad.hedani.net> > > Content-Type: text/plain; charset="us-ascii" > > 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<mailto:yogesh.jan...@credit-suisse.com> | > www.credit-suisse.com<http://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 > > === > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20161117/e503e0b6/attachment-0001.html > > -- > > Message: 3 > Date: Thu, 17 Nov 2016 08:30:03 + > From: Geert Josten > Subject: Re: [MarkLogic Dev General] Sharing Modules > To: MarkLogic Developer Discussion > Message-ID: > Content-Type: text/plain; charset="windows-1252" > > 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: mailto:general- >
[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] No option to pass query params in xdmp:http-get
Thanks Williams and Justin. I was pretty close to that. On Mon, Oct 31, 2016 at 12:01 PM, Shiv Shankar wrote: > Hi, > I tried calling an external ws with xdmp:http-get() which is deployed in > local host http://localhost:8080/q1=1&q2=2&q3=3 , it is throwing as > XDMP-ENTITYREF: (err:XPST0003) Invalid entity reference "q2=" > > I am trying to call external ws from console. Any advise? > > Regards > Shan. > ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] No option to pass query params in xdmp:http-get
Hi, I tried calling an external ws with xdmp:http-get() which is deployed in local host http://localhost:8080/q1=1&q2=2&q3=3 , it is throwing as XDMP-ENTITYREF: (err:XPST0003) Invalid entity reference "q2=" I am trying to call external ws from console. Any advise? Regards Shan. ___ 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 148, Issue 26
Hi David and Florent, Thanks for your reply. I tried below transaction settings, but throwing error declareUpdate({explicitCommit: true}), xdmp.setTransactionMode("update-auto-commit"), xdmp.documentInsert(newuri,odiObj,[xdmp.permission("rest-reader", "read"),xdmp.permission("rest-writer", "update")] ,materializedView,100), xdmp.commit(); My scenario: => While in the INITIAL state of a record, it looks in collection-1, if found, over-write the details else it creates a new document in another format in that collection-1. This continues in a loop of 5 records. For this I am using Content Processing Framework pipelines and triggers. Please advise. On Mon, Oct 17, 2016 at 3:00 PM, 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. Re: search after xdmp.documentInsert() getting 0 results > (David Gorbet) > > > -- > > Message: 1 > Date: Mon, 17 Oct 2016 17:44:15 + > From: David Gorbet > Subject: Re: [MarkLogic Dev General] search after > xdmp.documentInsert() getting 0 results > To: MarkLogic Developer Discussion > Message-ID: > <90D984E0D0F0624B80CC39BFFAA529B20CC901F5@EXCHG10-BE01. > marklogic.com> > Content-Type: text/plain; charset="utf-8" > > Note that this is not quite true. Changes to documents are not visible to > other code in the same statement, but when executing a multi-statement > transaction, changes made in one statement are visible to subsequent > statements within the same transaction. > > So a transaction can read a modification it has done itself, but only if > it is a multi-statement transaction. > > From: general-boun...@developer.marklogic.com [mailto:general-bounces@ > developer.marklogic.com] On Behalf Of Florent Georges > Sent: Sunday, October 16, 2016 5:03 AM > To: MarkLogic Developer Discussion > Subject: Re: [MarkLogic Dev General] search after xdmp.documentInsert() > getting 0 results > > > It looks like you try to read a document you inserted in the same > transaction. Which is in contradiction with how transactions work on > MarkLogic. > > You can think of it as the following simplification: all changes to > documents (including inserting new ones) are accumulated whilst your code > is executing, then actually written to the database when the transaction > automatically commits, after the code has completed. > > The same query therefore cannot read a modification it has done itself. > > Regards, > > On 16 Oct 2016 05:45, "Shiv Shankar" shiv.shivshan...@gmail.com>> wrote: > Hi, > I tried all the possibilities in fetching the results using jsearch.search > after using xdmp.documentInsert() ( I used declareUpdate() on top) in CPF > process, but resulting no documents in the collection. After this process, > when I do same search , I get the results. > I used xdmp.commit() exclusively but in vein. > Why it s taking time to persists the documents in to the database when I > do with JavaScript? Any thoughts. > > Reegards > Shiv. > > > > > > ___ > General mailing list > General@developer.marklogic.com<mailto:General@developer.marklogic.com> > Manage your subscription at: > http://developer.marklogic.com/mailman/listinfo/general > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20161017/3b3fc640/attachment-0001.html > > -- > > ___ > General mailing list > General@developer.marklogic.com > Manage your subscription at: > http://developer.marklogic.com/mailman/listinfo/general > > > End of General Digest, Vol 148, Issue 26 > > ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] search after xdmp.documentInsert() getting 0 results
Hi, I tried all the possibilities in fetching the results using jsearch.search after using xdmp.documentInsert() ( I used declareUpdate() on top) in CPF process, but resulting no documents in the collection. After this process, when I do same search , I get the results. I used xdmp.commit() exclusively but in vein. Why it s taking time to persists the documents in to the database when I do with JavaScript? Any thoughts. Reegards Shiv. ___ 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 147, Issue 53
Hi Justin I'm simply copying some of the values from first-collection into second colleciton on finding the values in 2nd collection based on search criteria. Here is my entire code for one record. If there are multiple records in first-collection, then this conflict is occuring. Code declareUpdate(); var json = "/MarkLogic/json/json.xqy"; var cpf = require("/MarkLogic/cpf/cpf.xqy"); var dls = require("/MarkLogic/dls.xqy"); var jsearch = require("/MarkLogic/jsearch.sjs"); var transition; //var doc = cts.doc(uri).toObject(); //var id = doc.personId; var id = "1234"; var rawColls = require("/MarkLogic/jsearch.sjs").collections(["first-collection"]); var matColl = require("/MarkLogic/jsearch.sjs").collections(['second-collection']); var rawJson; var count=0; var matViewUri =null; var rawUri = null; // Reading from RAW Sources. var tempObj = rawColls.documents() .where(rawColls.byExample({personId: id})) .result(); var length = 0; var rawResponse = rawColls.documents() .where(rawColls.byExample({personId: id})) .result('iterator'); if ( tempObj.estimate != 0 ) { rawUri = tempObj.results.uri; var materialView = matColl.documents() .where(matColl.byExample({personId: id})).result(); if (materialView.results!=null) { // If records found in the second collection View. matViewUri = materialView.results[0].uri; for (var result of rawResponse.results) { var newObj = {}; var matOriginalDoc = cts.doc(matViewUri); var dateNow =new Date().toUTCString(); // if (doc.firstname !=null) newObj.firstName = result.document.firstname; // if (doc.lastName !=null) newObj.lastName = result.document.lastname; // if (doc.dateOfBirth !=null) newObj.dateOfBirth = result.document.dob; // if (doc.city !=null) newObj.city = result.document.city; newObj.modifiedDate = new Date().toUTCString(); count++; xdmp:eval('xdmp.nodeReplace(matOriginalDoc,newObj)',newObj,{ "isolation" : "different-transaction", "preventDeadlocks" : true }); } } else { // create new document in 2nd collection for that PersonId; xdmp.log(">>>> Create a new document"); } } else { xdmp.log(">>>> ERROR: NO RECORDS FOUND IN first collection"); } On Mon, Oct 3, 2016 at 3:28 PM, Justin Makeig wrote: > I still don't understand what your code is trying to do. Can you please > describe in words what you're trying to accomplish? Where does `matViewUri` > come from? How does it relate to `{personId: id}`? > > Justin > > > > On Oct 3, 2016, at 7:08 AM, Shiv Shankar > wrote: > > > > Hi Justin, > > Here is the actual code that returns XDMP-CONFLICTINGUPDATES Error:. > > > > --- > > declareUpdate(); > > var mainDataResponse = > > rawColls.documents() > > .where(rawColls.byExample({personId: id})) > > .result('iterator'); > > > > for (var result of mainDataResponse.results) { > > > > var normalizedViewObj = cts.doc(matViewUri).toObject(); > > > > var matOriginalDoc = cts.doc(matViewUri); > > > > var dateNow =new Date().toUTCString(); > > > > // if (doc.firstname !=null) > > normalizedViewObj.firstName = result.document.firstname; > > > > // if (doc.lastName !=null) > > normalizedViewObj.lastName = result.document.lastname; > > // if (doc.dateOfBirth !=null) > > normalizedViewObj.dateOfBirth = result.document.dob; > > > > xdmp.nodeReplace(cts.doc(matViewUri),normalizedViewObj), > > normalizedViewObj = null; > > > > } > > > > --- > > > > On Thu, Sep 29, 2016 at 3:00 PM, marklogic.com> 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. Re: General Digest, Vol 147, Issue 51 (Justin Makeig) > > > > > > ---------- > > > > Message: 1 > > Date: Thu, 29 Sep 2016 16:32:44 + > > From: Justin M
Re: [MarkLogic Dev General] General Digest, Vol 147, Issue 53
Hi Justin, Here is the actual code that returns XDMP-CONFLICTINGUPDATES Error:. --- declareUpdate(); var mainDataResponse = rawColls.documents() .where(rawColls.byExample({personId: id})) .result('iterator'); for (var result of mainDataResponse.results) { var normalizedViewObj = cts.doc(matViewUri).toObject(); var matOriginalDoc = cts.doc(matViewUri); var dateNow =new Date().toUTCString(); // if (doc.firstname !=null) normalizedViewObj.firstName = result.document.firstname; // if (doc.lastName !=null) normalizedViewObj.lastName = result.document.lastname; // if (doc.dateOfBirth !=null) normalizedViewObj.dateOfBirth = result.document.dob; xdmp.nodeReplace(cts.doc(matViewUri),normalizedViewObj), normalizedViewObj = null; } --- On Thu, Sep 29, 2016 at 3:00 PM, 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. Re: General Digest, Vol 147, Issue 51 (Justin Makeig) > > > -- > > Message: 1 > Date: Thu, 29 Sep 2016 16:32:44 + > From: Justin Makeig > Subject: Re: [MarkLogic Dev General] General Digest, Vol 147, Issue 51 > To: Shiv Shankar > Cc: "general@developer.marklogic.com" > > Message-ID: <22fded82-fc67-4aad-b1f9-2eecb5b6a...@marklogic.com> > Content-Type: text/plain; charset="us-ascii" > > Can you show your actual code? > > Justin > > > -- > Justin Makeig > Director, Product Management > MarkLogic > jmak...@marklogic.com > > > > On Sep 29, 2016, at 7:09 AM, Shiv Shankar > wrote: > > > > HI Justin, > > Thanks for your quick reply. However, I used both > declareUpdate({explicitCommit: true}); and declareUpdate(); Still same > issue. > > > > I am just reading from one collection and updating into another document > in a different collection. I managed with insertDocument, but this over > writes the docs which I don't want. I just want to update the attributes ( > it is like UPDATE SET field1:=value, field2=value in loop in oracle world) > > > > Note: I used lock/unlock options, but getting no lock on that target > record. I used isolation level as part of eval. Couldn't get through it. > > XDMP-CONFLICTINGUPDATES: xdmp.eval("//{explicitCommit: > true}\ndeclareUpdate(); \nvar json = \"/Mark...", {}, xmlns="xdmp:eval">67298589469423423423/) > --Conflicting updates xdmp.nodeReplace(cts.doc(" > > > > > > Any thoughts? > > > > On Thu, Sep 29, 2016 at 7:55 AM, marklogic.com> 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. Re: XDMP-CONFLICTINGUPDATES: whileusing xdmp.nodeReplace > > (Justin Makeig) > >2. Re: mlcp Transaction Errors - SVC-EXTIME and XDMP-NOTXN #CGO# > > (Jain, Abhishek) > > > > > > -- > > > > Message: 1 > > Date: Wed, 28 Sep 2016 21:02:26 + > > From: Justin Makeig > > Subject: Re: [MarkLogic Dev General] XDMP-CONFLICTINGUPDATES: while > > using xdmp.nodeReplace > > To: MarkLogic Developer Discussion > > Message-ID: <4136b8ca-113a-4373-b6d3-e54d34f15...@marklogic.com> > > Content-Type: text/plain; charset="us-ascii" > > > > The general pattern for doing updates on persisted JSON documents in > JavaScript is to > > 1) get the document > > 2) turn it into an object > >
Re: [MarkLogic Dev General] General Digest, Vol 147, Issue 51
HI Justin, Thanks for your quick reply. However, I used both declareUpdate({explicitCommit: true}); and declareUpdate(); Still same issue. I am just reading from one collection and updating into another document in a different collection. I managed with insertDocument, but this over writes the docs which I don't want. I just want to update the attributes ( it is like UPDATE SET field1:=value, field2=value in loop in oracle world) Note: I used lock/unlock options, but getting no lock on that target record. I used isolation level as part of eval. Couldn't get through it. XDMP-CONFLICTINGUPDATES: xdmp.eval("//{explicitCommit: true}\ndeclareUpdate(); \nvar json = \"/Mark...", {}, 67298589469423423423/) --Conflicting updates xdmp.nodeReplace(cts.doc(" Any thoughts? On Thu, Sep 29, 2016 at 7:55 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. Re: XDMP-CONFLICTINGUPDATES: whileusing xdmp.nodeReplace > (Justin Makeig) >2. Re: mlcp Transaction Errors - SVC-EXTIME and XDMP-NOTXN #CGO# > (Jain, Abhishek) > > > -- > > Message: 1 > Date: Wed, 28 Sep 2016 21:02:26 + > From: Justin Makeig > Subject: Re: [MarkLogic Dev General] XDMP-CONFLICTINGUPDATES: while > using xdmp.nodeReplace > To: MarkLogic Developer Discussion > Message-ID: <4136b8ca-113a-4373-b6d3-e54d34f15...@marklogic.com> > Content-Type: text/plain; charset="us-ascii" > > The general pattern for doing updates on persisted JSON documents in > JavaScript is to > 1) get the document > 2) turn it into an object > 3) update the object > 4) replace the document node with the updated object > > Here's an example that updates the `balance` property of every document in > the `accounts` collection: > > declareUpdate(); > for(var doc of fn.collection('accounts')) { > var account = doc.toObject(); > account.balance = account.balance * 1.05; > xdmp.nodeReplace(doc, account); > } > > Note that you also need a declareUpdate(). The transaction is committed > (or rolledback) automatically, so you don't need the xdmp.commit(). > > Justin > > -- > Justin Makeig > Director, Product Management > MarkLogic > jmak...@marklogic.com > > > On Sep 28, 2016, at 1:46 PM, Shiv Shankar > wrote: > > > > Hi Rob, > > Thanks for quick reply, > > > > Here is the sample scenario. > > > > I would be building random data and put in to newObjData in a for loop. > > > > 01.json = {"firstName": "abc", "lastName": "xyz"} > > > > newObjectData.firstName= "Donald"; > > > > for Loop > > { > > xdmp.nodeReplace(cts.doc("/test/01.json"),newObjectData); > > xdmp.commit(); > > } > > > > > > > > > > > > On Wed, Sep 28, 2016 at 4:37 PM, Rob Szkutak > wrote: > > Hi, > > > > Do you have a reproducible case of this I could look at? > > > > Best, > > Rob > > > > Rob Szkutak > > Senior Consultant > > MarkLogic Corporation > > rob.szku...@marklogic.com > > www.marklogic.com > > > > From: Shiv Shankar [shiv.shivshan...@gmail.com] > > Sent: Wednesday, September 28, 2016 3:35 PM > > To: general@developer.marklogic.com; Rob Szkutak > > Subject: XDMP-CONFLICTINGUPDATES: while using xdmp.nodeReplace > > > > Hi Rob, > > > > I am getting XDMP-CONFLICTINGUPDATES: while using xdmp.nodeReplace to > update JSON attributes in FOR loop, instead of over-writing entire > document. Any advice. > > > > BTW, I used xdmp.eval, but it is not identifying the java script > variables. > > > > Thanks > > ShivShankar. > > > > ___ > > General mailing list > > General@developer.marklogic.com > > Manage your subscription at: > > http://developer.marklogic.com/mailman/listinfo/general > > > > > -- > > Message: 2 >
Re: [MarkLogic Dev General] XDMP-CONFLICTINGUPDATES: while using xdmp.nodeReplace
Hi Rob, Thanks for quick reply, Here is the sample scenario. I would be building random data and put in to newObjData in a for loop. 01.json = {"firstName": "abc", "lastName": "xyz"} newObjectData.firstName= "Donald"; for Loop { xdmp.nodeReplace(cts.doc("/test/01.json"),newObjectData); xdmp.commit(); } On Wed, Sep 28, 2016 at 4:37 PM, Rob Szkutak wrote: > Hi, > > Do you have a reproducible case of this I could look at? > > Best, > Rob > > Rob Szkutak > Senior Consultant > MarkLogic Corporation > rob.szku...@marklogic.com > www.marklogic.com > > -- > *From:* Shiv Shankar [shiv.shivshan...@gmail.com] > *Sent:* Wednesday, September 28, 2016 3:35 PM > *To:* general@developer.marklogic.com; Rob Szkutak > *Subject:* XDMP-CONFLICTINGUPDATES: while using xdmp.nodeReplace > > Hi Rob, > > I am getting XDMP-CONFLICTINGUPDATES: while using xdmp.nodeReplace to > update JSON attributes in FOR loop, instead of over-writing entire > document. Any advice. > > BTW, I used xdmp.eval, but it is not identifying the java script variables. > > Thanks > ShivShankar. > ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] XDMP-CONFLICTINGUPDATES: while using xdmp.nodeReplace
Hi Rob, I am getting XDMP-CONFLICTINGUPDATES: while using xdmp.nodeReplace to update JSON attributes in FOR loop, instead of over-writing entire document. Any advice. BTW, I used xdmp.eval, but it is not identifying the java script variables. Thanks ShivShankar. ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] XDMP-CONFLICTINGUPDATES: while using xdmp.nodeReplace
Hi, I am getting XDMP-CONFLICTINGUPDATES: while using xdmp.nodeReplace to update JSON attributes, instead of over-writing entire document. Any advice. BTW, I used xdmp.eval, but it is not identifying the java script variables. Thanks ShivShankar. ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] Error :XDMP-CONFLICTINGUPDATES
Hi Rob, I was just constructing the $contents . Any thoughts? let $contents :={'key':'value'} return xdmp:invoke-function( function() {dls:document-insert-and-manage("/test/test001.json", fn:true(),$contents,(),(),"TEST-COLLECTION"), xdmp:commit() }, update ); ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] Error XDMP-CONFLICTINGUPDATES: xdmp:document-insert("/test/test001.json"
Hi, I'm keep getting this below error. Any thoughts. [1.0-ml] XDMP-CONFLICTINGUPDATES: xdmp:document-insert("/mmis/test001.json" my code is : return xdmp:invoke-function( function() {dls:document-insert-and-manage("/mmis/test001.json", fn:true(),$contents,(),(),"TEST-COLLECTION"), xdmp:commit() }, update ); ___ 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 147, Issue 16
Hi Indy, Thanks for your reply. I added same text to the mimetype-conditions.xqy, but saying condition failed. Can you share your working condition for mime-type as json to my personal email shiv.shivshan...@gmail.com? My condition is below and version is ML8.0-5.5 /MarkLogic/cpf/actions/mimetype-condition.xqy application/json Regards On Wed, Sep 14, 2016 at 7:24 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. Re: modules, conditions to validate JSON documents in CPF > (Indrajeet Verma) >2. index for dateTime comparsion not working properly > (vikas.sin...@cognizant.com) >3. Re: index for dateTime comparsion not working properly > (Mats Stellwall) > > > -- > > Message: 1 > Date: Wed, 14 Sep 2016 11:09:00 +0530 > From: Indrajeet Verma > Subject: Re: [MarkLogic Dev General] modules, conditions to validate > JSON documents in CPF > To: MarkLogic Developer Discussion > Message-ID: > mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hey Shiv, > > It's working fine to me with json documents as well. If you can send your > complete pipeline, I may try to point out issue. > > You may try to set log level "fine" and can see more granular level logs. > You might catch the issues your own. > > Also you may try adding logs in the xqy module > /MarkLogic/cpf/actions/mimetype-condition.xqy and see what content > type/mime type is being logged. > > let $_ := xdmp:log("content-type=" || $doc-content-type) > let $_ := xdmp:log($mime-type-patterns) > > Which version of ML are you using? > > Regards, > Indy > > On Wed, Sep 14, 2016 at 12:04 AM, Shiv Shankar > > wrote: > > > Hi, > > As part of Pipeline definition in Content Processing Framework, I need to > > handle JSON documents. I added below lines in the Pipeline file. But it > is > > unable to call action module. Please advise.' > > > > Note: added add-something to module. and the given tutorial is working > > for XML content. > > > > > > > > > > > > /MarkLogic/cpf/actions/mimetype-condition.xqy > > > > > > > > application/json > > > > > > > > > > > > > > > > do-something.xqy > > > > > > > > > > > > > > > > ___ > > General mailing list > > General@developer.marklogic.com > > Manage your subscription at: > > http://developer.marklogic.com/mailman/listinfo/general > > > > > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20160914/8cfb3201/attachment-0001.html > > -- > > Message: 2 > Date: Wed, 14 Sep 2016 10:54:17 + > From: > Subject: [MarkLogic Dev General] index for dateTime comparsion not > working properly > To: > Message-ID: > <883d8ff057fe8c47a77a6cf0b932c87f3fdb7...@ctsinchnsxmbs.cts.com> > Content-Type: text/plain; charset="us-ascii" > > Hi All, > > DateTime index in not working properly while writing json query. I have > created element range index for accessedTime. > > Example: We have content like as. > { > "audit": { > "accessedTime": "2016-09-14T06:04:00", > "data": { > "entries": [ > { > "name": "reportType", > "value": "Download" > } > ] > }, > "userName": "genuser", > "groups": { > "groupNames": [ > "Test", > "Test2" > ] > }, > "identifier": "9695071722831412392" > } > } > > When I am writing a query like > > let $from-date := "2016-09-13T00:00:00" > let $to-date := "2016-09-14T00:00:00" > let $query := cts:and-query(( >
[MarkLogic Dev General] modules, conditions to validate JSON documents in CPF
Hi, As part of Pipeline definition in Content Processing Framework, I need to handle JSON documents. I added below lines in the Pipeline file. But it is unable to call action module. Please advise.' Note: added add-something to module. and the given tutorial is working for XML content. /MarkLogic/cpf/actions/mimetype-condition.xqy application/json do-something.xqy ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] GET bulk data in array format
Hi, I am using QBE as part of search operation using REST and I am getting the result in multipart/mixed format with --BOUNDARY text along with meta-data, I am wondering is there a way I get these many documents combined in to an array[]. Ex: [ {K,V}, {K,v}, {K,V} ] Thanks Shiva. ___ 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 146, Issue 46
gt; > two ways to store and handle triples in Marklogic : UNMANAGED TRIPLES and > > MANAGED TRIPLE, we can discuss much if you want. > > > > Follow the link to see how I developped that small application : > > https://github.com/yimengael/marklogic-dataframework > > > > Gael > > > > > > Ga?l. > > > > -- > > > > > > > > On Wed, Aug 17, 2016 at 1:56 AM, Jain, Abhishek < > > abhishek.b.j...@capgemini.com> wrote: > > > > Hi Forks, > > > > > > > > I am a newbie to marklogic, I just want to migrate all my RDBMS data into > > marklogic. > > > > If anyone can just share with me the idea how to model simple > > Employee-Department > > > > Relationship in Marklogic and run join query . Do we need triples to > > achieve this ? If yes a simple example will do. > > > > Thanks in advance. > > > > > > > > Thanks and Regards, > > > > [image: Email_CBE.gif]Abhishek Jain > > > > Associate Consultant > > > > *People matter, results count.* > > > > > > > > This message contains information that may be privileged or confidential > > and is the property of the Capgemini Group. It is intended only for the > > person to whom it is addressed. If you are not the intended recipient, > you > > are not authorized to read, print, retain, copy, disseminate, distribute, > > or use this message or any part thereof. If you receive this message in > > error, please notify the sender immediately and delete all copies of this > > message. > > > > > > ___ > > General mailing list > > General@developer.marklogic.com > > Manage your subscription at: > > http://developer.marklogic.com/mailman/listinfo/general > > > > > > > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20160822/e09a157c/attachment-0001.html > -- next part -- > A non-text attachment was scrubbed... > Name: image002.gif > Type: image/gif > Size: 1616 bytes > Desc: not available > Url : http://developer.marklogic.com/pipermail/general/ > attachments/20160822/e09a157c/attachment-0002.gif > -- next part -- > A non-text attachment was scrubbed... > Name: image002.gif > Type: image/gif > Size: 1616 bytes > Desc: not available > Url : http://developer.marklogic.com/pipermail/general/ > attachments/20160822/e09a157c/attachment-0003.gif > > -- > > Message: 2 > Date: Tue, 23 Aug 2016 02:29:33 + > From: Erik Hennum > Subject: Re: [MarkLogic Dev General] Adding PDF to an existing json > documentusing Patch > To: MarkLogic Developer Discussion > Message-ID: > marklogic.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi, Shiv: > > Sorry, but I don't understand the question. > > You cannot store a PDF document and JSON document in a single document. > > A PDF document is a binary. A JSON document is a structured tree. > > You cannot patch a binary document. It is a black box without addressable > structure. > > What are the uris for the associated PDF and JSON documents? How are they > ingested. > > > Erik Hennum > > > > From: general-boun...@developer.marklogic.com [general-bounces@developer. > marklogic.com] on behalf of Shiv Shankar [shiv.shivshan...@gmail.com] > Sent: Monday, August 22, 2016 11:01 AM > To: general@developer.marklogic.com > Subject: [MarkLogic Dev General] Adding PDF to an existing json document > using Patch > > Hi Erik Hennum > > If I go with PUT, it is replacing the entire document,which is not > acceptable. > > How to add json document+pdf in one document ? > > I used below approach > 1. Added a PDF as a separate document and tried adding that uri as part of > PATCH to referring document, but getting message 204 > > curl --basic --user user:pwd -X POST -d@./patch.json \ > -i -H "Content-type: application/json" \ > -H "X-HTTP-Method-Override: PATCH" \ > 'http://localbox:9004/LATEST/documents?uri=/test/LW88899' > > and patch.json is > > {"pathlang": "jsonpath", > > "patch": [ > > { > > "insert": { > > "context": "$.parent.childe", > > "position": "last-child", > > "content": { > > "image": "/example/scdhhs_fm_300.pdf" > > } > > } > > } > > ] > > } > > Message: > Response: > HTTP/1.1 204 Unchanged > Server: MarkLogic > Content-Length: 0 > Connection: Keep-Alive > Keep-Alive: timeout=5 > > -- next part -- > An HTML attachment was scrubbed... > URL: http://developer.marklogic.com/pipermail/general/ > attachments/20160823/914da743/attachment.html > > -- > > ___ > General mailing list > General@developer.marklogic.com > Manage your subscription at: > http://developer.marklogic.com/mailman/listinfo/general > > > End of General Digest, Vol 146, Issue 46 > > ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] Adding PDF to an existing json document using Patch
Hi Erik Hennum If I go with PUT, it is replacing the entire document,which is not acceptable. How to add json document+pdf in one document ? I used below approach 1. Added a PDF as a separate document and tried adding that uri as part of PATCH to referring document, but getting message 204 curl --basic --user user:pwd -X POST -d@./patch.json \ -i -H "Content-type: application/json" \ -H "X-HTTP-Method-Override: PATCH" \ 'http://localbox:9004/LATEST/documents?uri=/test/LW88899' and patch.json is {"pathlang": "jsonpath", "patch": [ { "insert": { "context": "$.parent.childe", "position": "last-child", "content": { "image": "/example/scdhhs_fm_300.pdf" } } } ] } Message: Response: HTTP/1.1 204 Unchanged Server: MarkLogic Content-Length: 0 Connection: Keep-Alive Keep-Alive: timeout=5 ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] Patch update PDF/binary data
Hi, I am getting when I do patch update of binary data to an existing json object. url -v -X POST --basic --user user:pwd --data-binary '@mydoc.pdf' -i -H "Content-type: application/binary" -H "X-HTTP-Method-Override: PATCH" ' http://localhost:8004/LATEST/documents?uri=/test/899' Error below::: {"errorResponse":{"statusCode":400, "status":"Bad Request", "messageCode":"RESTAPI-INVALIDREQ", "message":"RESTAPI-INVALIDREQ: (err:FOER) Invalid request: reason: patch is not or JSON patch object for uri: /test/899"}} Any advice or is there any other way like apart from insert binary and put that uri as patch to existing document? ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
[MarkLogic Dev General] Getting multiple documents using REST
Hi, I'm using QBE and have the parameters with 'Accept: multipart/mixed'. I'm getting the results as separate values. Is there a way I can get all results ( content) in one document ? Tried with Qbe params, but no success. Regards Shan ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general