Re: [basex-talk] SQL Module

2015-05-27 Thread Erol Akarsu
James,

I used it with ojdcs6 driver and it worked perfectly but I have not tested
with 1.7 driver. I guess it should work.
Nice thing with Basex SQL module is that you can export any size of sql
table to an xml file, there is no limitation.
I had to export huge SQL tables and BaseX did it perfectly,

Erol Akarsu

On Wed, May 27, 2015 at 12:57 PM, James Wright 
wrote:

> Hey Everyone,
>
> I am having issues with using the Oracle 1.7 JDBC driver.
>
> I copied the ojdbc7.jar file into the lib directory
> Ran the basexgui.bat to add to class path
> Tried to run this script:
>
> let $conn := sql:init('jdbc:oracle:thin:pnm/pnm@orc1n.giants')
> return
>   (sql:execute($conn, 'SELECT owner, table_name FROM dba_tables '),
>sql:close($conn))
>
> It states that it cannot initialize the jdbc:oracle:thin driver. Any ideas
> why that would be? Am I missing something?
>
> - James
>


Re: [basex-talk] 8.2 on Windows. RESTXQ demo doesn't work.

2015-05-22 Thread Erol Akarsu
Alexander,

No issue I am getting.Christian made it perfect.

I downloaded war file and unzip to somewhere. Then modify WEB-INF/web.xml
file. I modified these lines

  
org.basex.restxqpath
/home/eakarsu/apache-tomcat-8.0.22/basex
  
  
org.basex.dbpath
/home/eakarsu/apache-tomcat-8.0.22/basex/data
  
  
org.basex.repopath
/home/eakarsu/apache-tomcat-8.0.22/basex/repo
  

Copy files in WEB-INF folder contents to above configured location for
org.basex.restxqpath so that you will have this:

[eakarsu@norshin ~/apache-tomcat-8.0.22/basex]$ ls
datadbareporestxq.xqmstatic


Then build war file (BaseX82c.war)  again and drop it to webapps folder of
apache tomcat.

Restart apache.

You can access

http://localhost:8080/BaseX82c/dba

http://localhost:8080/BaseX82c/hello/World

Erol Akarsu


On Fri, May 22, 2015 at 4:20 AM, Alexander Shpack 
wrote:

> Hi BaseX team!
>
> It doesn't work, because WEBPATH contains (by default) a path to a local
> user's BaseXWeb folder, not to a webapp folder inside BaseX installation
> folder
>
> I was confused a bit, why clean installation of 8.2 doesn't work, when 8.1
> works fine
>
> Thanks
>
> --
> s0rr0w
>


Re: [basex-talk] Distributing queries to several on several processors

2015-04-22 Thread Erol Akarsu
Christian,

I think we should be able to attach BaseX to Apache spark. But integration
code need to be written.
Everybody is able to read from Hadoop,SOLR, ElasticSearch etc. to Spark and
process there.
Why not for BaseX?

Erol Akarsu

On Wed, Apr 22, 2015 at 4:28 AM, Christian Grün 
wrote:

> Hi Götz,
>
> > it would
> > make perfect sense to parallelize the query. Is there a way to achieve
> this
> > using xQuery?
>
> Our initial attempts to integrate low-level support for
> parallelization in XQuery turned out not to be as successful as we
> hoped they would be. One reason for that is that you can basically do
> everything with XQuery, and it's pretty hard to detect patterns in the
> code that are simple enough to be parallelized. Next to that, Java
> does not give us enough facilities to control CPU caching behavior.
>
> As you already indicated, you can simply run multiple queries in
> parallel by e.g. using Java threads or the BaseX client/server
> architecture (which by default allows 8 transactions in parallel [1]).
> If your queries do a lot of I/O, you will often get better performance
> by only allowing one transaction at a time, though. This is due to the
> random access patterns on your external drives (and in my experience,
> it also applies to SSDs). However, if you work with main-memory
> instances of databases, parallelization might give you some
> performance gains (albeit not as big as you might expect).
>
> Hope this helps,
> Christian
>
> [1] http://docs.basex.org/wiki/Options#PARALLEL
>


Re: [basex-talk] Xquery update performance on Base 8.1

2015-04-15 Thread Erol Akarsu
I am sorry for mistyping. It was jdk1.8.0_25.
I am not sure why I got that exception.
Maybe, it is disk I/O issue?
After I got above exception, my working folder had tons of files with names
consisting of digits. This may explain disk issue. What do you think?

Erol Akarsu

On Wed, Apr 15, 2015 at 2:40 PM, Christian Grün 
wrote:

