From bc0c87601297e738a14235518bb8f9538bf0bb1e Mon Sep 17 00:00:00 2001 From: Conal Tuohy Date: Tue, 19 Mar 2019 22:42:08 +1000 Subject: [PATCH] Initial commit of draft Chymistry web application, including reading and caching P4 from Xubmit, conversion to P5, indexing in Solr, a simple search, and a stub of a conversion to HTML --- README.md | 3 + search-fields.xml | 20 + xproc/administration.xpl | 42 + xproc/convert-to-p5.xpl | 137 +++ xproc/p5-processing.xpl | 68 ++ xproc/search.xpl | 97 ++ xproc/temp-decode-p4-docs.xpl | 21 + xproc/xproc-z-library.xpl | 459 +++++++++ xproc/xproc-z.xpl | 89 ++ xslt/convert-between-xml-and-json.xsl | 27 + xslt/convert-to-p5/from.xsl | 884 ++++++++++++++++++ xslt/convert-to-p5/links.xsl | 20 + xslt/convert-to-p5/p4_to_p5.xsl | 607 ++++++++++++ xslt/convert-to-p5/p4_to_p5_newton.xsl | 532 +++++++++++ xslt/convert-to-p5/purge-foreign.xsl | 54 ++ xslt/convert-to-p5/regularize-dates.xsl | 44 + xslt/convert-to-p5/remove-dubious-default.xsl | 25 + .../convert-to-p5/select-non-emoji-glyphs.xsl | 30 + xslt/p5-to-html.xsl | 18 + xslt/p5-to-solr-index-request.xsl | 27 + xslt/search-parameters-to-solr-request.xsl | 99 ++ xslt/solr-response-to-html.xsl | 268 ++++++ 22 files changed, 3571 insertions(+) create mode 100644 README.md create mode 100644 search-fields.xml create mode 100644 xproc/administration.xpl create mode 100644 xproc/convert-to-p5.xpl create mode 100644 xproc/p5-processing.xpl create mode 100644 xproc/search.xpl create mode 100644 xproc/temp-decode-p4-docs.xpl create mode 100644 xproc/xproc-z-library.xpl create mode 100644 xproc/xproc-z.xpl create mode 100644 xslt/convert-between-xml-and-json.xsl create mode 100644 xslt/convert-to-p5/from.xsl create mode 100644 xslt/convert-to-p5/links.xsl create mode 100755 xslt/convert-to-p5/p4_to_p5.xsl create mode 100755 xslt/convert-to-p5/p4_to_p5_newton.xsl create mode 100644 xslt/convert-to-p5/purge-foreign.xsl create mode 100644 xslt/convert-to-p5/regularize-dates.xsl create mode 100644 xslt/convert-to-p5/remove-dubious-default.xsl create mode 100644 xslt/convert-to-p5/select-non-emoji-glyphs.xsl create mode 100644 xslt/p5-to-html.xsl create mode 100644 xslt/p5-to-solr-index-request.xsl create mode 100644 xslt/search-parameters-to-solr-request.xsl create mode 100644 xslt/solr-response-to-html.xsl diff --git a/README.md b/README.md new file mode 100644 index 0000000..133f5a8 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Newton Chymistry website + +This codebase is a draft of a new version of 'The Chymistry of Isaac Newton', using XProc pipelines to generate a website based on TEI XML encodings of Newton's alchemical manuscripts, and Apache Solr as a search engine. diff --git a/search-fields.xml b/search-fields.xml new file mode 100644 index 0000000..499e0df --- /dev/null +++ b/search-fields.xml @@ -0,0 +1,20 @@ + + + + title + title + + + + + description + description + + + + + text + text + + + \ No newline at end of file diff --git a/xproc/administration.xpl b/xproc/administration.xpl new file mode 100644 index 0000000..afe94d1 --- /dev/null +++ b/xproc/administration.xpl @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + Chymistry admin + + +

Chymistry admin

+

Site updating

+
+ +
+
+ +
+
+ +
+ + +
+
+
+
+
+
+
\ No newline at end of file diff --git a/xproc/convert-to-p5.xpl b/xproc/convert-to-p5.xpl new file mode 100644 index 0000000..f5000fd --- /dev/null +++ b/xproc/convert-to-p5.xpl @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xproc/p5-processing.xpl b/xproc/p5-processing.xpl new file mode 100644 index 0000000..7ef1292 --- /dev/null +++ b/xproc/p5-processing.xpl @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xproc/search.xpl b/xproc/search.xpl new file mode 100644 index 0000000..498dbdf --- /dev/null +++ b/xproc/search.xpl @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Chymistry search + + +

Chymistry search

+
+ + +
+ + +
+
+
+
+
+
+
\ No newline at end of file diff --git a/xproc/temp-decode-p4-docs.xpl b/xproc/temp-decode-p4-docs.xpl new file mode 100644 index 0000000..4141004 --- /dev/null +++ b/xproc/temp-decode-p4-docs.xpl @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + diff --git a/xproc/xproc-z-library.xpl b/xproc/xproc-z-library.xpl new file mode 100644 index 0000000..62be9d7 --- /dev/null +++ b/xproc/xproc-z-library.xpl @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + {/c:body} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Wraps its input in a c:response element in order to make an HTTP response. + + + + + + + + + + + + + + + + {/*} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Not Found + + +

Not Found

+

The requested resource was not found.

+ + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/xproc/xproc-z.xpl b/xproc/xproc-z.xpl new file mode 100644 index 0000000..6f7abff --- /dev/null +++ b/xproc/xproc-z.xpl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xslt/convert-between-xml-and-json.xsl b/xslt/convert-between-xml-and-json.xsl new file mode 100644 index 0000000..aaffba2 --- /dev/null +++ b/xslt/convert-between-xml-and-json.xsl @@ -0,0 +1,27 @@ + + + + + + + + + + + + application/xml + + + + + + + application/json + + + + \ No newline at end of file diff --git a/xslt/convert-to-p5/from.xsl b/xslt/convert-to-p5/from.xsl new file mode 100644 index 0000000..c3c0249 --- /dev/null +++ b/xslt/convert-to-p5/from.xsl @@ -0,0 +1,884 @@ + + + + + +

This software is dual-licensed: + +1. Distributed under a Creative Commons Attribution-ShareAlike 3.0 +Unported License http://creativecommons.org/licenses/by-sa/3.0/ + +2. http://www.opensource.org/licenses/BSD-2-Clause + + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +This software is provided by the copyright holders and contributors +"as is" and any express or implied warranties, including, but not +limited to, the implied warranties of merchantability and fitness for +a particular purpose are disclaimed. In no event shall the copyright +holder or contributors be liable for any direct, indirect, incidental, +special, exemplary, or consequential damages (including, but not +limited to, procurement of substitute goods or services; loss of use, +data, or profits; or business interruption) however caused and on any +theory of liability, whether in contract, strict liability, or tort +(including negligence or otherwise) arising in any way out of the use +of this software, even if advised of the possibility of such damage. +

+

Author: See AUTHORS

+ +

Copyright: 2013, TEI Consortium

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + + +
+ + + + + ENTITY_ + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + en + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + + + + + + + + + + + + + + + + + + + + TEI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Scribe: + Style: + Character: + Main hand : + Main language: + + Responsibiity: + + + + + + + + + _ink + + + + + + + + + + + + +
diff --git a/xslt/convert-to-p5/links.xsl b/xslt/convert-to-p5/links.xsl new file mode 100644 index 0000000..4cd517d --- /dev/null +++ b/xslt/convert-to-p5/links.xsl @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xslt/convert-to-p5/p4_to_p5.xsl b/xslt/convert-to-p5/p4_to_p5.xsl new file mode 100755 index 0000000..564adba --- /dev/null +++ b/xslt/convert-to-p5/p4_to_p5.xsl @@ -0,0 +1,607 @@ + + + + + + + + + + + + + + + + + + 0000-00-00 + + + + ABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + + + + +
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + + + + + + + + + + true + false + + + + + + + + + + + + + + + + + + + + + +
diff --git a/xslt/convert-to-p5/p4_to_p5_newton.xsl b/xslt/convert-to-p5/p4_to_p5_newton.xsl new file mode 100755 index 0000000..506f3ad --- /dev/null +++ b/xslt/convert-to-p5/p4_to_p5_newton.xsl @@ -0,0 +1,532 @@ + + + + ABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TEI P5 migration script copied this resp from the titleStmt: + + + + + TEI P5 migration script generated this resp, guessing "editor": + editor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + translation_status + + + + + + + + + + + + + + + + + + http://www.example.com/translation.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pound + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + It may be possible to use multiple langUsage elements and @decls to encode the following comment. + See http://www.tei-c.org/release/doc/tei-p5-doc/en/html/CC.html#CCAS2 + + + + + + + + + +

+ + +

+ + + +
+ + + + + + Indiana University + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \p{Co} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + name + + + + + + + + + + + + + + + + + high + + + low + + + medium + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/xslt/convert-to-p5/purge-foreign.xsl b/xslt/convert-to-p5/purge-foreign.xsl new file mode 100644 index 0000000..2c3e874 --- /dev/null +++ b/xslt/convert-to-p5/purge-foreign.xsl @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + seg + + + + + + + \ No newline at end of file diff --git a/xslt/convert-to-p5/regularize-dates.xsl b/xslt/convert-to-p5/regularize-dates.xsl new file mode 100644 index 0000000..bba6051 --- /dev/null +++ b/xslt/convert-to-p5/regularize-dates.xsl @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xslt/convert-to-p5/remove-dubious-default.xsl b/xslt/convert-to-p5/remove-dubious-default.xsl new file mode 100644 index 0000000..bf63092 --- /dev/null +++ b/xslt/convert-to-p5/remove-dubious-default.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xslt/convert-to-p5/select-non-emoji-glyphs.xsl b/xslt/convert-to-p5/select-non-emoji-glyphs.xsl new file mode 100644 index 0000000..978ef1d --- /dev/null +++ b/xslt/convert-to-p5/select-non-emoji-glyphs.xsl @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xslt/p5-to-html.xsl b/xslt/p5-to-html.xsl new file mode 100644 index 0000000..0abc764 --- /dev/null +++ b/xslt/p5-to-html.xsl @@ -0,0 +1,18 @@ + + + + + + + + + + + + +

+
+
\ No newline at end of file diff --git a/xslt/p5-to-solr-index-request.xsl b/xslt/p5-to-solr-index-request.xsl new file mode 100644 index 0000000..c0ac7df --- /dev/null +++ b/xslt/p5-to-solr-index-request.xsl @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xslt/search-parameters-to-solr-request.xsl b/xslt/search-parameters-to-solr-request.xsl new file mode 100644 index 0000000..20f3652 --- /dev/null +++ b/xslt/search-parameters-to-solr-request.xsl @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + *:* + + + + + + + + + + + + + + + + + + + + + + + true + + + + + range + + + + + + + + + terms + + + + 40 + true + + + + + + + + + + diff --git a/xslt/solr-response-to-html.xsl b/xslt/solr-response-to-html.xsl new file mode 100644 index 0000000..bbc2296 --- /dev/null +++ b/xslt/solr-response-to-html.xsl @@ -0,0 +1,268 @@ + + + + + + + + + + + + + + + + + + + + Chymistry Search + + + + +

Chymistry Search

+ +
+ + + + + + + + + facet: + + +
+ + +
+
+
+ +
+ + + + +
+

+
+ + + + + + +
+

+ + + + (1 value) + ( values) + + +

+ + + + + + + + + +
+
+
+ + () +
+
+
+
+
+
+
+
+
+
+
+

results

+
    + + + +
  • + [] +
  • +
    +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file