Hi,
sscce below: Sequence1: Action: curl -i -X PUT "http://localhost:8984/basex/jax-rx/abcde" curl -i -X POST -H "Content-Type: text/xml" -d "<HelloWorld/>" "http://localhost:8984/basex/jax-rx/abcde/subA/docA"
Expectation: Creation of docA in subcollection subA under collection abcde
Actual: Creation of document named subAdocA in collection abcde
Sequence2: Action: curl -i -X POST -H "Content-Type: text/xml" -d "<HelloWorld/>" "http://localhost:8984/basex/jax-rx/abcde/subA/docA"
Expectation: Two documents with the same name in the same collection (at same hierarchy level) should be disallowed.
Actual: Two documents with the same name in the same collection (at same hierarchy level) are allowed.
I do not know how things will work later when xquery operations will be invoked using document name (i.e., which one will be fetched out of the two documents, since both have the same name).
curl -i -X POST -H 'Content-Type: application/query+xml' -d '<query xmlns="http://jax-rx.sourceforge.net"><text>for $doc in collection("abcde") return base-uri($doc)</text></query>' 'localhost:8984/basex/jax-rx/' HTTP/1.1 200 OK Content-Type: text/xml Content-Length: 246 Server: Jetty(6.1.26)
<jax-rx:results xmlns:jax-rx="http://jax-rx.sourceforge.net%22%3Ejax-rx:resultfile:(somePath)/subAdocA</jax-rx:result>jax-rx:resultfile:(somePath)/subAdocA</jax-rx:result></jax-rx:results>
A delete using document name deletes all documents with the same name at the same hierarchy level: curl -i -X DELETE "http://localhost:8984/basex/jax-rx/abcde/subAdocA" HTTP/1.1 200 OK Content-Type: text/plain Transfer-Encoding: chunked Server: Jetty(6.1.26)
2 document(s) deleted in 1.2 ms.
Regards, Mahender
----- Original Message ----- From: "Christian GrĂ¼n" christian.gruen@gmail.com To: "Mahender Didwania" mahender@didwania.co.uk Cc: "basex-talk" basex-talk@mailman.uni-konstanz.de Sent: Wednesday, December 15, 2010 4:26:41 PM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [basex-talk] Hierarchical collections via REST
I am using 6.3.4, but if I send a post request to /server/collection/subcollection, only the collection gets created (and the document is added to collection, not to subcollection).
Could you provide us with an sscce that allow us to reproduce the issue?
In view of the above, could you please throw more light on how the subcollections can be created using REST and how documents can be added to subcollections using REST?
The documentation will be updated with the upcoming official release.
Best, Christian
basex-talk@mailman.uni-konstanz.de