Hi again,
in case it can help, I got back to a version that doesn't throw any 1012 exception.
The only one difference I see is that I had removed the &callback=? in the query
+++
Maud
Doesn't throw any 1012 :
// loading the lexique
window.onload = function() {
$.ajax({
dataType: "json",
url: 'http://devictio:devictio@basex.tge-adonis.fr/rest/DonLexique',
data : "method=jsonml&query=//list&callback=?",
beforeSend: function(xhr) {
// doesn't work, requires auth in the url...
//xhr.setRequestHeader("Authentication", "Basic " + Base64.encode("devictio:devictio"));
xhr.setRequestHeader( "ContentType" , "application/json" );
}, //may need to use "Authorization" instead
error: function(jqXHR, textStatus, errorThrown){
alert(textStatus + ": " + errorThrown);
},
success: function(result){
alert("ok ! " + result);
// fabriquer l'arbre dépliable avec liens cliquables
}
});
Throws a 1012 :
// loading the lexique
window.onload = function() {
$.ajax({
dataType: 'json',
url: 'http://devictio:devictio@basex.tge-adonis.fr/rest/DonLexique',
data : 'query=//list&method=jsonml',
beforeSend: function(xhr) {
// doesn't work, requires auth in the url...
// xhr.setRequestHeader("Authorization", "Basic " + Base64.encode("devictio:devictio"));
xhr.setRequestHeader("Content-Type", "application/json");
//xhr.overrideMimeType("application/j-son;charset=UTF-8");
}, //May need to use "Authorization" instead
error: function(jqXHR, textStatus, errorThrown){
alert(textStatus + " " + errorThrown);
},
success: function(result){
alert("ok ! " + result);
// fabriquer l'arbre dépliable avec liens cliquables
}
});
};
Hello everybody,
I am very new at BaseX http server, and at jQuery, and at this mailing list too :)
Concerning the error you got Colin :
thrown error: [Exception... "Access to restricted URI denied" code: "1012"...
I suddenly have the same problem though basex and my files have the same domain :
http://hyperdonat.tge-adonis.fr/basex/basex.html
(The basex server is here : http://basex.tge-adonis.fr/rest)
I had other problems before this with my script, but not this one, and I don't know what I did that produced it...
MaudOn Fri, Oct 21, 2011 at 12:00 PM, <basex-talk-request@mailman.uni-konstanz.de> wrote:
Send BaseX-Talk mailing list submissions to
basex-talk@mailman.uni-konstanz.de
To subscribe or unsubscribe via the World Wide Web, visit
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
or, via email, send a message with subject or body 'help' to
basex-talk-request@mailman.uni-konstanz.de
You can reach the person managing the list at
basex-talk-owner@mailman.uni-konstanz.de
When replying, please edit your Subject line so it is more specific
than "Re: Contents of BaseX-Talk digest..."
Today's Topics:
1. Re: Performance of Basex 7.0 XQuery execution (Christian Gr?n)
2. Re: Performance of Basex 7.0 XQuery execution (Jan Vl?insk? (CAD))
3. Clustering/replicating? (Pascal Heus)
4. Re: ajax and http server - cross-domain, jsonp or proxy?
(colin mcenearney)
----------------------------------------------------------------------
Message: 1
Date: Thu, 20 Oct 2011 15:43:50 +0200
From: Christian Gr?n <christian.gruen@gmail.com>
To: Constantine Hondros <Constantine.Hondros@tomtom.com>
Cc: "basex-talk@mailman.uni-konstanz.de"
<basex-talk@mailman.uni-konstanz.de>
Subject: Re: [basex-talk] Performance of Basex 7.0 XQuery execution
Message-ID:
<CAP94bnPYC2abLTiQJkBPt1_WquH6ix8OQeU6HnJtxCa+cp-5Vg@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Hi Constantine,
> The XPath I showed was just a simple example of using the preceding-sibling axis.
I guessed so already.. Thanks for persisting ;)
> I guess what I am asking is ... while most XPath queries I run are quick to resolve, anything using preceding::, preceding-sibling:: or following::, following-sibling:: essentially runs too slowly to be workable - at least, on my sample dataset with about 100K sibling children of the root element.
>
> So is this any sort of known issue? Should I be looking at any sort of configuration options? Is there any way to profile the execution of the Xpath?
It's true that BaseX is mostly optimized for descendant and ancestor
operations. In particular, the preceding/preceding-sibling axes will
always be slower, as our storage does not contain backward pointers to
preceding nodes. I'm pretty sure, though, that there are ways to
either optimize relevant queries or the internal optimizer strategies,
but we'll probably have to spend some more time on analyzing the
relevant bottlenecks..
Feel free to ask for more,
Christian
------------------------------
Message: 2
Date: Thu, 20 Oct 2011 19:20:29 +0200
From: Jan Vl?insk? (CAD) <jan.vlcinsky@cad-programs.com>
To: Christian Gr?n <christian.gruen@gmail.com>
Cc: "basex-talk@mailman.uni-konstanz.de"
<basex-talk@mailman.uni-konstanz.de>
Subject: Re: [basex-talk] Performance of Basex 7.0 XQuery execution
Message-ID:
<CAAq9E_fb5KymrtL=xosGsH=BuP4aWpgip0OWxDJUAHANqqO1Ng@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi Constantine
Just my side note.
As far as I remember, I found this sort of performance discussion with most
the XQuery processors I have tested (Sedna, Zorba, Saxon, eXist...). Each
time related to sibling, preceding etc. and each time explaining, that
indices are not containing pointers for tracking this relationship. My
feeling is, this could lead to much bigger index file and slower performance
when adding documents and indexing.
My conlcusion is - optimizing this sort of queries has its cost and mostly
it is better (and somehow possible) to avoid these constructions.
With best regards
Jan
*Ing. Jan Vl?insk?*
CAD programy
Slune?nicov? 338/3, 734 01 Karvin? R?j, Czech Republic
tel: +420-597 602 024; mob: +420-608 979 040
skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com
http://cz.linkedin.com/in/vlcinsky
On 20 October 2011 15:43, Christian Gr?n <christian.gruen@gmail.com> wrote:
> Hi Constantine,
>
> > The XPath I showed was just a simple example of using the
> preceding-sibling axis.
>
> I guessed so already.. Thanks for persisting ;)
>
> > I guess what I am asking is ... while most XPath queries I run are quick
> to resolve, anything using preceding::, preceding-sibling:: or following::,
> following-sibling:: essentially runs too slowly to be workable - at least,
> on my sample dataset with about 100K sibling children of the root element.
> >
> > So is this any sort of known issue? Should I be looking at any sort of
> configuration options? Is there any way to profile the execution of the
> Xpath?
>
> It's true that BaseX is mostly optimized for descendant and ancestor
> operations. In particular, the preceding/preceding-sibling axes will
> always be slower, as our storage does not contain backward pointers to
> preceding nodes. I'm pretty sure, though, that there are ways to
> either optimize relevant queries or the internal optimizer strategies,
> but we'll probably have to spend some more time on analyzing the
> relevant bottlenecks..
>
> Feel free to ask for more,
> Christian
> _______________________________________________
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.uni-konstanz.de/pipermail/basex-talk/attachments/20111020/7b1f08e3/attachment-0001.htm>
------------------------------
Message: 3
Date: Thu, 20 Oct 2011 16:01:35 -0400
From: Pascal Heus <pascal.heus@gmail.com>
To: basex-talk <basex-talk@mailman.uni-konstanz.de>
Subject: [basex-talk] Clustering/replicating?
Message-ID: <4EA07E1F.5090506@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
All:
We're looking into possibly building large scale infrastructure around
BaseX and wondering if there is any information available around
database replication (read replicas) and running BaseX in clusters?
Also, when I submit a query to a BaseX server, is there a way to limit
the amount of time/resources the query can comsume? For example, can I
say 'fail this query if it takes more than 30 seconds or 1Gb of memory'?
many thanks
*P
------------------------------
Message: 4
Date: Thu, 20 Oct 2011 21:51:36 -0700 (PDT)
From: colin mcenearney <colinmcenearney@yahoo.com>
To: Christian Gr?n <christian.gruen@gmail.com>
Cc: "basex-talk@mailman.uni-konstanz.de"
<basex-talk@mailman.uni-konstanz.de>
Subject: Re: [basex-talk] ajax and http server - cross-domain, jsonp
or proxy?
Message-ID:
<1319172696.11095.YahooMailNeo@web34501.mail.mud.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi Christian and Michael, and everyone.
Thanks for your replies.
I'm still having a little difficulty.Attempting to return results with method=jsonml I still get this error (using jquery's ajax methods):
thrown error: [Exception... "Access to restricted URI denied" code: "1012"
which I think is a result of sending an http-request across different ports.
I think my question might be clearer with some background:? My idea for a simple app to learn the db is a blog, where each entry has its own xml file which contains, among other things, chunks of valid xhtml. I was envisioning a very simple interaction where javascript sends a get or post request and the db returns bits of xhtml.
Can this be done without the use of additional server-side scripting? Maybe with direct calls to an xquery file like http://mysite.com/blog/blog.xq?categ=xmldb&level=beginner ?
Colin
________________________________
From: Christian Gr?n <christian.gruen@gmail.com>
To: colin mcenearney <colinmcenearney@yahoo.com>
Cc: "basex-talk@mailman.uni-konstanz.de" <basex-talk@mailman.uni-konstanz.de>
Sent: Tuesday, October 18, 2011 11:54 AM
Subject: Re: [basex-talk] ajax and http server - cross-domain, jsonp or proxy?
Dear Colin,
thanks for your e-mail.
> I'm not really a developer so this might be an obvious question: using
> basex's http server, what is the best strategy for ajax-style communication
> between browser and db?
As Michael already pointed out, there is no "unique" strategy how to
use BaseX with AJAX. One popular way is to use our new "json"
serialization method, which allows you to directly return JSON from
BaseX. A small example:
1. Start the HTTP server via "basexhttp -l" (the -l flag will
communicate with the local database context; this way, no other socket
connection will be used)
2. Via REST, retrieve a document or run a query and specify "jsonml"
as output method:
http://localhost:8984/rest/database/doc.xml?method=jsonml
This way, the XML result will be directly serialized, using the JSONML
syntax. If you have created your XML documents from JSON input files,
you may as well use "json" as serialization format. Pleave check out
our documentation as well:
? http://docs.basex.org/wiki/JSON_Functions
Feel free to ask if this is not exactly what you are looking for.
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.uni-konstanz.de/pipermail/basex-talk/attachments/20111020/aefba1ea/attachment-0001.htm>
------------------------------
_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
End of BaseX-Talk Digest, Vol 22, Issue 20
******************************************
--Maud IngaraoIHPC (UMR 5037)
Institut d’histoire de la pensée classique, de l’Humanisme aux Lumières
Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322
15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07
+33 4 37 37 65 79 - maud.ingarao@ens-lyon.fr
cerphi.ens-lyon.fr - pensee-classique.ens-lyon.fr
institutdesanti.ens-lyon.fr - hyperdonat.ens-lyon.fr
mutec-shs.fr - projet-plume.org - ahn.ens-lyon.fr
http://www.cahier.paris-sorbonne.fr/
- je suis absente le vendredi - out of office on Fridays -