Re: [basex-talk] ePub zips via REST and functional XQuery

2019-08-22 Thread Christian Grün
Hi Steve,

The following options may be helpful for importing EPUB files in one go:

set parser html
set createfilter *.htm,*.html,*.xhtml,*.xml,*.opf
set addraw on
create db db doc.epub

They can all be set via the GUI as well (provided you find the
corresponding checkboxes ;·).

Cheers,
Christian



On Thu, Aug 22, 2019 at 12:17 AM Majewski, Steven Dennis (sdm7g)
 wrote:
>
>
> However, I neglected to notice that all of the html files in the EPUB 
> container were all added as raw files.
> So it’s really just unpacking the EPUB zip into raw/ .
> Serving them up still works, but I’m guessing that will limit some of the 
> search features on the unparsed files.
>
> — Steve.
>
>
> On Aug 21, 2019, at 5:01 PM, Majewski, Steven Dennis (sdm7g) 
>  wrote:
>
> BTW: I was pleasantly surprised to discover that when I made a BaseX database 
> with an ePub zip file, and
> selected the appropriate options ( Parse files in archives, add other files 
> as raw files )
> I was able to serve and view the ePub files thru the rest interface, and 
> links from the TOC to other document parts,
> as well  as images in the ePUB all worked.
>
>


Re: [basex-talk] ePub zips via REST and functional XQuery

2019-08-21 Thread Majewski, Steven Dennis (sdm7g)

However, I neglected to notice that all of the html files in the EPUB container 
were all added as raw files. 
So it’s really just unpacking the EPUB zip into raw/ . 
Serving them up still works, but I’m guessing that will limit some of the 
search features on the unparsed files. 

— Steve. 


> On Aug 21, 2019, at 5:01 PM, Majewski, Steven Dennis (sdm7g) 
>  wrote:
> 
> BTW: I was pleasantly surprised to discover that when I made a BaseX database 
> with an ePub zip file, and 
> selected the appropriate options ( Parse files in archives, add other files 
> as raw files ) 
> I was able to serve and view the ePub files thru the rest interface, and 
> links from the TOC to other document parts,
> as well  as images in the ePUB all worked. 



smime.p7s
Description: S/MIME cryptographic signature


[basex-talk] ePub zips via REST and functional XQuery

2019-08-21 Thread Majewski, Steven Dennis (sdm7g)
BTW: I was pleasantly surprised to discover that when I made a BaseX database 
with an ePub zip file, and 
selected the appropriate options ( Parse files in archives, add other files as 
raw files ) 
I was able to serve and view the ePub files thru the rest interface, and links 
from the TOC to other document parts,
as well  as images in the ePUB all worked. 

I’m also enjoying learning to use some of the higher order function 
capabilities of XQuery 3.1 . 

The arrow syntax and the partial function application seem to be a great way to 
build a pipelines of transforms
that can mix  xslt:transform with XQuery functions . 


The results here aren’t very useful — I was just learning and testing the 
syntax, but this uses the  partial application ‘?’ 
Syntax to convert functions of N-args to functions of 1 arg, and build a list 
of 1-arg functions to feed to fold-left. 
The use case would be to create a map of lists of pipeline functions to be 
applied for different targets. 

Not sure if maintaining pipeline lists is a better way to manage this than just 
building pipelines using arrow => operator,
but I was just trying to explore some of the possible methods.

let $docid := 'SIB/sibv060.xml'
let $t1 := xslt:transform( ?,  "/projects/SIB/add_id_bov.xsl" )
let $t2 := xslt:transform( ?, 
"/projects/XTF/xtf.lib/style/dynaXML/docFormatter/tei/teiDocFormatter.xsl", 
map{ 'docId' : $docid  })
let $t3 := function($in) { $in//*  }
let $pipe := ( $t1, $t2, $t3, function($x) { $x ! name(.) }, distinct-values#1  
)
let $chain := function( $a, $b ) { $b($a) }
return fold-left( $pipe, doc($docid) , $chain )



smime.p7s
Description: S/MIME cryptographic signature