> > Today, I am trying to export a Bade DB about 2.5G but getting error with
> JDK
> > 8.1
> >
> > With Basex 79 with JDK 7 was fine.
>
> So you mean you can export the same database with JDK 7, but not with
> JDK 8? This indicates you should probably stick with Java 7 and wait
> for newer versions of the JDK.
>
> What happens with JRE 8? Does JDK 8.1 exist at all? Afaik, the latest
> version is 8u45.
>
> C.
>
>
> >
> >> export AccumulatedProducts
> > Improper use? Potential bug? Your feedback is welcome:
> > Contact: basex-talk@mailman.uni-konstanz.de
> > Version: BaseX 7.9
> > Java: Oracle Corporation, 1.8.0_25
> > OS: Linux, amd64
> > Stack Trace:
> > java.lang.NegativeArraySizeException
> > at org.basex.io.random.DataAccess.readBytes(DataAccess.java:216)
> > at org.basex.io.random.DataAccess.readToken(DataAccess.java:194)
> > at org.basex.io.random.DataAccess.readToken(DataAccess.java:185)
> > at org.basex.data.DiskData.txt(DiskData.java:267)
> > at org.basex.data.DiskData.text(DiskData.java:235)
> > at org.basex.io.serial.Serializer.serialize(Serializer.java:459)
> > at org.basex.io.serial.Serializer.serialize(Serializer.java:335)
> > at org.basex.io.serial.Serializer.serialize(Serializer.java:135)
> > at org.basex.io.serial.Serializer.serialize(Serializer.java:115)
> > at org.basex.io.serial.Serializer.serialize(Serializer.java:105)
> > at org.basex.core.cmd.Export.export(Export.java:122)
> > at org.basex.core.cmd.Export.export(Export.java:66)
> > at org.basex.core.cmd.Export.run(Export.java:44)
> > at org.basex.core.Command.run(Command.java:329)
> > at org.basex.core.Command.execute(Command.java:94)
> > at org.basex.server.ClientListener.run(ClientListener.java:145)
> >
> >
> >
> > On Wed, Apr 15, 2015 at 3:06 AM, Christian Grün <
> christian.gr...@gmail.com>
> > wrote:
> >>
> >> Hi Erol,
> >>
> >> Could you possibly provide us with an sscce [1]?
> >>
> >> Thanks in advance,
> >> Christian
> >>
> >> [1] http://sscce.org/
> >>
> >>
> >>
> >> On Wed, Apr 15, 2015 at 4:11 AM, Erol Akarsu  wrote:
> >> >
> >> > Hello,
> >> >
> >> > I am having noticeable performance degradation for updating existing
> >> > database in this function with Basex 81.  I can say this function
> never
> >> > finish with 81. But when  I replace nodes call with file:append
> (writing
> >> > result to a file), I can see it is slowness.
> >> >
> >> > But Basex_79 is much faster than Basex81 with regard to this update
> and
> >> > finish this function quickly without any issue.
> >> >
> >> > I like to upgrade to 81 but because of this issue I could not.
> >> >
> >> > Can you help me?
> >> >
> >> > declare %updating function local:addCRMSegmentsIntoProducts ()
> >> > {
> >> >
> >> >  let $allProds := fn:doc("AccumulatedProducts")
> >> >  let $segments :=
> >> >
> >> >
> ("Aburcubur","Ãay_Kahve","İçecek","Karma_Az","Meyve_Sebze","Saç_Bakım","Süt_Su-Madeaze_Tüketim","Temizlik")
> >> >  let $productsMap :=
> >> > map:new(
> >> >   for $rec in $allProds//doc
> >> >   let $prodIDField := $rec/field[@name eq "ProductID"]
> >> >   let $pid := $prodIDField/text()
> >> > return
> >> >   map:entry($pid,$prodIDField))
> >> >
> >> >  for tumbling window $prodGroup in fn:doc("CRMSegments")//record
> >> >   start $first next $second when fn:true()
> >> >   end $last next $beyond when $last/PRODUCT_ID ne
> >> > $beyond/PRODUCT_ID
> >> >
> >> >   let $pid := $prodGroup[1]/PRODUCT_ID
> >> >   return
> >> >

Re: [basex-talk] Xquery update performance on Base 8.1

2015-04-15 Thread Erol Akarsu
Christian,

I will try to bring in this information for you.

Today, I am trying to export a Bade DB about 2.5G but getting error with
JDK 8.1

With Basex 79 with JDK 7 was fine.

> export AccumulatedProducts
Improper use? Potential bug? Your feedback is welcome:
Contact: basex-talk@mailman.uni-konstanz.de
Version: BaseX 7.9
Java: Oracle Corporation, 1.8.0_25
OS: Linux, amd64
Stack Trace:
java.lang.NegativeArraySizeException
at org.basex.io.random.DataAccess.readBytes(DataAccess.java:216)
at org.basex.io.random.DataAccess.readToken(DataAccess.java:194)
at org.basex.io.random.DataAccess.readToken(DataAccess.java:185)
at org.basex.data.DiskData.txt(DiskData.java:267)
at org.basex.data.DiskData.text(DiskData.java:235)
at org.basex.io.serial.Serializer.serialize(Serializer.java:459)
at org.basex.io.serial.Serializer.serialize(Serializer.java:335)
at org.basex.io.serial.Serializer.serialize(Serializer.java:135)
at org.basex.io.serial.Serializer.serialize(Serializer.java:115)
at org.basex.io.serial.Serializer.serialize(Serializer.java:105)
at org.basex.core.cmd.Export.export(Export.java:122)
at org.basex.core.cmd.Export.export(Export.java:66)
at org.basex.core.cmd.Export.run(Export.java:44)
at org.basex.core.Command.run(Command.java:329)
at org.basex.core.Command.execute(Command.java:94)
at org.basex.server.ClientListener.run(ClientListener.java:145)



On Wed, Apr 15, 2015 at 3:06 AM, Christian Grün 
wrote:

> Hi Erol,
>
> Could you possibly provide us with an sscce [1]?
>
> Thanks in advance,
> Christian
>
> [1] http://sscce.org/
>
>
>
> On Wed, Apr 15, 2015 at 4:11 AM, Erol Akarsu  wrote:
> >
> > Hello,
> >
> > I am having noticeable performance degradation for updating existing
> > database in this function with Basex 81.  I can say this function never
> > finish with 81. But when  I replace nodes call with file:append (writing
> > result to a file), I can see it is slowness.
> >
> > But Basex_79 is much faster than Basex81 with regard to this update and
> > finish this function quickly without any issue.
> >
> > I like to upgrade to 81 but because of this issue I could not.
> >
> > Can you help me?
> >
> > declare %updating function local:addCRMSegmentsIntoProducts ()
> > {
> >
> >  let $allProds := fn:doc("AccumulatedProducts")
> >  let $segments :=
> >
> ("Aburcubur","Ãay_Kahve","İçecek","Karma_Az","Meyve_Sebze","Saç_Bakım","Süt_Su-Madeaze_Tüketim","Temizlik")
> >  let $productsMap :=
> > map:new(
> >   for $rec in $allProds//doc
> >   let $prodIDField := $rec/field[@name eq "ProductID"]
> >   let $pid := $prodIDField/text()
> > return
> >   map:entry($pid,$prodIDField))
> >
> >  for tumbling window $prodGroup in fn:doc("CRMSegments")//record
> >   start $first next $second when fn:true()
> >   end $last next $beyond when $last/PRODUCT_ID ne
> $beyond/PRODUCT_ID
> >
> >   let $pid := $prodGroup[1]/PRODUCT_ID
> >   return
> > let $prodEntry := map:get($productsMap,$pid)/..
> > return
> >   if (fn:empty($prodEntry))   then  ()
> >   else
> >   let $segData :=
> > for $segGroup in $prodGroup
> >   let  $sid := $segGroup/SON_SEGMENT/text()
> >   let $sid :=
> > fn:concat("10",fn:index-of($segments,$sid))
> >   group by $sid
> >   return
> > let $segAmount := sum($segGroup//AMOUNT/text())
> > let $segOrderCount := sum($segGroup//ORDER_COUNT)
> > let $segFields := ( > name="SegAmount_{$sid}">{$segAmount},
> >> name="SegOrderCount_{$sid}">{$segOrderCount})
> > return $segFields
> >
> >  return
> >insert nodes ($segData) as last into $prodEntry
> >
> > };
> >
>


[basex-talk] Xquery update performance on Base 8.1

2015-04-14 Thread Erol Akarsu
Hello,

I am having noticeable performance degradation for updating existing
database in this function with Basex 81.  I can say this function never
finish with 81. But when  I replace nodes call with file:append (writing
result to a file), I can see it is slowness.

But Basex_79 is much faster than Basex81 with regard to this update and
finish this function quickly without any issue.

I like to upgrade to 81 but because of this issue I could not.

Can you help me?

declare %updating function local:addCRMSegmentsIntoProducts ()
{

 let $allProds := fn:doc("AccumulatedProducts")
 let $segments :=
("Aburcubur","Ãay_Kahve","İçecek","Karma_Az","Meyve_Sebze","Saç_Bakım","Süt_Su-Madeaze_Tüketim","Temizlik")
 let $productsMap :=
map:new(
  for $rec in $allProds//doc
  let $prodIDField := $rec/field[@name eq "ProductID"]
  let $pid := $prodIDField/text()
return
  map:entry($pid,$prodIDField))

 for tumbling window $prodGroup in fn:doc("CRMSegments")//record
  start $first next $second when fn:true()
  end $last next $beyond when $last/PRODUCT_ID ne $beyond/PRODUCT_ID

  let $pid := $prodGroup[1]/PRODUCT_ID
  return
let $prodEntry := map:get($productsMap,$pid)/..
return
  if (fn:empty($prodEntry))   then  ()
  else
  let $segData :=
for $segGroup in $prodGroup
  let  $sid := $segGroup/SON_SEGMENT/text()
  let $sid :=
fn:concat("10",fn:index-of($segments,$sid))
  group by $sid
  return
let $segAmount := sum($segGroup//AMOUNT/text())
let $segOrderCount := sum($segGroup//ORDER_COUNT)
let $segFields := ({$segAmount},
  {$segOrderCount})
return $segFields

 return
   insert nodes ($segData) as last into $prodEntry

};


[basex-talk] RESTXQ

2015-03-12 Thread Erol Akarsu
I need an urgent help here.

I am trying to configure restxqpath web.xml like below and compile war file
of basex with command

mvn compile war:war


org.basex.restxqpath
/home/eakarsu/BasexXQ
 

I moved dba folder and restxq.xqm to /home/eakarsu/BasexXQ

I deployed war file into local tomcat server and accessed

http://localhost:8080/BaseX801

It brings the content of file restxq.xqm.

But when I call existing restxq services embedded in this file

http://localhost:8080/hello/World

http://localhost:8080/hello/Universe

I am getting 404 error like this

HTTP Status 404 - /hello/World

Am I missing something?

I appreciate your help

Erol Akarsu


Re: [basex-talk] Deploy Base801.war on Jboss EAP 6.1 throws error

2015-03-09 Thread Erol Akarsu
This has been resolved by removing these from web.xml. Now it works on
jboss 6.1 eap



default



  useFileMappedBuffer

  false



  

  

default

/static/*
  

I have another issue. I like configure the place that are keeping my xquery
scripts so that I can execute them through restful calls
(/rest?run=hello.xq)

To to it. I configure webpath in web.xml file like this. Then I put my
xquery scripts like hello.xq

 
org.basex.webpath
/home/eakarsu
  

But when I try to execute it with rest call, basex is not able to find it.

Can I customize webpath for war deploy of Basex?

Thanks




On Mon, Mar 9, 2015 at 9:14 AM, Erol Akarsu  wrote:

> Hi,
>
> I deployed  Base801.war on Jboss EAP 6.1  with JDK 7. I
>
> Jboss can not start web service because of this error:
>
> Encountered invalid class name 'org.xmlpull.mxp1.MXParser,
> org.xmlpull.mxp1_serializer.MXSerializer' for service type
> 'org.xmlpull.v1.XmlPullParserFactory'
>
> Error starting context /BaseX801: java.lang.IllegalArgumentException:
> JBWEB000250: Child container with name default already exists
>
> Do you have any idea on how to fix it?
>
>
> 09:05:22,956 INFO  [org.jboss.as.server.deployment] (MSC service thread
> 1-8) JBAS015876: Starting deployment of "BaseX801.war" (runtime-name:
> "BaseX801.war")
>
> 09:05:23,326 WARN  [org.jboss.as.server.deployment] (MSC service thread
> 1-8) JBAS015893: Encountered invalid class name
> 'org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer' for
> service type 'org.xmlpull.v1.XmlPullParserFactory'
>
> 09:05:23,445 INFO  [org.jboss.web] (ServerService Thread Pool -- 88)
> JBAS018210: Register web context: /BaseX801
>
> 09:05:23,448 ERROR [org.apache.catalina.core] (ServerService Thread Pool
> -- 88) JBWEB001097: Error starting context /BaseX801:
> java.lang.IllegalArgumentException: JBWEB000250: Child container with name
> default already exists
>
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:794)
> [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
>
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
> [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
>
> at
> org.apache.catalina.core.StandardContext.addChild(StandardContext.java:1862)
> [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
>
> at
> org.jboss.as.web.deployment.JBossContextConfig.processWebMetaData(JBossContextConfig.java:471)
> [jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
>
> at
> org.jboss.as.web.deployment.JBossContextConfig.applicationWebConfig(JBossContextConfig.java:201)
> [jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
>
> at
> org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:354)
> [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
>
> at
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:153)
> [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
>
> at
> org.jboss.as.web.deployment.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:194)
> [jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
>
> at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115)
> [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
>
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:3717)
> [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
>
> at
> org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156)
> [jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
>
> at
> org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
> [jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
>
> at
> org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
> [jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
>
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> [rt.jar:1.7.0_67]
>
> at
> java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_67]
>
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> [rt.jar:1.7.0_67]
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> [rt.jar:1.7.0_67]
>
>   

[basex-talk] Deploy Base801.war on Jboss EAP 6.1 throws error

2015-03-09 Thread Erol Akarsu
Hi,

I deployed  Base801.war on Jboss EAP 6.1  with JDK 7. I

Jboss can not start web service because of this error:

Encountered invalid class name 'org.xmlpull.mxp1.MXParser,
org.xmlpull.mxp1_serializer.MXSerializer' for service type 'org.xmlpull.v1.
XmlPullParserFactory'

Error starting context /BaseX801: java.lang.IllegalArgumentException:
JBWEB000250: Child container with name default already exists

Do you have any idea on how to fix it?


09:05:22,956 INFO  [org.jboss.as.server.deployment] (MSC service thread
1-8) JBAS015876: Starting deployment of "BaseX801.war" (runtime-name:
"BaseX801.war")

09:05:23,326 WARN  [org.jboss.as.server.deployment] (MSC service thread
1-8) JBAS015893: Encountered invalid class name
'org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer' for
service type 'org.xmlpull.v1.XmlPullParserFactory'

09:05:23,445 INFO  [org.jboss.web] (ServerService Thread Pool -- 88)
JBAS018210: Register web context: /BaseX801

09:05:23,448 ERROR [org.apache.catalina.core] (ServerService Thread Pool --
88) JBWEB001097: Error starting context /BaseX801:
java.lang.IllegalArgumentException: JBWEB000250: Child container with name
default already exists

at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:794)
[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

at
org.apache.catalina.core.StandardContext.addChild(StandardContext.java:1862)
[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

at
org.jboss.as.web.deployment.JBossContextConfig.processWebMetaData(JBossContextConfig.java:471)
[jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]

at
org.jboss.as.web.deployment.JBossContextConfig.applicationWebConfig(JBossContextConfig.java:201)
[jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]

at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:354)
[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:153)
[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

at
org.jboss.as.web.deployment.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:194)
[jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]

at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115)
[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3717)
[jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

at
org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156)
[jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]

at
org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
[jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]

at
org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
[jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]

at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[rt.jar:1.7.0_67]

at java.util.concurrent.FutureTask.run(FutureTask.java:262)
[rt.jar:1.7.0_67]

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[rt.jar:1.7.0_67]

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[rt.jar:1.7.0_67]

at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]

at org.jboss.threads.JBossThread.run(JBossThread.java:122)



09:05:23,469 ERROR [org.apache.catalina.core] (ServerService Thread Pool --
88) JBWEB001103: Error detected during context /BaseX801 start, will stop it

09:05:23,470 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool
-- 88) MSC01: Failed to start service
jboss.web.deployment.default-host./BaseX801:
org.jboss.msc.service.StartException in service
jboss.web.deployment.default-host./BaseX801:
org.jboss.msc.service.StartException in anonymous service: JBAS018040:
Failed to start context

at
org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)

at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[rt.jar:1.7.0_67]

at java.util.concurrent.FutureTask.run(FutureTask.java:262)
[rt.jar:1.7.0_67]

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[rt.jar:1.7.0_67]

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[rt.jar:1.7.0_67]

at java.lang.Thr

Re: [basex-talk] Handling special characters

2015-03-03 Thread Erol Akarsu
I think I need one thing.
How can I convert an HTML3 code to proper form?
Let's say I have the number 174 and like convert it to form ® (don't
want &#174;)
how can I get it?

On Tue, Mar 3, 2015 at 3:48 PM, Erol Akarsu  wrote:

> Hi,
>
> I need to be able write some special characters into output xml file.  I
> have HTTML3 characters like ρ (phase), Δ (delta) in XML. But they
> are printed into xml file as & expanded as "&"
>
> They was being written as
>
> &#961;  and  &#916;
>
> But I want
>
> ρ  and  Δ
>
> How can I do it?
>
> Thanks
>
> Erol Akarsu
>
>


[basex-talk] Handling special characters

2015-03-03 Thread Erol Akarsu
Hi,

I need to be able write some special characters into output xml file.  I
have HTTML3 characters like ρ (phase), Δ (delta) in XML. But they
are printed into xml file as & expanded as "&"

They was being written as

&#961;  and  &#916;

But I want

ρ  and  Δ

How can I do it?

Thanks

Erol Akarsu


Re: [basex-talk] SQL memory error

2015-01-11 Thread Erol Akarsu
Christian,

This function never ends with Basex 8.0.
"CRM" database has records sorted by PRODUCT_ID. In tumbling window, I
collect all records with same PRODUCT_ID and process them,

declare %updating function local:addCRMDataIntoProducts ()
{

 let $allProds := fn:doc("AccumulatedProducts")
 let $segments := ("A","B","C","D","E","F","G"}
 let $productsMap :=
map:new(
  for $rec in $allProds//doc
  let $prodIDField := $rec/field[@name eq "ProductID"]
  let $pid := $prodIDField/text()
return
  map:entry($pid,$prodIDField))

 for tumbling window $prodGroup in fn:doc("CRM")//record
  start $first next $second when $first/PRODUCT_ID eq
$second/PRODUCT_ID
  end $last next $beyond when $last/PRODUCT_ID ne $beyond/PRODUCT_ID

  let $pid := $prodGroup[1]/PRODUCT_ID
  return
let $prodEntry := map:get($productsMap,$pid)/..
return
  if (fn:empty($prodEntry))   then  ()
  else
  let $totalAmount := sum($prodGroup//AMOUNT/text())
  let $totalOrderCount := sum($prodGroup//ORDER_COUNT)
  let $customers :=
for $cid in $prodGroup/CUSTOMER_ID/text()
  return
{$cid}
  let $sumSolrFields := ({$totalAmount},
   {$totalOrderCount},
$customers)
  let $segData :=
for $segGroup in $prodGroup
  let  $sid := $segGroup/SON_SEGMENT/text()
  let $sid :=
fn:concat("10",fn:index-of($segments,$sid))
  group by $sid
  return
let $segAmount := sum($segGroup//AMOUNT/text())
let $segOrderCount := sum($segGroup//ORDER_COUNT)
let $segFields := ({$segAmount},
  {$segOrderCount})
return $segFields

 return
   insert nodes ($segData,$sumSolrFields) as last into
$prodEntry
}

On Sun, Jan 11, 2015 at 6:33 AM, Christian Grün 
wrote:

> Hi Erol,
>
> > I am using Basex 7.9 and my script is running well.
> > I can not use 8.0 because I have tested script with it , it can not
> finish.
>
> Do you mean that the script does not work with the 8.0 snapshot? Do
> you have more information?
>
> > How difficult to back port sql changes to Basex 7.9 branch?
>
> It's not difficult per se, but it mainly takes time (we haven't added
> any features to 7.9 so far).
>
> Best,
> Christian
>


Re: [basex-talk] SQL memory error

2015-01-10 Thread Erol Akarsu
Christian,

I am using Basex 7.9 and my script is running well.
I can not use 8.0 because I have tested script with it , it can not finish.
How difficult to back port sql changes to Basex 7.9 branch?

Erol Akarsu


On Thu, Jan 8, 2015 at 2:35 PM, Erol Akarsu  wrote:

> Christian,
>
> I made little change in coding
>
> This works w/o any exception.
>
> This is super change. Thanks for implementing so quickly for me
>
> let $list :=
>  for $rec in sql:execute ($conn,$sqlStmt)
>let $is :=
>  for $line in $rec/*
>return
>  element {fn:data($line/@name)} {$line/text()}
>
>
> On Thu, Jan 8, 2015 at 2:30 PM, Erol Akarsu  wrote:
>
>> Christian,
>>
>> I have tested basex's latest snapshot on Oracle 11g.
>>
>> Unfortunately, I am still getting out of memory exception. I am using
>> like this. Is it correct use?
>> I saw there is one entity Streamable  data structure  in basex. Will I
>> have to use together with this latest change?
>>
>> declare variable $sqlfile as xs:string external;
>>   declare variable $outputfile as xs:string external;
>>
>>   let $lines := file:read-text-lines ($sqlfile)
>>   let $lines :=
>> for $line in $lines
>>   return
>> fn:normalize-space($line)
>>   let $sqlStmt := fn:string-join($lines," ")
>>
>>let $addBegin := file:append-text($outputfile,"","UTF-8")
>>let $url := "jdbc:oracle:thin:"
>>
>>let $conn  := sql:connect($url)
>>let $res := sql:execute ($conn,$sqlStmt)
>>let $list :=
>>  for $rec in $res
>>let $is :=
>>  for $line in $rec/*
>>return
>>  element {fn:data($line/@name)} {$line/text()}
>> return file:append( $outputfile, {$is})
>>
>>return
>>  ($list,file:append-text($outputfile,"","UTF-8"))
>>
>>
>> On Thu, Jan 8, 2015 at 11:09 AM, Christian Grün <
>> christian.gr...@gmail.com> wrote:
>>
>>> Hi Erol,
>>>
>>> I have rewritten the sql:execute such that the results will now be
>>> requested and returned in an iterative manner. As iterative retrieval
>>> of external resources always comes with risks (the requested data
>>> source may be updated at the same time; statements may not be properly
>>> closed if not all results will be retrieved by a client; etc), I ask
>>> you to do some testing with the latest snapshot [1] and give us
>>> feedback about your experiences.
>>>
>>> Thanks in advance,
>>> Christian
>>>
>>> [1] http://files.basex.org/releases/latest
>>>
>>>
>>>
>>> On Wed, Jan 7, 2015 at 11:58 AM, Erol Akarsu  wrote:
>>> > Hi Christian,
>>> >
>>> > I have another issue with following code snippet. It works fine with
>>> small
>>> > JDBC result rows returned from database.
>>> >
>>> > But if your sql query returns say 40 million rows, then you will get
>>> out of
>>> > memory exception easily. I guess Basex first read whole 40 million
>>> rows into
>>> > memory first, then it will allow user to use sql data.
>>> >
>>> > Is there a way for basex to read sql rows block by block (say 1000 by
>>> 1000)
>>> > and write into a file?
>>> >
>>> > I appreciate your help.
>>> >
>>> > declare variable $sqlfile as xs:string external;
>>> >   declare variable $outputfile as xs:string external;
>>> >
>>> >   let $lines := file:read-text-lines ($sqlfile)
>>> >   let $lines :=
>>> > for $line in $lines
>>> >   return
>>> > fn:normalize-space($line)
>>> >   let $sqlStmt := fn:string-join($lines," ")
>>> >
>>> >let $addBegin :=
>>> file:append-text($outputfile,"","UTF-8")
>>> >let $url := "jdbc:oracle:thin:"
>>> >
>>> >let $conn  := sql:connect($url)
>>> >let $res := sql:execute ($conn,$sqlStmt)
>>> >let $list :=
>>> >  for $rec in $res
>>> >let $is :=
>>> >  for $line in $rec/*
>>> >return
>>> >   

Re: [basex-talk] SQL memory error

2015-01-08 Thread Erol Akarsu
Christian,

I made little change in coding

This works w/o any exception.

This is super change. Thanks for implementing so quickly for me

let $list :=
 for $rec in sql:execute ($conn,$sqlStmt)
   let $is :=
 for $line in $rec/*
   return
 element {fn:data($line/@name)} {$line/text()}


On Thu, Jan 8, 2015 at 2:30 PM, Erol Akarsu  wrote:

> Christian,
>
> I have tested basex's latest snapshot on Oracle 11g.
>
> Unfortunately, I am still getting out of memory exception. I am using like
> this. Is it correct use?
> I saw there is one entity Streamable  data structure  in basex. Will I
> have to use together with this latest change?
>
> declare variable $sqlfile as xs:string external;
>   declare variable $outputfile as xs:string external;
>
>   let $lines := file:read-text-lines ($sqlfile)
>   let $lines :=
> for $line in $lines
>   return
> fn:normalize-space($line)
>   let $sqlStmt := fn:string-join($lines," ")
>
>let $addBegin := file:append-text($outputfile,"","UTF-8")
>let $url := "jdbc:oracle:thin:"
>
>let $conn  := sql:connect($url)
>let $res := sql:execute ($conn,$sqlStmt)
>let $list :=
>  for $rec in $res
>let $is :=
>  for $line in $rec/*
>return
>  element {fn:data($line/@name)} {$line/text()}
> return file:append( $outputfile, {$is})
>
>return
>  ($list,file:append-text($outputfile,"","UTF-8"))
>
>
> On Thu, Jan 8, 2015 at 11:09 AM, Christian Grün  > wrote:
>
>> Hi Erol,
>>
>> I have rewritten the sql:execute such that the results will now be
>> requested and returned in an iterative manner. As iterative retrieval
>> of external resources always comes with risks (the requested data
>> source may be updated at the same time; statements may not be properly
>> closed if not all results will be retrieved by a client; etc), I ask
>> you to do some testing with the latest snapshot [1] and give us
>> feedback about your experiences.
>>
>> Thanks in advance,
>> Christian
>>
>> [1] http://files.basex.org/releases/latest
>>
>>
>>
>> On Wed, Jan 7, 2015 at 11:58 AM, Erol Akarsu  wrote:
>> > Hi Christian,
>> >
>> > I have another issue with following code snippet. It works fine with
>> small
>> > JDBC result rows returned from database.
>> >
>> > But if your sql query returns say 40 million rows, then you will get
>> out of
>> > memory exception easily. I guess Basex first read whole 40 million rows
>> into
>> > memory first, then it will allow user to use sql data.
>> >
>> > Is there a way for basex to read sql rows block by block (say 1000 by
>> 1000)
>> > and write into a file?
>> >
>> > I appreciate your help.
>> >
>> > declare variable $sqlfile as xs:string external;
>> >   declare variable $outputfile as xs:string external;
>> >
>> >   let $lines := file:read-text-lines ($sqlfile)
>> >   let $lines :=
>> > for $line in $lines
>> >   return
>> > fn:normalize-space($line)
>> >   let $sqlStmt := fn:string-join($lines," ")
>> >
>> >let $addBegin :=
>> file:append-text($outputfile,"","UTF-8")
>> >let $url := "jdbc:oracle:thin:"
>> >
>> >let $conn  := sql:connect($url)
>> >let $res := sql:execute ($conn,$sqlStmt)
>> >let $list :=
>> >  for $rec in $res
>> >let $is :=
>> >  for $line in $rec/*
>> >return
>> >  element {fn:data($line/@name)} {$line/text()}
>> > return file:append( $outputfile, {$is})
>> >
>> >return
>> >  ($list,file:append-text($outputfile,"","UTF-8"))
>> >
>> > On Tue, Jan 6, 2015 at 4:22 AM, Christian Grün <
>> christian.gr...@gmail.com>
>> > wrote:
>> >>
>> >> Hi Erol,
>> >>
>> >> > I have several xml document index keeping products features and have
>> one
>> >> > master index file of products.. Currently, we have about 25 million
>> >> > products
>> >> > that have size about 25G xquery index size.
>> >>
>> &

Re: [basex-talk] SQL memory error

2015-01-08 Thread Erol Akarsu
Christian,

I have tested basex's latest snapshot on Oracle 11g.

Unfortunately, I am still getting out of memory exception. I am using like
this. Is it correct use?
I saw there is one entity Streamable  data structure  in basex. Will I have
to use together with this latest change?

declare variable $sqlfile as xs:string external;
  declare variable $outputfile as xs:string external;

  let $lines := file:read-text-lines ($sqlfile)
  let $lines :=
for $line in $lines
  return
fn:normalize-space($line)
  let $sqlStmt := fn:string-join($lines," ")

   let $addBegin := file:append-text($outputfile,"","UTF-8")
   let $url := "jdbc:oracle:thin:"

   let $conn  := sql:connect($url)
   let $res := sql:execute ($conn,$sqlStmt)
   let $list :=
 for $rec in $res
   let $is :=
 for $line in $rec/*
   return
 element {fn:data($line/@name)} {$line/text()}
return file:append( $outputfile, {$is})

   return
 ($list,file:append-text($outputfile,"","UTF-8"))


On Thu, Jan 8, 2015 at 11:09 AM, Christian Grün 
wrote:

> Hi Erol,
>
> I have rewritten the sql:execute such that the results will now be
> requested and returned in an iterative manner. As iterative retrieval
> of external resources always comes with risks (the requested data
> source may be updated at the same time; statements may not be properly
> closed if not all results will be retrieved by a client; etc), I ask
> you to do some testing with the latest snapshot [1] and give us
> feedback about your experiences.
>
> Thanks in advance,
> Christian
>
> [1] http://files.basex.org/releases/latest
>
>
>
> On Wed, Jan 7, 2015 at 11:58 AM, Erol Akarsu  wrote:
> > Hi Christian,
> >
> > I have another issue with following code snippet. It works fine with
> small
> > JDBC result rows returned from database.
> >
> > But if your sql query returns say 40 million rows, then you will get out
> of
> > memory exception easily. I guess Basex first read whole 40 million rows
> into
> > memory first, then it will allow user to use sql data.
> >
> > Is there a way for basex to read sql rows block by block (say 1000 by
> 1000)
> > and write into a file?
> >
> > I appreciate your help.
> >
> > declare variable $sqlfile as xs:string external;
> >   declare variable $outputfile as xs:string external;
> >
> >   let $lines := file:read-text-lines ($sqlfile)
> >   let $lines :=
> > for $line in $lines
> >   return
> > fn:normalize-space($line)
> >   let $sqlStmt := fn:string-join($lines," ")
> >
> >let $addBegin := file:append-text($outputfile,"","UTF-8")
> >let $url := "jdbc:oracle:thin:"
> >
> >let $conn  := sql:connect($url)
> >let $res := sql:execute ($conn,$sqlStmt)
> >let $list :=
> >  for $rec in $res
> >let $is :=
> >  for $line in $rec/*
> >return
> >  element {fn:data($line/@name)} {$line/text()}
> > return file:append( $outputfile, {$is})
> >
> >return
> >  ($list,file:append-text($outputfile,"","UTF-8"))
> >
> > On Tue, Jan 6, 2015 at 4:22 AM, Christian Grün <
> christian.gr...@gmail.com>
> > wrote:
> >>
> >> Hi Erol,
> >>
> >> > I have several xml document index keeping products features and have
> one
> >> > master index file of products.. Currently, we have about 25 million
> >> > products
> >> > that have size about 25G xquery index size.
> >>
> >> One solution is to generate a BaseX command script, which contains
> >> multiple subsequent update operations. It can e.g. be created as
> >> follows:
> >>
> >>   let $records := count(db:open('db')//product-node)
> >>   let $commands :=
> >> for tumbling window $w in (1 to $records)
> >> start at $s when true()
> >> only end at $e when $e - $s = 99
> >> return 'for $product-node in //product-node' ||
> >>'[position() = ' || $s || ' to ' || $e || '] ' ||
> >>'return insert node  into $product-node'
> >>   return file:write-text-lines('script.bxs', $commands)
> >>
> >> ..and run via "basex script.bxs".
> >>
> >> Hope this helps,
> >> Christian
> >>
> >>
> >> >
> >> > My xquery application is reading features data from auxiliary xml
> >> > document
> >> > and enhancing master document.
> >> >
> >> > In order to do it, I am inserting data into master document with a
> >> > generic
> >> > insert command:
> >> >
> >> > insert node  into 
> >> >
> >> > But xquery update is executing update process after all insert
> requests
> >> > collected. But with huge size of my index, the memory of machine (35G)
> >> > is
> >> > exhausted easily and can NOT finish process.
> >> >
> >> > Is there way to execute individual xquery update requests one by one
> so
> >> > that
> >> > process can finish?
> >> >
> >> > Erol Akarsu
> >> >
> >> >
> >
> >
>


Re: [basex-talk] SQL memory error

2015-01-08 Thread Erol Akarsu
Christian,

Super.

I am glad to test it today and give feedback

Erol Akarsu

On Thu, Jan 8, 2015 at 11:09 AM, Christian Grün 
wrote:

> Hi Erol,
>
> I have rewritten the sql:execute such that the results will now be
> requested and returned in an iterative manner. As iterative retrieval
> of external resources always comes with risks (the requested data
> source may be updated at the same time; statements may not be properly
> closed if not all results will be retrieved by a client; etc), I ask
> you to do some testing with the latest snapshot [1] and give us
> feedback about your experiences.
>
> Thanks in advance,
> Christian
>
> [1] http://files.basex.org/releases/latest
>
>
>
> On Wed, Jan 7, 2015 at 11:58 AM, Erol Akarsu  wrote:
> > Hi Christian,
> >
> > I have another issue with following code snippet. It works fine with
> small
> > JDBC result rows returned from database.
> >
> > But if your sql query returns say 40 million rows, then you will get out
> of
> > memory exception easily. I guess Basex first read whole 40 million rows
> into
> > memory first, then it will allow user to use sql data.
> >
> > Is there a way for basex to read sql rows block by block (say 1000 by
> 1000)
> > and write into a file?
> >
> > I appreciate your help.
> >
> > declare variable $sqlfile as xs:string external;
> >   declare variable $outputfile as xs:string external;
> >
> >   let $lines := file:read-text-lines ($sqlfile)
> >   let $lines :=
> > for $line in $lines
> >   return
> > fn:normalize-space($line)
> >   let $sqlStmt := fn:string-join($lines," ")
> >
> >let $addBegin := file:append-text($outputfile,"","UTF-8")
> >let $url := "jdbc:oracle:thin:"
> >
> >let $conn  := sql:connect($url)
> >let $res := sql:execute ($conn,$sqlStmt)
> >let $list :=
> >  for $rec in $res
> >let $is :=
> >  for $line in $rec/*
> >return
> >  element {fn:data($line/@name)} {$line/text()}
> > return file:append( $outputfile, {$is})
> >
> >return
> >  ($list,file:append-text($outputfile,"","UTF-8"))
> >
> > On Tue, Jan 6, 2015 at 4:22 AM, Christian Grün <
> christian.gr...@gmail.com>
> > wrote:
> >>
> >> Hi Erol,
> >>
> >> > I have several xml document index keeping products features and have
> one
> >> > master index file of products.. Currently, we have about 25 million
> >> > products
> >> > that have size about 25G xquery index size.
> >>
> >> One solution is to generate a BaseX command script, which contains
> >> multiple subsequent update operations. It can e.g. be created as
> >> follows:
> >>
> >>   let $records := count(db:open('db')//product-node)
> >>   let $commands :=
> >> for tumbling window $w in (1 to $records)
> >> start at $s when true()
> >> only end at $e when $e - $s = 99
> >> return 'for $product-node in //product-node' ||
> >>'[position() = ' || $s || ' to ' || $e || '] ' ||
> >>'return insert node  into $product-node'
> >>   return file:write-text-lines('script.bxs', $commands)
> >>
> >> ..and run via "basex script.bxs".
> >>
> >> Hope this helps,
> >> Christian
> >>
> >>
> >> >
> >> > My xquery application is reading features data from auxiliary xml
> >> > document
> >> > and enhancing master document.
> >> >
> >> > In order to do it, I am inserting data into master document with a
> >> > generic
> >> > insert command:
> >> >
> >> > insert node  into 
> >> >
> >> > But xquery update is executing update process after all insert
> requests
> >> > collected. But with huge size of my index, the memory of machine (35G)
> >> > is
> >> > exhausted easily and can NOT finish process.
> >> >
> >> > Is there way to execute individual xquery update requests one by one
> so
> >> > that
> >> > process can finish?
> >> >
> >> > Erol Akarsu
> >> >
> >> >
> >
> >
>


Re: [basex-talk] Index cvs error throws "Content is not allowed in prolog"

2015-01-07 Thread Erol Akarsu
I solved this one,

SET PARSER csv
SET CSVPARSER encoding=utf-8, header=true, separator=comma
SET CREATEFILTER *.csv

But now with 16565274 rows csv file, 690M. During indexing, I am getting
this.
I have set memory to 30G

Creating Database...
java.lang.NegativeArraySizeException
at java.util.Arrays.copyOf(Arrays.java:2271)
at org.basex.util.TokenBuilder.addByte(TokenBuilder.java:242)
at org.basex.util.TokenBuilder.add(TokenBuilder.java:151)
at org.basex.io.parse.XmlTokenBuilder.add(XmlTokenBuilder.java:96)
at
org.basex.io.parse.XmlTokenBuilder.addText(XmlTokenBuilder.java:51)
at
org.basex.io.parse.csv.CsvStringConverter.entry(CsvStringConverter.java:76)
at org.basex.io.parse.csv.CsvParser.record(CsvParser.java:105)
at org.basex.io.parse.csv.CsvParser.parse(CsvParser.java:80)
at org.basex.io.parse.csv.CsvParser.parse(CsvParser.java:54)
at org.basex.io.parse.csv.CsvConverter.convert(CsvConverter.java:37)
at org.basex.build.CsvParser.toXML(CsvParser.java:40)


On Wed, Jan 7, 2015 at 9:30 PM, Erol Akarsu  wrote:

>
> I am trying to index an csv file through basexclient. I issued this command
>
> SET INTPARSE false; CREATE DB Properties Properties.csv
>
> got these error message in basex server. What shall I do to index csv
> through basexclient command?
>
>
> [kangadm@kangapp12 javaProcess]$ basexserver -d
> BaseX 7.9 [Server]
> Server was started (port: 1984)
> Creating Database...
> org.xml.sax.SAXParseException; systemId:
> file:///home/kangadm/basex/migros/production/javaProcess/Brands.sql.csv;
> lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
> at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
> at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
> at
> com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
>
>


[basex-talk] Index cvs error throws "Content is not allowed in prolog"

2015-01-07 Thread Erol Akarsu
I am trying to index an csv file through basexclient. I issued this command

SET INTPARSE false; CREATE DB Properties Properties.csv

got these error message in basex server. What shall I do to index csv
through basexclient command?


[kangadm@kangapp12 javaProcess]$ basexserver -d
BaseX 7.9 [Server]
Server was started (port: 1984)
Creating Database...
org.xml.sax.SAXParseException; systemId:
file:///home/kangadm/basex/migros/production/javaProcess/Brands.sql.csv;
lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)


[basex-talk] SQL memory error

2015-01-07 Thread Erol Akarsu
Hi Christian,

I have another issue with following code snippet. It works fine with small
JDBC result rows returned from database.

But if your sql query returns say 40 million rows, then you will get out of
memory exception easily. I guess Basex first read whole 40 million rows
into memory first, then it will allow user to use sql data.

Is there a way for basex to read sql rows block by block (say 1000 by 1000)
and write into a file?

I appreciate your help.

declare variable $sqlfile as xs:string external;
  declare variable $outputfile as xs:string external;

  let $lines := file:read-text-lines ($sqlfile)
  let $lines :=
for $line in $lines
  return
fn:normalize-space($line)
  let $sqlStmt := fn:string-join($lines," ")

   let $addBegin := file:append-text($outputfile,"","UTF-8")
   let $url := "jdbc:oracle:thin:"

   let $conn  := sql:connect($url)
   let $res := sql:execute ($conn,$sqlStmt)
   let $list :=
 for $rec in $res
   let $is :=
 for $line in $rec/*
   return
 element {fn:data($line/@name)} {$line/text()}
return file:append( $outputfile, {$is})

   return
 ($list,file:append-text($outputfile,"","UTF-8"))

On Tue, Jan 6, 2015 at 4:22 AM, Christian Grün 
wrote:

> Hi Erol,
>
> > I have several xml document index keeping products features and have one
> > master index file of products.. Currently, we have about 25 million
> products
> > that have size about 25G xquery index size.
>
> One solution is to generate a BaseX command script, which contains
> multiple subsequent update operations. It can e.g. be created as
> follows:
>
>   let $records := count(db:open('db')//product-node)
>   let $commands :=
> for tumbling window $w in (1 to $records)
> start at $s when true()
> only end at $e when $e - $s = 99
> return 'for $product-node in //product-node' ||
>'[position() = ' || $s || ' to ' || $e || '] ' ||
>'return insert node  into $product-node'
>   return file:write-text-lines('script.bxs', $commands)
>
> ..and run via "basex script.bxs".
>
> Hope this helps,
> Christian
>
>
> >
> > My xquery application is reading features data from auxiliary xml
> document
> > and enhancing master document.
> >
> > In order to do it, I am inserting data into master document with a
> generic
> > insert command:
> >
> > insert node  into 
> >
> > But xquery update is executing update process after all insert requests
> > collected. But with huge size of my index, the memory of machine (35G) is
> > exhausted easily and can NOT finish process.
> >
> > Is there way to execute individual xquery update requests one by one so
> that
> > process can finish?
> >
> > Erol Akarsu
> >
> >
>


Re: [basex-talk] Xquery update question

2015-01-06 Thread Erol Akarsu
Thanks Christian

That was I what I was thinking
Hopefully, it will resolve the issue,

Erol Akarsu

On Tue, Jan 6, 2015 at 4:22 AM, Christian Grün 
wrote:

> Hi Erol,
>
> > I have several xml document index keeping products features and have one
> > master index file of products.. Currently, we have about 25 million
> products
> > that have size about 25G xquery index size.
>
> One solution is to generate a BaseX command script, which contains
> multiple subsequent update operations. It can e.g. be created as
> follows:
>
>   let $records := count(db:open('db')//product-node)
>   let $commands :=
> for tumbling window $w in (1 to $records)
> start at $s when true()
> only end at $e when $e - $s = 99
> return 'for $product-node in //product-node' ||
>'[position() = ' || $s || ' to ' || $e || '] ' ||
>'return insert node  into $product-node'
>   return file:write-text-lines('script.bxs', $commands)
>
> ..and run via "basex script.bxs".
>
> Hope this helps,
> Christian
>
>
> >
> > My xquery application is reading features data from auxiliary xml
> document
> > and enhancing master document.
> >
> > In order to do it, I am inserting data into master document with a
> generic
> > insert command:
> >
> > insert node  into 
> >
> > But xquery update is executing update process after all insert requests
> > collected. But with huge size of my index, the memory of machine (35G) is
> > exhausted easily and can NOT finish process.
> >
> > Is there way to execute individual xquery update requests one by one so
> that
> > process can finish?
> >
> > Erol Akarsu
> >
> >
>


[basex-talk] Xquery update question

2014-12-29 Thread Erol Akarsu
Hi,

I have several xml document index keeping products features and have one
master index file of products.. Currently, we have about 25 million
products that have size about 25G xquery index size.

My xquery application is reading features data from auxiliary xml document
and enhancing master document.

In order to do it, I am inserting data into master document with a generic
insert command:

insert node  into 

But xquery update is executing update process after all insert requests
collected. But with huge size of my index, the memory of machine (35G) is
exhausted easily and can NOT finish process.

Is there way to execute individual xquery update requests one by one so
that process can finish?

Erol Akarsu


[basex-talk] XQException with Basex 7.9

2014-10-06 Thread Erol Akarsu
I am having syntax error at map(*) where 74'th chracter is  first '('
do you know why?
I run same script basex gui with base 7.9 w/o issue.

declare variable $rawProductsFile as xs:string external;
declare variable $schemaFileName as xs:string external;
declare variable $tableName as xs:string external;
declare variable $outputFileName as xs:string external;

(:(line 7  is this line:)
declare function local:getFieldMap ($schemaFileName as xs:string) as  map(*)


javax.xml.xquery.XQException:
  XQJQS001 - Invalid XQuery syntax, syntax does not pass static validation.
  Root Cause:
  net.xqj.basex.bin.bx: Encountered " "(" "( "" at line 7, column 74.
Was expecting one of:
"*" ...
"?" ...
"external" ...
"{" ...
"+" ...

  at com.ferguson.xquery.RunQueries.queryForFilterData2(RunQueries.java:147)
  at
com.ferguson.endeca.EndecaEngine.processExtractDARFilesExt(EndecaEngine.java:377)
  at com.ferguson.endeca.EndecaEngine.main(EndecaEngine.java:142)
  at com.ferguson.xquery.RunQueries.queryForFilterData2(RunQueries.java:147)
  at
com.ferguson.endeca.EndecaEngine.processExtractDARFilesExt(EndecaEngine.java:377)
  at com.ferguson.endeca.EndecaEngine.main(EndecaEngine.java:142)

On Mon, Oct 6, 2014 at 11:20 AM, Dániel Kiss-Kálmán <
kisskalmandan...@gmail.com> wrote:

> Hello Basex-Talkers,
>
> when I try to enter a variable I need the $ char. I use hungarian
> keyboard, and $ is AltGr + É keyboard combination. The only annoying thing
> is when I press AltGr + É, $ appears, but just before that cursor jumps to
> the first row first char position. So $ is smiling  as the first char in
> the first row. No other keboard combination does that, only AltGr + É. So
> every time I need a variable I use clipboard instead of pressing $ char.
>
> Can onyone make my life a little easier to correct it if it is possible at
> all?
> Or help me how to try to remove that cursor jump?
>
> Thanks in advance, Daniel
>


Re: [basex-talk] Corruption? → latest snapshot

2014-09-18 Thread Erol Akarsu
Christian,

I just installed latest snaphot today and
 run basexgui.bat and got that error.

now I am getting previous version documentation and can see I can use it

On Thu, Sep 18, 2014 at 11:03 AM, Christian Grün 
wrote:

> Hi Erol,
>
> I assume you wanted to open a new thread; this is why I changed the
> subject.
>
> > I am not able use map in xquery scripts in current basex version. How
> can I
> > create a map and add values to it?
>
> Give us more information on your code, please.
>
> > I remember I was creating map with previous versions of Basex. Can you
> > remind my how?
>
> Check out older Wiki entries by parsing the history or downloading the
> documentation in the pdf format.
>
> > I had to download the latest snaphost of Basex 8.0 and run basexguui.bat
> but
> > getting error org.basex.BaseXGUI class could not be found.
>
> I can't reproduce this. Do you talk about the "basexgui.bat" file, or
> is the typo intentional?
>
> Christian
>


Re: [basex-talk] Corruption?

2014-09-18 Thread Erol Akarsu
Hi,

I am not able use map in xquery scripts in current basex version. How can I
create a map and add values to it?
Basex documentation says it merge and put functions that can help us to
create a map but those are in Basex 8.0.
I remember I was creating map with previous versions of Basex. Can you
remind my how?

I had to download the latest snaphost of Basex 8.0 and run basexguui.bat
but getting error org.basex.BaseXGUI class could not be found.

Thanks


Re: [basex-talk] UTF-8 charcaters

2014-07-04 Thread Erol Akarsu
Christian,

Slight modification I made  to script: only 10 sites are pulled and
produced output
I attached new script and result you will get when you run it



On Fri, Jul 4, 2014 at 7:13 PM, Christian Grün 
wrote:

> Hi Erol,
>
> thanks for the script. Do you think you could provide us with a
> minimized example?
>
> Christian
> _
>
> On Fri, Jul 4, 2014 at 11:43 PM, Erol Akarsu  wrote:
> > Christian,
> >
> > My xquery script and result are attached.
> > You will see incorrect encoded elements as?
> >
> >
> > On Fri, Jul 4, 2014 at 3:44 PM, Christian Grün <
> christian.gr...@gmail.com>
> > wrote:
> >>
> >> Hi Erol,
> >>
> >> > I am trying to fetch an url page
> >> > http://www.ruya-tabirleri.com/ruyada-adam-gormek.html that has
> Turkish
> >> > characters in it. When I pull it in basex, the pages returns in
> >> > charset=windows-1254 but as you see it doesn't render Turkish
> characters
> >> > like here:
> >>
> >> Please give us more details on how you are trying to retrieve the web
> >> page.
> >>
> >> One solution could look as follows:
> >>
> >>
> >> html:parse(fetch:text('
> http://www.ruya-tabirleri.com/ruyada-adam-gormek.html',
> >> 'windows-1254'), map { 'encoding': 'UTF-8' })
> >>
> >> Cheers,
> >> Christian
> >>
> >>
> >>
> >> >
> >> > content="r?a tabirleri, r?a yorumlar? r?a tabiri, r?a, r?atabirleri,
> >> > haberci
> >> > r?a, r?a t?leri, r?a nedir, aksenov, forsa, atat?k, evliya ?lebi,
> >> > bur?ar,
> >> > astroloji"/>
> >> >
> >> >
> >> > 
> >> >   http://gmpg.org/xfn/11";>
> >> > R?a Tabirleri, R?a Tabiri, R?a Yorumlar? R?a, r?atabirleri,
> >> > ruya
> >> > tabirleri
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 
> >> >  >> > href="http://www.ruya-tabirleri.com/img/ruya1.css"; type="text/css"/>
> >> > 

[basex-talk] UTF-8 charcaters

2014-07-04 Thread Erol Akarsu
I am trying to fetch an url page
http://www.ruya-tabirleri.com/ruyada-adam-gormek.html that has Turkish
characters in it. When I pull it in basex, the pages returns in
charset=windows-1254 but as you see it doesn't render Turkish characters
like here:

content="r?a tabirleri, r?a yorumlar? r?a tabiri, r?a, r?atabirleri,
haberci r?a, r?a t?leri, r?a nedir, aksenov, forsa, atat?k, evliya ?lebi,
bur?ar, astroloji"/>



  http://gmpg.org/xfn/11";>
R?a Tabirleri, R?a Tabiri, R?a Yorumlar? R?a, r?atabirleri, ruya
tabirleri











http://www.ruya-tabirleri.com/img/ruya1.css";
type="text/css"/>

Re: [basex-talk] Big XML file

2014-06-19 Thread Erol Akarsu
Christian

No
I can run with debug and let you know result


Sent from my iPhone

> On Jun 19, 2014, at 6:23 PM, Christian Grün  wrote:
> 
> Did you use debugging  (-d)?
> 
> Am 19.06.2014 22:01 schrieb "Erol Akarsu" :
>> Chrsitian,
>> 
>> It does not show any stack trace.
>> But it shows only "Out Of Main Memor" exception in "Query Info" page
>> I think it is impossible to process so large XML file 9GM like this.
>> 
>> I had to index xml file first and processed it fine.
>> 
>> Erol Akarsu
>> 
>> 
>> 
>>> On Wed, Jun 18, 2014 at 8:02 PM, Christian Grün  
>>> wrote:
>>> How does the stack trace look like?
>>> 
>>> Am 18.06.2014 16:09 schrieb "Erol Akarsu" :
>>> 
>>>> I have about 9G xml file and like to process with basex.
>>>> But I am getting out of memory erroe (with setting -Xmx7G). Yesterday, I 
>>>> was able to process like this where $rawProductsFile is the name of big 
>>>> xml file. XML file consists of "Products" elements and process them one by 
>>>> one and write result into a file.
>>>> 
>>>> But today, it is out of memory exception. 
>>>>  
>>>> let $res :=
>>>> 
>>>> for $doc in fn:doc($rawProductsFile)//Products
>>>> 
>>>>   let $list:=
>>>> 
>>>> for $tname in $tables
>>>> 
>>>> let $rows := ($doc[fn:name() eq $tname]|$doc//table[@name eq 
>>>> $tname])
>>>> 
>>>> let $list2 := local:processOneProd ($tname,$rows,$tableMap)
>>>> 
>>>> let $fw := 
>>>> file:append(fn:concat($tablesFolder,$tname,".xml"),$list2)
>>>> 
>>>> return $fw
>>>> 
>>>>   return $list
>>>> 
>>>> Which way is good to process large xml file like this, process each 
>>>> element one be one?
>>>> 
>>>> I appreciate your help
>>>> 
>>>> Erol Akarsu


Re: [basex-talk] Big XML file

2014-06-19 Thread Erol Akarsu
Chrsitian,

It does not show any stack trace.
But it shows only "Out Of Main Memor" exception in "Query Info" page
I think it is impossible to process so large XML file 9GM like this.

I had to index xml file first and processed it fine.

Erol Akarsu



On Wed, Jun 18, 2014 at 8:02 PM, Christian Grün 
wrote:

> How does the stack trace look like?
> Am 18.06.2014 16:09 schrieb "Erol Akarsu" :
>
> I have about 9G xml file and like to process with basex.
>> But I am getting out of memory erroe (with setting -Xmx7G). Yesterday, I
>> was able to process like this where $rawProductsFile is the name of big xml
>> file. XML file consists of "Products" elements and process them one by one
>> and write result into a file.
>>
>> But today, it is out of memory exception.
>>
>>
>> let $res :=
>>
>> for $doc in fn:doc($rawProductsFile)//Products
>>
>>   let $list:=
>>
>> for $tname in $tables
>>
>> let $rows := ($doc[fn:name() eq $tname]|$doc//table[@name eq
>> $tname])
>>
>> let $list2 := local:processOneProd ($tname,$rows,$tableMap)
>>
>> let $fw :=
>> file:append(fn:concat($tablesFolder,$tname,".xml"),$list2)
>>
>> return $fw
>>   return $list
>>
>> Which way is good to process large xml file like this, process each
>> element one be one?
>>
>> I appreciate your help
>>
>> Erol Akarsu
>>
>


[basex-talk] Big XML file

2014-06-18 Thread Erol Akarsu
I have about 9G xml file and like to process with basex.
But I am getting out of memory erroe (with setting -Xmx7G). Yesterday, I
was able to process like this where $rawProductsFile is the name of big xml
file. XML file consists of "Products" elements and process them one by one
and write result into a file.

But today, it is out of memory exception.


let $res :=

for $doc in fn:doc($rawProductsFile)//Products

  let $list:=

for $tname in $tables

let $rows := ($doc[fn:name() eq $tname]|$doc//table[@name eq
$tname])

let $list2 := local:processOneProd ($tname,$rows,$tableMap)

let $fw :=
file:append(fn:concat($tablesFolder,$tname,".xml"),$list2)

return $fw
  return $list

Which way is good to process large xml file like this, process each element
one be one?

I appreciate your help

Erol Akarsu


Re: [basex-talk] [FORG0006] Unknown method:

2014-05-29 Thread Erol Akarsu
Christian,

I tried to close prepared statement and got this exception:

[BXSQ0002] No opened connection with id 1

It throws exception at line

let $clres := sql:close($prep)


 let $prep := sql:prepare($conn,$sqlStmt)
let $params := 
 {$useType}
   
let $result := sql:execute-prepared($prep, $params)
let $clres := sql:close($prep)




On Wed, May 28, 2014 at 3:51 PM, Christian Grün 
wrote:

> > sql:close is for connection to SQL server but prepared statement?
>
> If I remember right, it's for both. Did you have a try?
>


Re: [basex-talk] [FORG0006] Unknown method:

2014-05-28 Thread Erol Akarsu
Christian,

I have to make multiple calls to prepared statement so that  it is
convenient to close SQL connection with sql:close every time an statement
is executed
sql:close is for connection to SQL server but prepared statement?


On Wed, May 28, 2014 at 3:47 PM, Christian Grün
wrote:

> > [BXSQ0001] An SQL exception occurred: 'ORA-01000: maximum open cursors
> > exceeded
>
> Did you close your prepared statements via sql:close [1]?
>
> Best,
> Christian
>
> [1] http://docs.basex.org/wiki/SQL_Module#sql:close
>


Re: [basex-talk] [FORG0006] Unknown method:

2014-05-28 Thread Erol Akarsu
Christian,

That unknown method has gone, thanks for your help.

Now, I am getting this error after I called multiple  sql:execute-prepared
calls

[BXSQ0001] An SQL exception occurred: 'ORA-01000: maximum open cursors
exceeded

This error is called when we have exceed certain number of cursors in DB

>A JDBC *ResultSet* is supported by a single *cursor* on the database. When
close() is called on the ResultSet, the cursor is released.

When basex made call for sql:execute-prepared, does it close statement and
resultset?

Erol Akarsu




On Wed, May 28, 2014 at 4:14 AM, Christian Grün
wrote:

> Hi Erol (cc to the list),
>
> > That solved the issue!
> > Thanks for your help
> >
> > I like to know what is difference between xs:int and xs:integer ?
>
> Values of type xs:integer may be bigger than Java integers. You'll
> need BigInteger to accept these values in a Java function.
>
> Hope this helps,
> Christian
>


Re: [basex-talk] [FORG0006] Unknown method:

2014-05-28 Thread Erol Akarsu
Marco

It is typo error in copying and pasting email
I am sure that java class has same method name called in xquery script

Sent from my iPhone

> On May 28, 2014, at 2:47 AM, Marco Lettere  wrote:
> 
> 
> Hi Erol,
> in the example you call insertImage2 from Xquery but the class declarea an 
> insertImage3 method. Are you sure the issue is not this one?
> Cheers,
> Marco.
> 
>> On 05/28/2014 01:23 AM, Erol Akarsu wrote:
>> I am getting this error when I call a java method from inside xquery script. 
>> I am using basex 7.8.2
>> 
>> Java constructor initialization (aBlob:new) went fine. Even I can call close 
>> method w/o any issue.
>> 
>> but when I call insertImage3 in xquery script, I am getting error
>> 
>> [FORG0006] Unknown method
>> 
>> I compiled the class into jar file and put it into libs folder of basex 
>> installation folder. I am using basexgui.bat to open basex gui that will 
>> load all jars in libs folder.
>> 
>> Is there anything I could not see here?
>> 
>> I appreciate your help
>> 
>> 
>> 
>> Stopped at D:/StepToDAR/DARImport.xq, 90/35:
>> [FORG0006] Unknown method: AddBlob.insertImage2(AddBlob, xs:integer, 
>> xs:string).
>> 
>> declare namespace aBlob ="com.ferguson.blobmanager.AddBlob";
>> 
>> let $bm := aBlob:new($connUrl,$username,$passwd)
>> let $r1 := aBlob:insertImage2($bm,xs:integer(),xs:string("e"))
>> 
>> public class AddBlob {
>> public AddBlob (String connUrl,String username,String passwd) throws 
>> SQLException
>>{
>> 
>>}
>> public  void insertImage3( String fileName, int id) {
>>System.out.println ("test message here");
>>}
>> public void close () throws SQLException
>>{
>>connection.commit();
>>connection.close();
>>}
>> }
> 


[basex-talk] [FORG0006] Unknown method:

2014-05-27 Thread Erol Akarsu
I am getting this error when I call a java method from inside xquery
script. I am using basex 7.8.2

Java constructor initialization (aBlob:new) went fine. Even I can call
close method w/o any issue.

but when I call insertImage3 in xquery script, I am getting error

[FORG0006] Unknown method

I compiled the class into jar file and put it into libs folder of basex
installation folder. I am using basexgui.bat to open basex gui that will
load all jars in libs folder.

Is there anything I could not see here?

I appreciate your help



Stopped at D:/StepToDAR/DARImport.xq, 90/35:
[FORG0006] Unknown method: AddBlob.insertImage2(AddBlob, xs:integer,
xs:string).

declare namespace aBlob ="com.ferguson.blobmanager.AddBlob";

 let $bm := aBlob:new($connUrl,$username,$passwd)
 let $r1 := aBlob:insertImage2($bm,xs:integer(),xs:string("e"))

public class AddBlob {
public AddBlob (String connUrl,String username,String passwd) throws
SQLException
{

}
public  void insertImage3( String fileName, int id) {
System.out.println ("test message here");
}
public void close () throws SQLException
{
connection.commit();
connection.close();
}
}


Re: [basex-talk] Oracle blob

2014-05-07 Thread Erol Akarsu
Scott,

Like to insert pdf document or image  into one blob field of a table,

Erol Akarsu


On Wed, May 7, 2014 at 5:49 PM, Bednar, Scott E
wrote:

>  Erol, I don’t know of a way to set this dynamically (though there might
> be some method of doing this…) Are you saying you need to have the
> proprietary Oracle XMLType returned sometimes, and the JDBC standard SQLXML
> type object others? I’d stick with the standard if you can.
>
>
>
> Scott
>
>
>
> *From:* Erol Akarsu [mailto:eaka...@gmail.com]
> *Sent:* Wednesday, May 07, 2014 1:37 PM
> *To:* Bednar, Scott E
> *Cc:* Dirk Kirsten; basex-talk@mailman.uni-konstanz.de
>
> *Subject:* Re: [basex-talk] Oracle blob
>
>
>
> Scott,
>
> I want  this setting for only importing blob data but doesn't need all
> other times,
>
> >set PROPS=-Doracle.jdbc.getObjectReturnsXMLType="false"
>
>
> Is there a way to turn on and off for this setting in basex application
> instead of setting it globally?
>
> Thanks
>
> Erol Akarsu
>
>
>
> On Wed, May 7, 2014 at 4:13 PM, Bednar, Scott E 
> wrote:
>
>  My experience has been limited to extracting XML CLOBs from Oracle,
> however some of the setup information I posted may be of use:
>
> https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-March/006507.html
>
>
>
> Also, you might take a look at the Oracle documentation for LOB creation
> in JDBC 4.0:
>
> http://docs.oracle.com/cd/E18283_01/java.112/e16548/jdbcvers.htm#BCFIDIEH
>
> I’m not sure BaseX supports this JDBC interface or not, but it did for XML
> extraction.
>
>
>
> Thanks, Scott
>
>
>
> *From:* Erol Akarsu [mailto:eaka...@gmail.com]
> *Sent:* Wednesday, May 07, 2014 12:56 PM
> *To:* Dirk Kirsten; Bednar, Scott E
> *Cc:* basex-talk@mailman.uni-konstanz.de
> *Subject:* Re: [basex-talk] Oracle blob
>
>
>
> Scott,
>
> Can you please share your experience?
>
> Thanks
>
>
>
> On Wed, May 7, 2014 at 3:43 PM, Dirk Kirsten  wrote:
>
> Hello Erol,
>
> Some time ago we had a short discussion on the ML about using clob with
> Oracle:
> https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-March/006481.html
>
> Blob is even a standard java.sql type and should work fine. If not,
> don't hesitate to report a bug here.
>
> Cheers,
> Dirk
>
> PS: Next time you might want to start a new conversion with a different
> title... makes stuff easier to find in the future for other people,
> which might run into the same problem.
>
> On 07/05/14 21:35, Erol Akarsu wrote:
> > Thanks Marco,
> >
> > I have another question.
> > I am trying to use Basex's SQL functions. I have tried some basic SQL
> > commands for connecting and selecting some rows from table, it works
> fine.
> >
> > For my project, I need to upload and export pdf document/word
> > doc/images  form/into Oracle database that needs some special
> > oracle-specific stuff.
> > Has anybody tried to upload blob/digital document to Oracle with Basex?
> > I appreciate any help
> >
> > Erol Akarsu
> >
> >
> > On Tue, May 6, 2014 at 2:07 PM, Marco Lettere  > <mailto:marco.lett...@dedalus.eu>> wrote:
> >
> > Hi Erol,.
> > try
> >
> > element book {
> >
> >   for $i in 1 to 4
> >   return attribute {xs:QName("isbn_" || $i)} { "value" || $i}
> >
> > }
> >
> > Regards,
> > Marco.
> >
> >
> > On 06/05/2014 19:48, Erol Akarsu wrote:
> >
> > I would like to create an xml element that will have dynamic
> > number of attributes, something like this where n will change
> > and $value_1 to $value_2 will be provided by outside
> >
> > element book {
> >  attribute isbn_1 {$value_1}
> > attribute isbn_2 {$value_2}
> > attribute isbn_3 {$value_3}
> > .
> > .
> > .
> > attribute isbn_n {$value_n}
> > }
> >
> > Can we do it?
> >
> > Thanks
> >
> >
> >
>
> --
> Dirk Kirsten, BaseX GmbH, http://basex.org
> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
> |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
> `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
>
>
>
>
>


Re: [basex-talk] Oracle blob

2014-05-07 Thread Erol Akarsu
Also,

I need to upload binary data into Oracle and can see I can not do it with
current Basex. Am I wrong?
Probably, I need to use native method calls. How can I get Connection
object from sql:connect basex xquery method?
Then I can call creatBlob method on connection object as the following

http://docs.oracle.com/cd/E18283_01/java.112/e16548/jdbcvers.htm#BCFIDIEH

Connection con = DriverManager.getConnection(url, props);
Blob aBlob = con.createBlob();
// Add data to the BLOB object.
aBlob.setBytes(...);




On Wed, May 7, 2014 at 4:37 PM, Erol Akarsu  wrote:

> Scott,
>
> I want  this setting for only importing blob data but doesn't need all
> other times,
>
> >set PROPS=-Doracle.jdbc.getObjectReturnsXMLType="false"
>
> Is there a way to turn on and off for this setting in basex application
> instead of setting it globally?
>
> Thanks
>
> Erol Akarsu
>
>
>
> On Wed, May 7, 2014 at 4:13 PM, Bednar, Scott E  > wrote:
>
>>  My experience has been limited to extracting XML CLOBs from Oracle,
>> however some of the setup information I posted may be of use:
>>
>>
>> https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-March/006507.html
>>
>>
>>
>> Also, you might take a look at the Oracle documentation for LOB creation
>> in JDBC 4.0:
>>
>> http://docs.oracle.com/cd/E18283_01/java.112/e16548/jdbcvers.htm#BCFIDIEH
>>
>> I’m not sure BaseX supports this JDBC interface or not, but it did for
>> XML extraction.
>>
>>
>>
>> Thanks, Scott
>>
>>
>>
>> *From:* Erol Akarsu [mailto:eaka...@gmail.com]
>> *Sent:* Wednesday, May 07, 2014 12:56 PM
>> *To:* Dirk Kirsten; Bednar, Scott E
>> *Cc:* basex-talk@mailman.uni-konstanz.de
>> *Subject:* Re: [basex-talk] Oracle blob
>>
>>
>>
>> Scott,
>>
>> Can you please share your experience?
>>
>> Thanks
>>
>>
>>
>> On Wed, May 7, 2014 at 3:43 PM, Dirk Kirsten  wrote:
>>
>> Hello Erol,
>>
>> Some time ago we had a short discussion on the ML about using clob with
>> Oracle:
>>
>> https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-March/006481.html
>>
>> Blob is even a standard java.sql type and should work fine. If not,
>> don't hesitate to report a bug here.
>>
>> Cheers,
>> Dirk
>>
>> PS: Next time you might want to start a new conversion with a different
>> title... makes stuff easier to find in the future for other people,
>> which might run into the same problem.
>>
>> On 07/05/14 21:35, Erol Akarsu wrote:
>> > Thanks Marco,
>> >
>> > I have another question.
>> > I am trying to use Basex's SQL functions. I have tried some basic SQL
>> > commands for connecting and selecting some rows from table, it works
>> fine.
>> >
>> > For my project, I need to upload and export pdf document/word
>> > doc/images  form/into Oracle database that needs some special
>> > oracle-specific stuff.
>> > Has anybody tried to upload blob/digital document to Oracle with Basex?
>> > I appreciate any help
>> >
>> > Erol Akarsu
>> >
>> >
>> > On Tue, May 6, 2014 at 2:07 PM, Marco Lettere > > <mailto:marco.lett...@dedalus.eu>> wrote:
>> >
>> > Hi Erol,.
>> > try
>> >
>> > element book {
>> >
>> >   for $i in 1 to 4
>> >   return attribute {xs:QName("isbn_" || $i)} { "value" || $i}
>> >
>> > }
>> >
>> > Regards,
>> > Marco.
>> >
>> >
>> > On 06/05/2014 19:48, Erol Akarsu wrote:
>> >
>> > I would like to create an xml element that will have dynamic
>> > number of attributes, something like this where n will change
>> > and $value_1 to $value_2 will be provided by outside
>> >
>> > element book {
>> >  attribute isbn_1 {$value_1}
>> > attribute isbn_2 {$value_2}
>> > attribute isbn_3 {$value_3}
>> > .
>> > .
>> > .
>> > attribute isbn_n {$value_n}
>> > }
>> >
>> > Can we do it?
>> >
>> > Thanks
>> >
>> >
>> >
>>
>> --
>> Dirk Kirsten, BaseX GmbH, http://basex.org
>> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
>> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
>> |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
>> `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
>>
>>
>>
>
>


Re: [basex-talk] Oracle blob

2014-05-07 Thread Erol Akarsu
Scott,

I want  this setting for only importing blob data but doesn't need all
other times,

>set PROPS=-Doracle.jdbc.getObjectReturnsXMLType="false"

Is there a way to turn on and off for this setting in basex application
instead of setting it globally?

Thanks

Erol Akarsu



On Wed, May 7, 2014 at 4:13 PM, Bednar, Scott E
wrote:

>  My experience has been limited to extracting XML CLOBs from Oracle,
> however some of the setup information I posted may be of use:
>
> https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-March/006507.html
>
>
>
> Also, you might take a look at the Oracle documentation for LOB creation
> in JDBC 4.0:
>
> http://docs.oracle.com/cd/E18283_01/java.112/e16548/jdbcvers.htm#BCFIDIEH
>
> I’m not sure BaseX supports this JDBC interface or not, but it did for XML
> extraction.
>
>
>
> Thanks, Scott
>
>
>
> *From:* Erol Akarsu [mailto:eaka...@gmail.com]
> *Sent:* Wednesday, May 07, 2014 12:56 PM
> *To:* Dirk Kirsten; Bednar, Scott E
> *Cc:* basex-talk@mailman.uni-konstanz.de
> *Subject:* Re: [basex-talk] Oracle blob
>
>
>
> Scott,
>
> Can you please share your experience?
>
> Thanks
>
>
>
> On Wed, May 7, 2014 at 3:43 PM, Dirk Kirsten  wrote:
>
> Hello Erol,
>
> Some time ago we had a short discussion on the ML about using clob with
> Oracle:
> https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-March/006481.html
>
> Blob is even a standard java.sql type and should work fine. If not,
> don't hesitate to report a bug here.
>
> Cheers,
> Dirk
>
> PS: Next time you might want to start a new conversion with a different
> title... makes stuff easier to find in the future for other people,
> which might run into the same problem.
>
> On 07/05/14 21:35, Erol Akarsu wrote:
> > Thanks Marco,
> >
> > I have another question.
> > I am trying to use Basex's SQL functions. I have tried some basic SQL
> > commands for connecting and selecting some rows from table, it works
> fine.
> >
> > For my project, I need to upload and export pdf document/word
> > doc/images  form/into Oracle database that needs some special
> > oracle-specific stuff.
> > Has anybody tried to upload blob/digital document to Oracle with Basex?
> > I appreciate any help
> >
> > Erol Akarsu
> >
> >
> > On Tue, May 6, 2014 at 2:07 PM, Marco Lettere  > <mailto:marco.lett...@dedalus.eu>> wrote:
> >
> > Hi Erol,.
> > try
> >
> > element book {
> >
> >   for $i in 1 to 4
> >   return attribute {xs:QName("isbn_" || $i)} { "value" || $i}
> >
> > }
> >
> > Regards,
> > Marco.
> >
> >
> > On 06/05/2014 19:48, Erol Akarsu wrote:
> >
> > I would like to create an xml element that will have dynamic
> > number of attributes, something like this where n will change
> > and $value_1 to $value_2 will be provided by outside
> >
> > element book {
> >  attribute isbn_1 {$value_1}
> > attribute isbn_2 {$value_2}
> > attribute isbn_3 {$value_3}
> > .
> > .
> > .
> > attribute isbn_n {$value_n}
> > }
> >
> > Can we do it?
> >
> > Thanks
> >
> >
> >
>
> --
> Dirk Kirsten, BaseX GmbH, http://basex.org
> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
> |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
> `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
>
>
>


Re: [basex-talk] Oracle blob

2014-05-07 Thread Erol Akarsu
Thanks Scott,

I appreciate it

Erol Akarsu


On Wed, May 7, 2014 at 4:13 PM, Bednar, Scott E
wrote:

>  My experience has been limited to extracting XML CLOBs from Oracle,
> however some of the setup information I posted may be of use:
>
> https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-March/006507.html
>
>
>
> Also, you might take a look at the Oracle documentation for LOB creation
> in JDBC 4.0:
>
> http://docs.oracle.com/cd/E18283_01/java.112/e16548/jdbcvers.htm#BCFIDIEH
>
> I’m not sure BaseX supports this JDBC interface or not, but it did for XML
> extraction.
>
>
>
> Thanks, Scott
>
>
>
> *From:* Erol Akarsu [mailto:eaka...@gmail.com]
> *Sent:* Wednesday, May 07, 2014 12:56 PM
> *To:* Dirk Kirsten; Bednar, Scott E
> *Cc:* basex-talk@mailman.uni-konstanz.de
> *Subject:* Re: [basex-talk] Oracle blob
>
>
>
> Scott,
>
> Can you please share your experience?
>
> Thanks
>
>
>
> On Wed, May 7, 2014 at 3:43 PM, Dirk Kirsten  wrote:
>
> Hello Erol,
>
> Some time ago we had a short discussion on the ML about using clob with
> Oracle:
> https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-March/006481.html
>
> Blob is even a standard java.sql type and should work fine. If not,
> don't hesitate to report a bug here.
>
> Cheers,
> Dirk
>
> PS: Next time you might want to start a new conversion with a different
> title... makes stuff easier to find in the future for other people,
> which might run into the same problem.
>
> On 07/05/14 21:35, Erol Akarsu wrote:
> > Thanks Marco,
> >
> > I have another question.
> > I am trying to use Basex's SQL functions. I have tried some basic SQL
> > commands for connecting and selecting some rows from table, it works
> fine.
> >
> > For my project, I need to upload and export pdf document/word
> > doc/images  form/into Oracle database that needs some special
> > oracle-specific stuff.
> > Has anybody tried to upload blob/digital document to Oracle with Basex?
> > I appreciate any help
> >
> > Erol Akarsu
> >
> >
> > On Tue, May 6, 2014 at 2:07 PM, Marco Lettere  > <mailto:marco.lett...@dedalus.eu>> wrote:
> >
> > Hi Erol,.
> > try
> >
> > element book {
> >
> >   for $i in 1 to 4
> >   return attribute {xs:QName("isbn_" || $i)} { "value" || $i}
> >
> > }
> >
> > Regards,
> > Marco.
> >
> >
> > On 06/05/2014 19:48, Erol Akarsu wrote:
> >
> > I would like to create an xml element that will have dynamic
> > number of attributes, something like this where n will change
> > and $value_1 to $value_2 will be provided by outside
> >
> > element book {
> >  attribute isbn_1 {$value_1}
> > attribute isbn_2 {$value_2}
> > attribute isbn_3 {$value_3}
> > .
> > .
> > .
> > attribute isbn_n {$value_n}
> > }
> >
> > Can we do it?
> >
> > Thanks
> >
> >
> >
>
> --
> Dirk Kirsten, BaseX GmbH, http://basex.org
> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
> |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
> `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
>
>
>


Re: [basex-talk] Oracle blob

2014-05-07 Thread Erol Akarsu
Scott,

Can you please share your experience?

Thanks


On Wed, May 7, 2014 at 3:43 PM, Dirk Kirsten  wrote:

> Hello Erol,
>
> Some time ago we had a short discussion on the ML about using clob with
> Oracle:
> https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-March/006481.html
>
> Blob is even a standard java.sql type and should work fine. If not,
> don't hesitate to report a bug here.
>
> Cheers,
> Dirk
>
> PS: Next time you might want to start a new conversion with a different
> title... makes stuff easier to find in the future for other people,
> which might run into the same problem.
>
> On 07/05/14 21:35, Erol Akarsu wrote:
> > Thanks Marco,
> >
> > I have another question.
> > I am trying to use Basex's SQL functions. I have tried some basic SQL
> > commands for connecting and selecting some rows from table, it works
> fine.
> >
> > For my project, I need to upload and export pdf document/word
> > doc/images  form/into Oracle database that needs some special
> > oracle-specific stuff.
> > Has anybody tried to upload blob/digital document to Oracle with Basex?
> > I appreciate any help
> >
> > Erol Akarsu
> >
> >
> > On Tue, May 6, 2014 at 2:07 PM, Marco Lettere  > <mailto:marco.lett...@dedalus.eu>> wrote:
> >
> > Hi Erol,.
> > try
> >
> > element book {
> >
> >   for $i in 1 to 4
> >   return attribute {xs:QName("isbn_" || $i)} { "value" || $i}
> >
> > }
> >
> > Regards,
> > Marco.
> >
> >
> > On 06/05/2014 19:48, Erol Akarsu wrote:
> >
> > I would like to create an xml element that will have dynamic
> > number of attributes, something like this where n will change
> > and $value_1 to $value_2 will be provided by outside
> >
> > element book {
> >  attribute isbn_1 {$value_1}
> > attribute isbn_2 {$value_2}
> > attribute isbn_3 {$value_3}
> > .
> > .
> > .
> > attribute isbn_n {$value_n}
> > }
> >
> > Can we do it?
> >
> > Thanks
> >
> >
> >
>
> --
> Dirk Kirsten, BaseX GmbH, http://basex.org
> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
> |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
> `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
>


Re: [basex-talk] dynamic number of attributes

2014-05-07 Thread Erol Akarsu
Thanks Marco,

I have another question.
I am trying to use Basex's SQL functions. I have tried some basic SQL
commands for connecting and selecting some rows from table, it works fine.

For my project, I need to upload and export pdf document/word doc/images
form/into Oracle database that needs some special oracle-specific stuff.
Has anybody tried to upload blob/digital document to Oracle with Basex?
I appreciate any help

Erol Akarsu


On Tue, May 6, 2014 at 2:07 PM, Marco Lettere wrote:

> Hi Erol,.
> try
>
> element book {
>
>   for $i in 1 to 4
>   return attribute {xs:QName("isbn_" || $i)} { "value" || $i}
>
> }
>
> Regards,
> Marco.
>
>
> On 06/05/2014 19:48, Erol Akarsu wrote:
>
>> I would like to create an xml element that will have dynamic number of
>> attributes, something like this where n will change and $value_1 to
>> $value_2 will be provided by outside
>>
>> element book {
>>  attribute isbn_1 {$value_1}
>> attribute isbn_2 {$value_2}
>> attribute isbn_3 {$value_3}
>> .
>> .
>> .
>> attribute isbn_n {$value_n}
>> }
>>
>> Can we do it?
>>
>> Thanks
>>
>
>


Re: [basex-talk] dynamic number of attributes

2014-05-06 Thread Erol Akarsu
Dirk,

Super duper!


On Tue, May 6, 2014 at 1:55 PM, Dirk Kirsten  wrote:

> Hi Erol,
>
> Yes, you can.
>
> Something like the following should work:
>
> element book {
>   for $i in 1 to $n
>   return attribute {"isbn_" || $i} {get-value($i)}
> }
>
> Cheers,
> Dirk
>
> On 06/05/14 19:48, Erol Akarsu wrote:
> > I would like to create an xml element that will have dynamic number of
> > attributes, something like this where n will change and $value_1 to
> > $value_2 will be provided by outside
> >
> > element book {
> >  attribute isbn_1 {$value_1}
> > attribute isbn_2 {$value_2}
> > attribute isbn_3 {$value_3}
> > .
> > .
> > .
> > attribute isbn_n {$value_n}
> > }
> >
> > Can we do it?
> >
> > Thanks
> >
>
> --
> Dirk Kirsten, BaseX GmbH, http://basex.org
> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
> |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
> `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
>


[basex-talk] dynamic number of attributes

2014-05-06 Thread Erol Akarsu
I would like to create an xml element that will have dynamic number of
attributes, something like this where n will change and $value_1 to
$value_2 will be provided by outside

element book {
 attribute isbn_1 {$value_1}
attribute isbn_2 {$value_2}
attribute isbn_3 {$value_3}
.
.
.
attribute isbn_n {$value_n}
}

Can we do it?

Thanks


Re: [basex-talk] Class loading error

2014-03-27 Thread Erol Akarsu
I would like to use xml source w/o creating database
Is it possible?


On Thu, Mar 27, 2014 at 8:58 AM, Christian Grün
wrote:

> Hi Erol,
>
> please give us some more details on what you want to do. Do you want
> to create databases from your input, or do you simply want to use it
> for online (ad-hoc) queries?
>
> Christian
>
>
>
> On Wed, Mar 26, 2014 at 8:43 PM, Erol Akarsu  wrote:
> > Sorry, throw this question, that is my fault.
> >
> > I have another question.
> > Until now, I was able to read huge xml file (several Gbytes) through
> > partition it and parse it with basex part by part.
> > Do we have any new utility that can read 3-5G xml file and parse through
> > basex?
> >
> > Thanks
> >
> > Erol Akarsu
> >
> >
> >
> > On Wed, Mar 26, 2014 at 10:16 AM, Erol Akarsu  wrote:
> >>
> >> Sorry the mail sent incomplete. When I run, I am getting this exception.
> >> Actually, I have added all libs to project and eclipse compiles project
> >> successfully. but when I run, getting exception. I send in previous
> email
> >> the eclipse project description.
> >>
> >> Exception in thread "main" java.lang.NoClassDefFoundError:
> BaseXException
> >> Caused by: java.lang.ClassNotFoundException: BaseXException
> >> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> >> at java.security.AccessController.doPrivileged(Native Method)
> >> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> >> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> >> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> >> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> >>
> >>
> >> On Wed, Mar 26, 2014 at 10:14 AM, Erol Akarsu 
> wrote:
> >>>
> >>> I am trying to run WikiExample  coming as examples in eclipse. I moved
> >>> all basex jars into lib folder of eclipse project that includes
> WikiExample
> >>> basex application. But when I run
> >>>
> >>>
> >>
> >
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Class loading error

2014-03-26 Thread Erol Akarsu
Sorry, throw this question, that is my fault.

I have another question.
Until now, I was able to read huge xml file (several Gbytes) through
partition it and parse it with basex part by part.
Do we have any new utility that can read 3-5G xml file and parse through
basex?

Thanks

Erol Akarsu



On Wed, Mar 26, 2014 at 10:16 AM, Erol Akarsu  wrote:

> Sorry the mail sent incomplete. When I run, I am getting this exception.
> Actually, I have added all libs to project and eclipse compiles project
> successfully. but when I run, getting exception. I send in previous email
> the eclipse project description.
>
> Exception in thread "main" java.lang.NoClassDefFoundError: BaseXException
> Caused by: java.lang.ClassNotFoundException: BaseXException
> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>
>
> On Wed, Mar 26, 2014 at 10:14 AM, Erol Akarsu  wrote:
>
>> I am trying to run WikiExample  coming as examples in eclipse. I moved
>> all basex jars into lib folder of eclipse project that includes WikiExample
>> basex application. But when I run
>>
>>
>>
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] CDATA in xquery

2013-12-02 Thread Erol Akarsu
Liam,

Thanks for help,
Basex implements serialize function. This can do:

   let $params := http://www.w3.org/2010/xslt-xquery-serialization";>
  


let $sf :=  fn:concat(fn:serialize(Features:,$params),
fn:serialize(,$params),
fn:serialize(

  {$f1}
  {$f2}
  {$f3}
,
$params))



On Mon, Dec 2, 2013 at 3:44 PM, Liam R E Quin  wrote:

> On Mon, 2013-12-02 at 15:29 -0500, Erol Akarsu wrote:
> > I would like to generate CDATA of one xmk construct like this.
> [...]
> > let $allfs := 
> >   {$name}
> >   
> > 
> >   
> >   
>
> Watch out that if $f1 (say) contains the string ]]> you'd be liable to a
> cdata injection attack.
>
> Having said that, no, I'd probably write an e() function,
> declare function my:e($name as xs:string, $content as xs:string)
> as xs:string
> {
>   return concat("<", $name, ">", $content, "")
> }
>
> and use my:e("ul",
>   concat(my:e("li", $f1),
>  my:e("li", $f2),
>  my:e("li", $f3))
> and so on. Which gives you slightly more checking.
>
> The implementation will probably generate < and > rather than
> CDATA; XML says they're equivalent.
>
> In XQuery 3 there's a per-element serialization option for CDATA
> sections,
>
> http://www.w3.org/TR/xslt-xquery-serialization-30/#XML_CDATA-SECTION-ELEMENTS
> so if BaseX implements that you have a way to get closer to what you
> want, perhaps, e.g. for generating RSS. However, you'd still need to
> construct a string containing "" etc.
>
> Liam
>
>
> --
> Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
> Pictures from old books: http://fromoldbooks.org/
> Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
>
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] CDATA in xquery

2013-12-02 Thread Erol Akarsu
I would like to generate CDATA of one xmk construct like this.
This does not calculate $1,$f2 and $f3 and insert their serialized version
into features tag
Can we do this in xquery?

let $allfs := 
  {$name}
  

  
  

Erol Akarsu
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Basex with Multithreading

2013-10-24 Thread Erol Akarsu
Christian,

One option. Suppose we have an xml doc that contains same elements inside
like

   ..
  .. 
  ...


We can partition all b'b blocks inside clojure and call clojure functions
that will work parallel seamless way. Each clojure function will call
xquery through basex' java bridge to process its xml block.
Clojure will collect results of all parallel functions and write into disk
or call other xquery functions.

Or Clojure call basex to partition xml file and return back parts. Clojure
will then call parallel functions with parts

In this way, whenever we need xml processing, clojure will call basex. All
threading will be supported by clojure.

Erol Akarsu








On Thu, Oct 24, 2013 at 6:49 PM, Christian Grün  wrote:

> > For example, I have big load of urls to crawl. Urls can be split to
> multiple
> > chunks. Basex can start multiple function calls in parallel that deals
> one
> > chunk.
> > After functions finished, we can merge results. This is basic way.
>
> Haskell provides the Strategies library for that:
>
>
> http://hackage.haskell.org/package/parallel-3.1.0.1/docs/Control-Parallel-Strategies.html
>
> It would be rather easy to implement some first quick hacks that
> provide simple multi-threading, but it gets a real challenge if you
> want to make the feature production safe. This is different for
> languages like Clojure, because parallel programming is at the very
> core of the language.
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Basex with Multithreading

2013-10-24 Thread Erol Akarsu
Christian,

For example, I have big load of urls to crawl. Urls can be split to
multiple chunks. Basex can start multiple function calls in parallel that
deals one chunk.
After functions finished, we can merge results. This is basic way.

I think that we can benefit excellent concurrency feature of clojure
language. basex can call clojure functions but I don't know how


On Thu, Oct 24, 2013 at 6:33 PM, Christian Grün  wrote:

> Hi Erol,
>
> I can also imagine various use cases in which multithreading would be
> beneficial. Have you already thought about ways how multithreaded
> execution could work in XQuery?
>
> Christian
> ________
>
> 2013/10/24 Erol Akarsu :
> > I am working on crawling data. I can see it is taking a lot of time
> because
> > xquery is pulling
> > web pages one by one. But popular crawlers like apache Nutch has
> > multithreading support so it can open multiple socket connections to
> > multiple sites so that it can crawl very fast.
> > Can we make add multithreading support basex? So it can run multiple
> xquery
> > functions in parallel
> > and then merge results?
> > Initially, merging results can be done manually. At least, if we can
> > distribute loads to different xquery functions, that would be great.
> >
> > Erol Akarsu
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] Basex with Multithreading

2013-10-24 Thread Erol Akarsu
I am working on crawling data. I can see it is taking a lot of time because
xquery is pulling
web pages one by one. But popular crawlers like apache Nutch has
multithreading support so it can open multiple socket connections to
multiple sites so that it can crawl very fast.
Can we make add multithreading support basex? So it can run multiple xquery
functions in parallel
and then merge results?
Initially, merging results can be done manually. At least, if we can
distribute loads to different xquery functions, that would be great.

Erol Akarsu
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] Fwd: Announcing XQS: XQuery for Scala

2013-09-06 Thread Erol Akarsu
-- Forwarded message --
From: Marklogic User Community Group Members 
Date: Fri, Sep 6, 2013 at 5:36 AM
Subject: Announcing XQS: XQuery for Scala
To: "Erol Akarsu, PhD" 




  Marklogic User Community

[image: LinkedIn]



  [image: Marklogic User Community]
<http://www.linkedin.com/e/-8wgh2l-hl97lwne-4x/vgq/1772706/eml-anet_dig-h_gn-gl-hdp/?hs=false&tok=0E0_3VdEG0zRU1>

 September 6, 2013


 New Discussions

  *Announcing XQS: XQuery for Scala
*<http://www.linkedin.com/e/-8wgh2l-hl97lwne-4x/vai/1772706/270089160/member/eml-anet_dig-b_nd-pst_ttle-hdp/?hs=false&tok=009wVcBJi0zRU1>

Started by Dino Fancellu, Polyglot Developer at Barclays Corporate Banking

 
Like<http://www.linkedin.com/e/csrff6zr/-8wgh2l-hl97lwne-4x/lvi/1772706/270089160/member/true/eml-anet_dig-b_nd-lk-hdp/?hs=false&tok=2vnxFGEUW0zRU1>·
Flag<http://www.linkedin.com/e/csrfFCE-/-8wgh2l-hl97lwne-4x/fav/1772706/270089160/member/inappropriate/true/eml-anet_dig-b_nd-fl-hdp/?hs=false&tok=208fUJun-0zRU1>





Stop inappropriate content the moment it is posted. Send me an email for
each new discussion
»<http://www.linkedin.com/e/-8wgh2l-hl97lwne-4x/snp/1772706/true/eml-anet_dig-b_f-nwp-hdp/?hs=false&tok=1vYMgg6we0zRU1>

Do you know anybody that might like this group? Invite others to join »
<http://www.linkedin.com/e/-8wgh2l-hl97lwne-4x/sgi/1772706/im-invite/cs-connections/eml-anet_dig-b_f-inv-fl/?hs=false&tok=25Jmu-t8-0zRU1>

 You are receiving Group Digest emails.
Unsubscribe<https://www.linkedin.com/e/-8wgh2l-hl97lwne-4x/ihSC_2-eH7i_lIDOPydFgividrhu/uns/20063/11850246/v7nr5ou47ih5nau/eakarsu%40gmail%2Ecom/-8wgh2l-hl97lwne-4x/eml-anet_dig-f-unsub-hdp/?hs=false&tok=1ZCEDUQgG0zRU1>.


This email was intended for Erol Akarsu, PhD (Software Architect). Learn
why we included
this<http://www.linkedin.com/e/-8wgh2l-hl97lwne-4x/plh/http%3A%2F%2Flinkedin%2Ecusthelp%2Ecom%2Fapp%2Fanswers%2Fdetail%2Fa_id%2F4788/2t30/?hs=false&tok=3-Um9f1_K0zRU1>.
© 2013, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043,
USA
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] [basex-announce] BaseX 7.7: The Happy-Birthday-Leo Edition

2013-08-28 Thread Erol Akarsu
Christian,

I am testing basex 7.7

I have xquery script that definition at top of file:

declare option output:omit-xml-declaration "no";

This script is writing xslx file in xml format after preparing it. It is
writing with file:write function.

But I have 2 issues compared to basex 7.2

1 - I don't have this as first file of output xml file


2 - Every row I create, I have empty name space declaration:



Can you help on this?

Erol Akarsu


On Wed, Aug 7, 2013 at 9:03 AM, Christian Grün wrote:

> Hi everyone,
>
> we are excited to give you Version 7.7 of BaseX -- the Happy-Birthday-Leo
> Edition -- which provides a bunch of new and improved features:
>
>  XQUERY
>  - Support for XQuery 3.0 has been finalized
>http://docs.basex.org/wiki/XQuery_3.0
>  - the Unit Module allows standardized testing of XQuery applications
>http://docs.basex.org/wiki/Unit_Module
>  - the Streaming Module speeds up operations on large files
>http://docs.basex.org/wiki/Streaming_Module
>  - the Inspection Module provides reflection and documentation features
>http://docs.basex.org/wiki/Inspection_Module
>  - we have added support for XQuery collations
>http://docs.basex.org/wiki/Full-Text#Collations
>  - we have extended the Database, Archive, File and other Modules
>http://docs.basex.org/wiki/Module_Library
>
>  WEB/HTTP SERVICES:
>  - WebDAV has been enriched with locking features (sponsored feature!)
>http://docs.basex.org/wiki/WebDAV#Locking
>  - RESTXQ has been improved and extended:
>http://docs.basex.org/wiki/RESTXQ
>
>  CORE
>  - improved database locking, including the use of custom lock strings
>http://docs.basex.org/wiki/Transaction_Management
>  - database names have got more flexible
>http://docs.basex.org/wiki/Commands#Valid_Names
>  - we have new options for simplifying the creation of large databases
>http://docs.basex.org/wiki/Options
>
> BaseX is one of the leading open source XML database and XQuery 3.0
> processors, including full support for the W3C Update and Full Text
> extensions. An interactive GUI frontend gives you great insight into your
> XML documents, and the client-/server-architecture and web services make it
> a great framework for building powerful web applications. Please find more
> information at: http://basex.org
>
> Have fun with our new release!
> Looking forward to your feedback,
>
> Christian
> BaseX Team, 2013
>
>
> ___
> BaseX-Announce mailing list
> basex-annou...@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-announce
>
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Setting User-Agent for http:send-request?

2012-11-01 Thread Erol Akarsu
Christian,

That is what I wanted and it worked!

I have another thing I need. I need to post a document to a http service
that expects a xml document. To do this, I need to attach an xml document
with http post request
Do we have an example in basex:rrequest to make an http post with
attachment?

Thanks

Erol Akarsu


On Wed, Oct 31, 2012 at 6:25 PM, Christian Grün  wrote:

> This may work:
>
>   
>
> The spec may give you some more hints [1].
> Christian
>
> [1] http://www.expath.org/spec/http-client
>
>
> > I am trying to set User-Agent header attribute for an HTTP request with
> > following code snippet.
> >
> >
> > let $content := http:send-request( > status-only='false' User-Agent='Mozilla/5.0'/>, $url)
> >  let $body := $content[2]
> >  return $body
> >
> > But It is sending "Java/1.7.0_02" as User-Agent header attribute. This
> has
> > been taken from wireshark:
> >
> > GET / HTTP/1.1
> > User-Agent: Java/1.7.0_02
> > Host: istanbul.olx.com.tr
> > Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> > Connection: keep-alive
> >
> > Do we have any way to set the user-agent attribute?
> >
> > Thanks
> >
> > Erol Akarsu
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] Setting User-Agent for http:send-request?

2012-10-31 Thread Erol Akarsu
Hi,

I am trying to set User-Agent header attribute for an HTTP request with
following code snippet.


let $content := http:send-request(, $url)
 let $body := $content[2]
 return $body

But It is sending "Java/1.7.0_02" as User-Agent header attribute. This has
been taken from wireshark:

GET / HTTP/1.1
User-Agent: Java/1.7.0_02
Host: istanbul.olx.com.tr
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive

Do we have any way to set the user-agent attribute?

Thanks

Erol Akarsu
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Who is using...?

2012-05-24 Thread Erol Akarsu
Christian,

I am using zip module. If you provide same functionality with different
approach, that would be fine.

Erol Akarsu

On Thu, May 24, 2012 at 5:03 PM, Christian Grün
wrote:

> Hi all,
>
> we are interested in your opinion! As one of our main focus is to keep
> BaseX small and cute (..sad but true: the BaseX core library already
> exceeds 2mb.. ;), we're currently contemplating the removal of two
> existing BaseX features, namely..
>
> 1) the BaseXHTTP client mode (flag -c). Currently, we offer three
> operation modes: default, local, and client  [1]. In client mode, all
> requests are supposed to be passed on to yet another BaseX server
> instance. Currently, however, WebDAV is the only service which is 100%
> compatible with this mode, while RESTXQ isn't tailored at all to
> handle remote database requests. Instead, we are contemplating on
> adding a light-weight XQuery Client API Module, which can then be used
> to explicitly address remote BaseX instances from within XQuery
> whenever databases are not stored locally anyway.
>
> 2) the current ZIP Module. The functionality won't disappear, though:
> we will replace it with a new, more flexible proposal specified by
> Matthias Branter (28msec) and me [2].
>
> In a nutshell: who of you is using either 1) or 2) and would run into
> big troubles if those features were ousted and replaced with the
> approaches we believe are more promising for future development?
>
> Thanks as usual for your feedback, either to the list (preferred) or in
> private,
> Christian
>
> [1] http://docs.basex.org/wiki/Startup_Options#BaseX_HTTP_Server
> [2] http://spex.basex.org/index.php?title=ZIP_Module
> ___
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Java proxy host & port & credentials

2012-05-09 Thread Erol Akarsu
Christian,

How can I set proxy settings with basex 7.2 through XQJ?

You mentioned it in your previous emails.

Thanks

Erol Akarsu

On Tue, May 8, 2012 at 9:47 AM, Erol Akarsu  wrote:

> Christian,
>
> I am not able to use 7.2.1 with XQJ because of not supporting xquery 3.0
> and other features. I am using basex 7.2 with old XQJ,
>
> Erol Akarsu
>
>
> On Tue, May 8, 2012 at 9:29 AM, Charles Foster wrote:
>
>> Hi Erol,
>>
>> I'm unsure of what you're trying to do.
>>
>> The BaseX XQJ client connects to a BaseX Server, similar to an ODBC
>> connection to a Relational Database. It is a persistent connection and
>> the client/server protocol is light-weight as it is binary based [1].
>>
>> Because the protocol is not HTTP based, you can not connect to it via
>> a HTTP proxy, you must connect to a BaseX Server directly which by
>> default listens on port 1984.
>>
>> Regards,
>>
>> Charles
>>
>> [1] http://docs.basex.org/wiki/Server_Protocol
>>
>> On 8 May 2012 14:19, Erol Akarsu  wrote:
>> > Christian,
>> >
>> > No.  I don't know how to set it through XQJ.
>> >
>> > But I tried to set system properties  "http.ProxyHost" and
>> "http.proxyPort"
>> > in Java but it does not have any effect on xquery calling through XQJ.
>> >
>> > Erol Akarsu
>> >
>> >
>> > On Mon, May 7, 2012 at 5:49 PM, Christian Grün <
>> christian.gr...@gmail.com>
>> > wrote:
>> >>
>> >> Have you already set user and password via XQJ? – I'm also cc'ing this
>> >> to Charles Foster, the developer of our latest XQJ implementation.
>> >>
>> >> Christian
>> >> ___
>> >>
>> >> > Christian,
>> >> >
>> >> > No. I have not.
>> >> >
>> >> > But I am using basex through XQJ java interface and need to set proxy
>> >> > host&port and user name and password.
>> >> >
>> >> > Thanks
>> >> >
>> >> > Erol Akarsu
>> >> >
>> >> >
>> >> > On Mon, May 7, 2012 at 5:39 PM, Christian Grün
>> >> > 
>> >> > wrote:
>> >> >>
>> >> >> > I would like basex to use Java proxy host & port & credentials
>> when
>> >> >> > basexis
>> >> >> > making url request to pull binary data from a remote web site.
>> >> >> > How can I set these proxy settings?
>> >> >>
>> >> >> Did you already have a look at the proxy options (PROXYHOST,
>> >> >> PROXYPORT, NONPROXYHOSTS)[1]?
>> >> >> Christian
>> >> >>
>> >> >> [1] http://docs.basex.org/wiki/Options#PROXYHOST
>> >
>> >
>>
>
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Java proxy host & port & credentials

2012-05-08 Thread Erol Akarsu
Christian,

I am not able to use 7.2.1 with XQJ because of not supporting xquery 3.0
and other features. I am using basex 7.2 with old XQJ,

Erol Akarsu

On Tue, May 8, 2012 at 9:29 AM, Charles Foster  wrote:

> Hi Erol,
>
> I'm unsure of what you're trying to do.
>
> The BaseX XQJ client connects to a BaseX Server, similar to an ODBC
> connection to a Relational Database. It is a persistent connection and
> the client/server protocol is light-weight as it is binary based [1].
>
> Because the protocol is not HTTP based, you can not connect to it via
> a HTTP proxy, you must connect to a BaseX Server directly which by
> default listens on port 1984.
>
> Regards,
>
> Charles
>
> [1] http://docs.basex.org/wiki/Server_Protocol
>
> On 8 May 2012 14:19, Erol Akarsu  wrote:
> > Christian,
> >
> > No.  I don't know how to set it through XQJ.
> >
> > But I tried to set system properties  "http.ProxyHost" and
> "http.proxyPort"
> > in Java but it does not have any effect on xquery calling through XQJ.
> >
> > Erol Akarsu
> >
> >
> > On Mon, May 7, 2012 at 5:49 PM, Christian Grün <
> christian.gr...@gmail.com>
> > wrote:
> >>
> >> Have you already set user and password via XQJ? – I'm also cc'ing this
> >> to Charles Foster, the developer of our latest XQJ implementation.
> >>
> >> Christian
> >> _______
> >>
> >> > Christian,
> >> >
> >> > No. I have not.
> >> >
> >> > But I am using basex through XQJ java interface and need to set proxy
> >> > host&port and user name and password.
> >> >
> >> > Thanks
> >> >
> >> > Erol Akarsu
> >> >
> >> >
> >> > On Mon, May 7, 2012 at 5:39 PM, Christian Grün
> >> > 
> >> > wrote:
> >> >>
> >> >> > I would like basex to use Java proxy host & port & credentials when
> >> >> > basexis
> >> >> > making url request to pull binary data from a remote web site.
> >> >> > How can I set these proxy settings?
> >> >>
> >> >> Did you already have a look at the proxy options (PROXYHOST,
> >> >> PROXYPORT, NONPROXYHOSTS)[1]?
> >> >> Christian
> >> >>
> >> >> [1] http://docs.basex.org/wiki/Options#PROXYHOST
> >
> >
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Java proxy host & port & credentials

2012-05-08 Thread Erol Akarsu
Christian,

No.  I don't know how to set it through XQJ.

But I tried to set system properties  "http.ProxyHost" and "http.proxyPort"
in Java but it does not have any effect on xquery calling through XQJ.

Erol Akarsu

On Mon, May 7, 2012 at 5:49 PM, Christian Grün wrote:

> Have you already set user and password via XQJ? – I'm also cc'ing this
> to Charles Foster, the developer of our latest XQJ implementation.
>
> Christian
> ___
>
> > Christian,
> >
> > No. I have not.
> >
> > But I am using basex through XQJ java interface and need to set proxy
> > host&port and user name and password.
> >
> > Thanks
> >
> > Erol Akarsu
> >
> >
> > On Mon, May 7, 2012 at 5:39 PM, Christian Grün <
> christian.gr...@gmail.com>
> > wrote:
> >>
> >> > I would like basex to use Java proxy host & port & credentials when
> >> > basexis
> >> > making url request to pull binary data from a remote web site.
> >> > How can I set these proxy settings?
> >>
> >> Did you already have a look at the proxy options (PROXYHOST,
> >> PROXYPORT, NONPROXYHOSTS)[1]?
> >> Christian
> >>
> >> [1] http://docs.basex.org/wiki/Options#PROXYHOST
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Java proxy host & port & credentials

2012-05-07 Thread Erol Akarsu
Christian,

No. I have not.

But I am using basex through XQJ java interface and need to set proxy
host&port and user name and password.

Thanks

Erol Akarsu

On Mon, May 7, 2012 at 5:39 PM, Christian Grün wrote:

> > I would like basex to use Java proxy host & port & credentials when
> basexis
> > making url request to pull binary data from a remote web site.
> > How can I set these proxy settings?
>
> Did you already have a look at the proxy options (PROXYHOST,
> PROXYPORT, NONPROXYHOSTS)[1]?
> Christian
>
> [1] http://docs.basex.org/wiki/Options#PROXYHOST
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] Java proxy host & port & credentials

2012-05-07 Thread Erol Akarsu
Hi

I would like basex to use Java proxy host & port & credentials when basexis
making url request to pull binary data from a remote web site.
How can I set these proxy settings?

Erol Akarsu
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] HTTP module

2012-05-03 Thread Erol Akarsu
Michael,

Thanks for reply.

I think that should be easy to enhance current basex HTTP support to other
url types like here file:/// for local html files.

We will replace with url fetch with local file downloading.

Isn't it?

Erol Akarsu

On Thu, May 3, 2012 at 2:00 PM, Michael Seiferle  wrote:

> Hi Erol,
> hi list,
>
> I just re-read my last email:
> the "I don't think so"-part is a little misleading, I have not read your
> mail carefully enough I guess.
>
> I was referring to your code example:
>
> http:send-request(, '
> file:///D:/tmp/b000187585.htm')
>
> -> this is indeed impossible, yet:
> with Tagsoup on the classpath, HTML parsing is fully supported as pointed
> out in the wiki.
>
> Sorry for the confusion, had a long day :-)
>
> Kind regards
> Michael
>
>
> Am 03.05.2012 um 19:42 schrieb Michael Seiferle:
>
> I don't think so; unless you provide a web server running locally, as the
> HTTP module relies on the http protocol.
>
>
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] HTTP module

2012-05-03 Thread Erol Akarsu
Is there a way to parse html file located in local hard drive?
Http module of xquery is fantastic, you can retrieve any url content.

but I have already html file locally and need to parse. Can I do it

http://docs.basex.org/wiki/HTTP_Module

I would like to do this successfully:

let $l := http:send-request(, 'file:///D:/tmp/b000187585.htm')

return $l

Thanks

Erol Akarsu

On Tue, May 1, 2012 at 5:24 PM, Christian Grün wrote:

> ...by the way, you can also use our own map implementation to store
> key/value pairs in XQuery:
>
>  http://docs.basex.org/wiki/Map_Module
> ___
>
> On Tue, May 1, 2012 at 11:22 PM, Christian Grün
>  wrote:
> >> I am having problem in making new of Properties object.
> >
> > Thanks; this has been fixed in the latest snapshot, which I've just
> uploaded.
> > Christian
> > __
> >
> >> Query: declare namespace system = "java:java.lang.System";
> >> declare namespace fis = "java:java.io.FileInputStream";
> >> declare namespace p = "java:java.util.Properties";
> >>
> >> let $a := 555
> >> return {(p:new ())}
> >> Error: Improper use? Potential bug? Your feedback is welcome:
> >> Contact: basex-talk@mailman.uni-konstanz.de
> >> Version: BaseX 7.2.1
> >> Java: Sun Microsystems Inc., 1.6.0_22
> >> OS: Windows XP, x86
> >> Stack Trace:
> >> java.lang.RuntimeException: {}
> >>   org.basex.util.Util.notexpected(Util.java:55)
> >>   org.basex.query.item.FuncType.cast(FuncType.java:88)
> >>   org.basex.query.func.JavaMapping.toValue(JavaMapping.java:102)
> >>   org.basex.query.func.JavaMapping.value(JavaMapping.java:77)
> >>   org.basex.query.func.JavaMapping.iter(JavaMapping.java:67)
> >>   org.basex.query.QueryContext.iter(QueryContext.java:275)
> >>   org.basex.query.expr.Constr.add(Constr.java:62)
> >>   org.basex.query.expr.CElem.item(CElem.java:82)
> >>   org.basex.query.expr.CElem.item(CElem.java:1)
> >>   org.basex.query.expr.CFrag.item(CFrag.java:1)
> >>   org.basex.query.expr.ParseExpr.iter(ParseExpr.java:42)
> >>   org.basex.query.QueryContext.iter(QueryContext.java:275)
> >>   org.basex.query.QueryContext.iter(QueryContext.java:229)
> >>   org.basex.query.QueryContext.execute(QueryContext.java:448)
> >>   org.basex.query.QueryProcessor.execute(QueryProcessor.java:94)
> >>   org.basex.core.cmd.AQuery.query(AQuery.java:86)
> >>   org.basex.core.cmd.XQuery.run(XQuery.java:22)
> >>   org.basex.core.Command.run(Command.java:325)
> >>   org.basex.core.Command.exec(Command.java:304)
> >>   org.basex.core.Command.execute(Command.java:76)
> >>   org.basex.gui.GUI.exec(GUI.java:390)
> >>   org.basex.gui.GUI$6.run(GUI.java:342)
> >>
> >>
> >> Erol Akarsu
> >>
> >> On Mon, Apr 30, 2012 at 3:49 PM, Christian Grün <
> christian.gr...@gmail.com>
> >> wrote:
> >>>
> >>> > The new XQJ does not support xquery 3.0 syntax. That is why I have
> >>> > facing
> >>> > issue.
> >>>
> >>> Right, thanks for the update. A future version of XQJ will support all
> >>> current BaseX language features, such as XQuery 3.0 and the Update and
> >>> Full-Text and map extensions. Once again, feel free to ask Charles
> >>> Foster for his timeline (the more feedback he gets, the faster it
> >>> might get implemented).
> >>>
> >>> > How can I use 721 basex with old XQJ?
> >>>
> >>> I'm sorry that's not possible, as we have removed all links to XQJ
> >>> from our core.
> >>>
> >>> Christian
> >>
> >>
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Writing out

2012-04-17 Thread Erol Akarsu
Thanks Christian

The following function takes a lot of time execute. If I don't write the
fetched binary image into file with fn:write-binary function, then it is
quick and no delay.
Somehow, write-binary function call is killing performance here.

do you have any other suggestion to solve this performance issue?

declare function local:fetchDigData ($fileName as xs:string,$url as
xs:string,$binFolder as xs:string) as element()*
{
let $content:=
try {
let $uri := fn:encode-for-uri($url)
let $content := http:send-request(, $url)

let $res :=
file:write-binary(fn:concat($binFolder,$fileName),$content[2])
return $res

}
catch * {
{$err:code, $err:value, " module: ",
$err:module, "(", $err:line-number, ",", $err:column-number,
"in url:",$url,")"}
}
return $content
};


Erol Akarsu
On Tue, Apr 17, 2012 at 3:34 PM, Christian Grün
wrote:

> > Dow we have equivalent function in basex xquery for java static method
> > URLEncoder.encode ?
>
> ..just try encode-for-uri($uri).
> Christian
>
>
> > I need it before sending url request,
> >
> > Thanks
> >
> > Erol Akarsu
> >
> >
> > On Mon, Apr 16, 2012 at 9:32 AM, Dimitar Popov
> >  wrote:
> >>
> >> http://docs.basex.org/wiki/XQuery_3.0#Serialization
> >>
> >> On Apr 16, 2012, at 2:25 PM, Erol Akarsu wrote:
> >>
> >> I would like to write this line into the beginning of an xml file I am
> >> generating. This is a must because I am generating csv file in xml form
> that
> >> should be opened Microsoft Excell.
> >>
> >>
> >> 
> >>
> >>
> >> I tried to use "processing-instruction" like this
> >>
> >> processing-instruction {"xml"}  {'version="1.0"'}
> >>
> >> But I am getting
> >>
> >> Error: [XQDY0064] Processing instruction has illegal name: 'xml'.
> >>
> >> Erol Akarsu
> >>
> >> On Mon, Apr 9, 2012 at 8:41 PM, Charles Duffy 
> wrote:
> >>>
> >>> Howdy --
> >>>
> >>> The following is arguably a bug in my REST bindings rather than the
> >>> server, but it worked as of the 7.2 release but fails as of the current
> >>> 7.2.1 snapshot.
> >>>
> >>> A request akin to the following:
> >>>
> >>> POST /rest HTTP/1.1
> >>> Host: 127.0.0.1:8984
> >>> Content-Length: 86
> >>> Authorization: Basic cmVhZG9ubHk6cmVhZG9ubHk=
> >>> Content-Type: application/x-www-form-urlencoded
> >>> Accept-Encoding: identity, deflate, compress, gzip
> >>> Accept: */*
> >>> User-Agent: python-requests/0.10.6
> >>>
> >>>  >>> xmlns:rest="http://basex.org/rest
> ">1+1
> >>>
> >>> Yields the following response:
> >>>
> >>> HTTP/1.1 400 Bad Request
> >>> Content-Length: 40
> >>> Server: Jetty(6.1.26)
> >>>
> >>> Unknown option ' >>>
> >>> ...but did not do so previously.
> >>> ___
> >>> BaseX-Talk mailing list
> >>> BaseX-Talk@mailman.uni-konstanz.de
> >>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
> >>>
> >>
> >> ___
> >> BaseX-Talk mailing list
> >> BaseX-Talk@mailman.uni-konstanz.de
> >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
> >>
> >>
> >
> >
> > ___
> > BaseX-Talk mailing list
> > BaseX-Talk@mailman.uni-konstanz.de
> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
> >
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Writing out

2012-04-17 Thread Erol Akarsu
Thanks Dimitar,

I have one more question.

Dow we have equivalent function in basex xquery for java static method
URLEncoder.encode ?

I need it before sending url request,

Thanks

Erol Akarsu

On Mon, Apr 16, 2012 at 9:32 AM, Dimitar Popov <
dimitar.po...@uni-konstanz.de> wrote:

> http://docs.basex.org/wiki/XQuery_3.0#Serialization
>
> On Apr 16, 2012, at 2:25 PM, Erol Akarsu wrote:
>
> I would like to write this line into the beginning of an xml file I am
> generating. This is a must because I am generating csv file in xml form
> that should be opened Microsoft Excell.
>
>
> 
>
> I tried to use "processing-instruction" like this
>
> processing-instruction {"xml"}  {'version="1.0"'}
>
> But I am getting
>
> Error: [XQDY0064] Processing instruction has illegal name: 'xml'.
>
> Erol Akarsu
>
> On Mon, Apr 9, 2012 at 8:41 PM, Charles Duffy  wrote:
>
>> Howdy --
>>
>> The following is arguably a bug in my REST bindings rather than the
>> server, but it worked as of the 7.2 release but fails as of the current
>> 7.2.1 snapshot.
>>
>> A request akin to the following:
>>
>> POST /rest HTTP/1.1
>> Host: 127.0.0.1:8984
>> Content-Length: 86
>> Authorization: Basic cmVhZG9ubHk6cmVhZG9ubHk=
>> Content-Type: application/x-www-form-urlencoded
>> Accept-Encoding: identity, deflate, compress, gzip
>> Accept: */*
>> User-Agent: python-requests/0.10.6
>>
>> http://basex.org/rest
>> ">1+1
>>
>> Yields the following response:
>>
>> HTTP/1.1 400 Bad Request
>> Content-Length: 40
>> Server: Jetty(6.1.26)
>>
>> Unknown option '>
>> ...but did not do so previously.
>> ___
>> BaseX-Talk mailing list
>> BaseX-Talk@mailman.uni-konstanz.de
>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>>
>>
> ___
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
>
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] Writing out

2012-04-16 Thread Erol Akarsu
I would like to write this line into the beginning of an xml file I am
generating. This is a must because I am generating csv file in xml form
that should be opened Microsoft Excell.




I tried to use "processing-instruction" like this

processing-instruction {"xml"}  {'version="1.0"'}

But I am getting

Error: [XQDY0064] Processing instruction has illegal name: 'xml'.

Erol Akarsu

On Mon, Apr 9, 2012 at 8:41 PM, Charles Duffy  wrote:

> Howdy --
>
> The following is arguably a bug in my REST bindings rather than the
> server, but it worked as of the 7.2 release but fails as of the current
> 7.2.1 snapshot.
>
> A request akin to the following:
>
> POST /rest HTTP/1.1
> Host: 127.0.0.1:8984
> Content-Length: 86
> Authorization: Basic cmVhZG9ubHk6cmVhZG9ubHk=
> Content-Type: application/x-www-form-urlencoded
> Accept-Encoding: identity, deflate, compress, gzip
> Accept: */*
> User-Agent: python-requests/0.10.6
>
> http://basex.org/rest
> ">1+1
>
> Yields the following response:
>
> HTTP/1.1 400 Bad Request
> Content-Length: 40
> Server: Jetty(6.1.26)
>
> Unknown option '
> ...but did not do so previously.
> ___
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] [XQST0054] Stack Overflow

2012-01-20 Thread Erol Akarsu
Christian,

I am getting this error:

[XQST0054] Stack Overflow: circular variable declaration?

Do you know which can cause this?

I does not happen all the time but some time
Thanks

Erol Akarsu

On Fri, Dec 9, 2011 at 10:45 AM, Christian Grün
wrote:

> > Can I pass command line arguments to basex while executing a xquery
> script?
>
> You may run a script with the "run" command and prefix it with other
> commands. An example:
>
>  basex -c "open ...; ...; run yourquery.xq"
>
> With 7.1 and the latest snapshot, you can use an arbitrary number of
> commands, query files etc:
>
>  basex -c "open" yourquery.xq
>
> Hope this helps,
> Christian
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk