Changeset 37133


Ignore:
Timestamp:
2023-01-14T23:28:05+13:00 (3 weeks ago)
Author:
davidb
Message:

Notes updated to better describe the more streamlined process

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/apache-jena/trunk/src/README.txt

    r34966 r37133  
     1#----
     2# Installation/Compiling
     3#----
    14
    25Installation of this extension follows the usual pattern:
    36
    4   ./CASCADE-MAKE.sh
    5 
     7    ./CASCADE-MAKE.sh
     8
     9Test out the triplestore server with:
     10
     11  source ./setup.bash
     12  gs-triplestore-server3
     13
     14
     15A successful run will produce output similar to the following:
     16
     17    [2023-01-13 03:48:52] Server     INFO  Running in read-only mode for /greenstone
     18    [2023-01-13 03:48:52] Server     INFO  Apache Jena Fuseki 3.17.0
     19    [2023-01-13 03:48:53] Config     INFO  FUSEKI_HOME=/mnt/disks/atea-scratch-encrypted/davidb/research/code-managed/intermuse/greenstone3-svn/gs2build/ext/apache-jena/packages/apache-jena-fuseki-3.17.0
     20    [2023-01-13 03:48:53] Config     INFO  FUSEKI_BASE=/mnt/disks/atea-scratch-encrypted/davidb/research/code-managed/intermuse/greenstone3-svn/gs2build/ext/apache-jena/run
     21    [2023-01-13 03:48:53] Config     INFO  Shiro file: file:///mnt/disks/atea-scratch-encrypted/davidb/research/code-managed/intermuse/greenstone3-svn/gs2build/ext/apache-jena/run/shiro.ini
     22    [2023-01-13 03:48:53] Config     INFO  Template file: templates/config-tdb-dir
     23    [2023-01-13 03:48:54] Server     INFO  Database: TDB1 dataset: location=etc/tdb-triple-store3
     24    [2023-01-13 03:48:54] Server     INFO  Path = /greenstone
     25    [2023-01-13 03:48:54] Server     INFO  System
     26    [2023-01-13 03:48:54] Server     INFO    Memory: 4.0 GiB
     27    [2023-01-13 03:48:54] Server     INFO    Java:   11.0.16.1
     28    [2023-01-13 03:48:54] Server     INFO    OS:     Linux 5.11.0-1029-gcp amd64
     29    [2023-01-13 03:48:54] Server     INFO    PID:    1025186
     30    [2023-01-13 03:48:54] Server     INFO  Started 2023/01/13 03:48:54 UTC on port 4040
     31
     32
     33Currently there is no content in the triplestore.  For that, you need to adjust and then
     34build a collection.
     35
     36Note: if you want to stop the triplestore server, just press ^C,
     37
     38#----
     39# Building collections with Linked Open Data
     40#----
     41
     42Assuming you are running the gs-triplestore-server3 ...
     43
     44To include Linked Data triples of the documents metadata to a collection,
     45add the following to its collectionConfig.xml file, and rebuild.
     46
     47
     48    <search type="jenaTDB" orthogonal="true"/>
     49
     50#----
     51# Confirming Linked Open Data has been ingested
     52#----
    653
    754For interative experiments with the Triplestore, you can then visit
    855the home page:
    956
    10   http://localhost:3030/
    11 
    12 Go to the control panel:
    13 
    14   http://localhost:3030/control-panel.tpl
    15 
    16 The control panel lets you choose which dataset to work with through a
    17 drop-down menu.  For the Greenstone extension installation there
    18 should only be one:
     57    http://localhost:4040/
     58
     59and from there explore the interactive interface Fuseki provides to
     60the Jena TDB store.
     61
     62For production use, it is common to be operating Greenstone3 through a
     63Reverse Proxy web server, such as Apache2 Assuming you are running
     64Greenstone3 through as:
     65
     66  http://mydomain.org/greenstone3/library
     67
     68Then add to the Apache2 configuration file:
     69
     70    ProxyPass        /greenstone3-lod3/ http://localhost:4040/
     71    ProxyPassReverse /greenstone3-lod3/ http://localhost:4040/
     72
     73You can now visit the interactive interface as:
     74
     75    http://mydomain.org/greenstone3-lod3/
     76
     77
     78A useful page to visit to test out your triple store is:
     79
     80    https://mydomain.org/greenstone3-lod3/dataset.html
     81
     82Make sure for 'dataset' you have the drop-down menu on:
    1983
    2084  /greenstone
    2185
    22 Pressing 'select' triggers a POST action to:
    23 
    24   http://localhost:3030/$/dataset
    25  
    26 which triggers a redirect (through setting 'Location:' in the respose header) to:
    27 
    28 
    29   http://localhost:3030/sparql.tpl
    30 
    31 
    32 A generic query to try out is:
    33 
    34   select * where { ?s ?p ?o } limit 100
    35 
    36 
    37 #----
    38 # ReverseProxying
    39 #----
    40 
    41 If serving your Greenstone3 through a public facing web server, such as Apache2,
    42 then the installed '.tpl' files and the Location redirects don't work.  Introducing
    43 a base tag into the header such as:
    44 
    45 <base href="/greenstone3-lod/" />
    46 
    47 and changing the 'control-panel.tpl' form action to be:
    48 
    49  <form action="/greenstone3-lod/${action}" method="post">
    50  
    51 helps a bit, but the Location redirect is still an issue.
    52 
    53 Bottom-line to run a SPARQL query directly, (for localhost) you would do:
    54 
    55   http://localhost:3030/greenstone/query?query=select+*+where+%7B+%3Fs+%3Fo+%3Fp+%7D+limit+100&output=text&stylesheet=
     86In normal use of Greenstone3 with the apache-jena extension, this will
     87be the only item in the drop-down menu
     88
     89By default it has the default SPARQL query loaded:
     90
     91    SELECT ?subject ?predicate ?object
     92    WHERE {
     93      ?subject ?predicate ?object
     94    }
     95    LIMIT 25
     96
     97
     98Press the 'play' button to run the query.
     99
     100Then you will get output similar to the following:
     101
     102
     103      subject   predicate   object
     104    1   
     105    <http://127.0.0.1:4343/greenstone3/library/collection/programmes-and-performers/document/D0272>
     106    <http://purl.org/dc/elements/1.1/Relation.isPartOf>
     107    <http://127.0.0.1:4343/greenstone3/library/collection/programmes-and-performers>
     108    2   
     109    <http://127.0.0.1:4343/greenstone3/library/collection/programmes-and-performers/document/D0272>
     110    <http://greenstone.org/gsdlextracted#gsdlsourcefilename>
     111    "import/HMS-Catalogue-SMALL.csv"
     112
     113
     114
     115#----
     116# Adding in sparql.xsl to a collection
     117#----
     118
     119If needed:
     120
     121    mkdir $GSDL3HOME/sites/<yoursite>/collect/<yourcollection>/transform
     122    mkdir $GSDL3HOME/sites/<yoursite>/collect/<yourcollection>/transform/pages
     123
     124Then:
     125    /bin/cp transform/pages/sparql.xsl $GSDL3HOME/sites/<yoursite>/collect/<yourcollection>/transform/pages/.
     126   
     127If using a reverse-proxy web server:
     128
     129    emacs packages/apache-jena-fuseki-3.17.0/webapp/xml-to-html-links.xsl
     130
     131Then change:
     132
     133    <a href="?query={$query}&amp;output=xml&amp;stylesheet=%2Fxml-to-html-links.xsl">
     134=>
     135    <a href="?query={$query}&amp;output=xml&amp;stylesheet=/greenstone3-lod3/%2Fxml-to-html-links.xsl">
     136
     137
     138Also make sure you have set the reverse-proxy web server settings needed for Greenstone3 in:
     139
     140    emacs $GSDL3SRCHOME/build.properties
     141
     142
     143#----
     144# SPARQL quieries
     145#----
     146
     147To run a SPARQL query directly, you would do:
     148
     149  http://localhost:4040/greenstone/query?query=select+*+where+%7B+%3Fs+%3Fo+%3Fp+%7D+limit+100&output=text&stylesheet=
    56150
    57151For a proxied install you would (continuing the example) do:
    58152
    59 http://sowemustthink.space/greenstone3-lod/greenstone/query?query=select+*+where+%7B+%3Fs+%3Fo+%3Fp+%7D+limit+100&output=text&stylesheet=
    60 
    61 
    62 Factoring in these details, it is possible to setup a transform/page/sparql.xsl page in Greenstone3 this is fully operational,
     153  http://mydomain.org/greenstone3-lod/greenstone/query?query=select+*+where+%7B+%3Fs+%3Fo+%3Fp+%7D+limit+100&output=text&stylesheet=
     154
     155Factoring in these details, it is possible to setup a transform/page/sparql.xsl page in Greenstone3 that is fully operational,
    63156even in the ReverseProxying situation.
    64157
     
    76169
    77170    <a href="?query={$query}&amp;output=xml&amp;stylesheet=%2Fxml-to-html-links.xsl">
    78 ->   
     171=>   
    79172    <a href="?query={$query}&amp;output=xml&amp;stylesheet=%2Fgreenstone3-lod%2Fxml-to-html-links.xsl">
    80173
Note: See TracChangeset for help on using the changeset viewer.