diff --git a/documentation/index.html b/documentation/index.html index adcf7bed3..dd62491fd 100755 --- a/documentation/index.html +++ b/documentation/index.html @@ -1,5 +1,6 @@
-

Digital Syriac Corpus Documentation

+ +

Digital Syriac Corpus Documentation

diff --git a/documentation/wiki.html b/documentation/wiki.html index 3140edd7c..31feac93a 100755 --- a/documentation/wiki.html +++ b/documentation/wiki.html @@ -1,5 +1,6 @@
-

Digital Syriac Corpus Documentation

+ +

Digital Syriac Corpus Documentation

diff --git a/expath-pkg.xml b/expath-pkg.xml index f99c1fb34..5155d4bef 100644 --- a/expath-pkg.xml +++ b/expath-pkg.xml @@ -1,12 +1,6 @@ - + Digital Syriac Corpus - - - - - - \ No newline at end of file diff --git a/modules/content-negotiation/tei2html.xqm b/modules/content-negotiation/tei2html.xqm index 8d7c23876..be4ed3e9a 100644 --- a/modules/content-negotiation/tei2html.xqm +++ b/modules/content-negotiation/tei2html.xqm @@ -386,9 +386,10 @@ declare function tei2html:summary-view-generic($nodes as node()*, $id as xs:stri URI: {$id} else() } -
+
}; + declare function tei2html:summary-view-bibl($nodes as node()*, $id as xs:string?) as item()* { let $title := if($nodes/descendant-or-self::tei:title[@syriaca-tags='#syriaca-headword'][@xml:lang='en']) then $nodes/descendant-or-self::tei:title[@syriaca-tags='#syriaca-headword'][@xml:lang='en'][1]/text() diff --git a/modules/lib/facet.xqm b/modules/lib/facet.xqm index a3787164e..70c0e444e 100644 --- a/modules/lib/facet.xqm +++ b/modules/lib/facet.xqm @@ -276,7 +276,7 @@ return if($facet:fq) then concat('fq=',$facet:fq,$facet-query) else concat('fq=',normalize-space($facet-query)) let $active := if(contains($facet:fq,concat(';fq-',string($f/@name),':',string($key/@value)))) then 'active' else () - return {string($key/@label)} ({string($key/@count)}) + return {string($key/@label)} ({string($key/@count)}) }
{ @@ -285,7 +285,7 @@ return let $new-fq := if($facet:fq) then concat('fq=',$facet:fq,$facet-query) else concat('fq=',$facet-query) - return {string($key/@label)} ({string($key/@count)}) + return {string($key/@label)} ({string($key/@count)}) }
{if($count gt ($f/@show - 1)) then diff --git a/modules/search/search.xqm b/modules/search/search.xqm index 7e7eab2ce..3935f9991 100644 --- a/modules/search/search.xqm +++ b/modules/search/search.xqm @@ -23,6 +23,14 @@ declare namespace tei="http://www.tei-c.org/ns/1.0"; (: Variables:) declare variable $search:start {request:get-parameter('start', 1) cast as xs:integer}; declare variable $search:perpage {request:get-parameter('perpage', 20) cast as xs:integer}; +declare variable $search:q {request:get-parameter('q', '') cast as xs:string}; +declare variable $search:persName {request:get-parameter('persName', '') cast as xs:string}; +declare variable $search:placeName {request:get-parameter('placeName', '') cast as xs:string}; +declare variable $search:title {request:get-parameter('title', '') cast as xs:string}; +declare variable $search:bibl {request:get-parameter('bibl', '') cast as xs:string}; +declare variable $search:idno {request:get-parameter('uri', '') cast as xs:string}; +declare variable $search:sort-element {request:get-parameter('sort-element', '') cast as xs:string}; +declare variable $search:collection {request:get-parameter('collection', '') cast as xs:string}; (:~ : Builds search result, saves to model("hits") for use in HTML display @@ -32,7 +40,7 @@ declare variable $search:perpage {request:get-parameter('perpage', 20) cast as x : Search results stored in map for use by other HTML display functions data:search($collection) :) -declare %templates:wrap function search:search-data($node as node(), $model as map(*), $collection as xs:string?){ +declare %templates:wrap function search:search-data($node as node(), $model as map(*), $collection as xs:string?, $view as xs:string?){ let $coll := if($search:collection != '') then $search:collection else $collection let $keyword-query := data:keyword-search() let $eval-string := concat(search:query-string($collection),facet:facet-filter(global:facet-definition-file($collection))) @@ -62,7 +70,7 @@ declare %templates:wrap function search:search-data($node as node(), $model as m : Builds general search string from main syriaca.org page and search api. :) declare function search:query-string($collection as xs:string?) as xs:string?{ -concat("collection('",$global:data-root,"')//tei:TEI", +concat("collection('",$config:data-root,"')//tei:TEI", data:keyword-search(), data:element-search('author',request:get-parameter('author', '')), data:element-search('title',request:get-parameter('title', '')), @@ -114,7 +122,7 @@ declare function search:bibl(){ normalize-space($search:bibl) else string-join(distinct-values( - for $r in collection($global:data-root || '/bibl')//tei:body[ft:query(.,$terms, data:search-options())]/ancestor::tei:TEI/descendant::tei:publicationStmt/tei:idno[starts-with(.,'http://syriaca.org')][1] + for $r in collection($config:data-root || '/bibl')//tei:body[ft:query(.,$terms, data:search-options())]/ancestor::tei:TEI/descendant::tei:publicationStmt/tei:idno[starts-with(.,'http://syriaca.org')][1] return concat(substring-before($r,'/tei'),'(\s|$)')),'|') return concat("[descendant::tei:bibl/tei:ptr[@target[matches(.,'",$ids,"')]]]") else () @@ -129,7 +137,7 @@ declare function search:idno(){ }; declare function search:catalog-limit(){ - for $r in collection($global:data-root)//tei:titleStmt/tei:title[@level="s"] + for $r in collection($config:data-root)//tei:titleStmt/tei:title[@level="s"] group by $group := $r/@ref order by global:build-sort-string($r[1]/text(),'') return @@ -161,11 +169,11 @@ function search:show-hits($node as node()*, $model as map(*), $collection as xs:
{(tei2html:summary-view($hit, (), $id[1])) } - {(: + { if($expanded//exist:match) then tei2html:output-kwic($expanded, $id) else () - :)()} + }
@@ -252,6 +260,7 @@ declare function search:build-form($search-config) { }; + (:~ : Simple default search form to us if not search-config.xml file is present. Can be customized. :) @@ -293,30 +302,59 @@ declare function search:default-search-form() {
- -
- -
-
- -
- {global:keyboard-select-menu('title')} -
-
-
+ +
+ +
+
+ +
+ {global:keyboard-select-menu('author')} +
+
- -
- -
-
- -
- {global:keyboard-select-menu('placeName')} -
-
-
+
+
+ +
+
+ +
+ {global:keyboard-select-menu('title')} +
+
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
diff --git a/modules/sparql-requests.xql b/modules/sparql-requests.xql index 91e1107e5..316a7e5ac 100644 --- a/modules/sparql-requests.xql +++ b/modules/sparql-requests.xql @@ -1,19 +1,21 @@ -xquery version "3.0"; +xquery version "3.1"; import module namespace http="http://expath.org/ns/http-client"; - -(: - : Take posted SPARQL query and send it to Syriaca.org sparql endpoint +(:~ + : Take posted SPARQL query and send it to the Syriaca.org SPARQL endpoint : Returns JSON - : This will hopefully get around the javascript issues with http/https and same origin. :) -let $query := if(request:get-parameter('query', '')) then request:get-parameter('query', '') - else if(not(empty(request:get-data()))) then request:get-data() - else () -let $subject-sparql-results := +let $query := + if(request:get-parameter('query', '')) then request:get-parameter('query', '') + else if(not(empty(request:get-data()))) then request:get-data() + else () +let $results := try{ - util:base64-decode(http:send-request()[2]) - } catch * {Caught error {$err:code}: {$err:description}} - -return (response:set-header("Content-Type", "application/json"),$subject-sparql-results) + if($query != '') then + util:base64-decode(http:send-request()[2]) + else No query data + } catch * { + Caught error {$err:code}: {$err:description} + } +return (response:set-header("Content-Type", "application/json"), $results) \ No newline at end of file diff --git a/repo-config.xml b/repo-config.xml index 8b4fcd9f1..f2eba77ba 100644 --- a/repo-config.xml +++ b/repo-config.xml @@ -22,7 +22,7 @@ http://syriac-corpus.org/ - /exist/apps/syriac-corpus + syriac-corpus diff --git a/resources/css/main.css b/resources/css/main.css index 92714dd8f..094ad22b2 100644 --- a/resources/css/main.css +++ b/resources/css/main.css @@ -245,9 +245,9 @@ h3.syr{ } h4 {font-size: 1em; margin-top:1em;} -h5 {margin: 1em 0 0 0;} +h5 {margin: 1em 0 0 0; font-weight:600;} -.h5-inline {font-size: 1em; font-weight:500;} +.h5-inline {font-size: 1em; font-weight:600;} .hi {background-color:yellow;} @@ -861,7 +861,7 @@ pre { } .tei-footnote {display:none; font-size:x-small;} .tei-footnote.display {display:inline;} -.text-number.display {display:inline;} +/*.text-number.display {display:inline;}*/ /* Table of Contents */ .toc {display:block; margin-left:.75em;} diff --git a/search.html b/search.html index d9d639c60..fe958e2a8 100644 --- a/search.html +++ b/search.html @@ -4,21 +4,21 @@
-
-
+
+
-
+
-
+
-
+
-
+