1 |
|
---|
2 | Installation of this extension follows the usual pattern:
|
---|
3 |
|
---|
4 | ./CASCADE-MAKE.sh
|
---|
5 |
|
---|
6 |
|
---|
7 | For interative experiments with the Triplestore, you can then visit
|
---|
8 | the home page:
|
---|
9 |
|
---|
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:
|
---|
19 |
|
---|
20 | /greenstone
|
---|
21 |
|
---|
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=
|
---|
56 |
|
---|
57 | For a proxied install you would (continuing the example) do:
|
---|
58 |
|
---|
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,
|
---|
63 | even in the ReverseProxying situation.
|
---|
64 |
|
---|
65 | One key step in sparql.xsl is to updated the form input argument for 'stylesheet' to specify the proxied prefix URL:
|
---|
66 |
|
---|
67 | stylesheet=/greenstone3-lod/xml-to-html-links.xsl
|
---|
68 | stylesheet=%2Fgreenstone3-lod%2Fxml-to-html-links.xsl
|
---|
69 |
|
---|
70 |
|
---|
71 | When asking for the SPARQL XML result to be transformed to html-links, the hyperlinks in the page generated
|
---|
72 | also need some tweaking. The Greenstone3 sparql.xsl page helps plumb the static files used back to the
|
---|
73 | /greenstone3-lod/ url, but inside 'xml-to-html-links.xsl' this sets another 'stylesheet=' argument that
|
---|
74 | needs to be updated to the ReverseProxy setup
|
---|
75 |
|
---|
76 |
|
---|
77 | <a href="?query={$query}&output=xml&stylesheet=%2Fxml-to-html-links.xsl">
|
---|
78 | ->
|
---|
79 | <a href="?query={$query}&output=xml&stylesheet=%2Fgreenstone3-lod%2Fxml-to-html-links.xsl">
|
---|
80 |
|
---|
81 | You might need to reload the xml-to-html-links.xsl file in the browser if it has been cached before the change
|
---|
82 |
|
---|
83 |
|
---|
84 | % fgrep -rl xml-to-html etc/
|
---|
85 | etc/pages/sparql.html
|
---|
86 | etc/pages/sparql.tpl
|
---|
87 | etc/pages/xml-to-html-links.xsl
|
---|
88 |
|
---|
89 |
|
---|
90 |
|
---|
91 |
|
---|
92 | #----
|
---|
93 | # Note about Jena code:
|
---|
94 | #----
|
---|
95 |
|
---|
96 | Jena is a pure Java code base, and the relevant compiled jar files
|
---|
97 | are bundled with this extension, so no actual compilation is needed.
|
---|
98 | The main task CASCADE-MAKE.sh does is to untar the 'binary' files,
|
---|
99 | and setup them up in appropriate top-level ' lib' folder (for jar
|
---|
100 | files) etc so Greenstone can find them
|
---|
101 |
|
---|
102 | In case it is ever needed, the companion source code is in 'src'
|
---|
103 | directory (taken from the Apache Jena website, matched to the binary
|
---|
104 | version). For source code, there was only a zip version of the file
|
---|
105 | to download.
|
---|
106 |
|
---|
107 | To run the command-line client programs, such as 's-put', this
|
---|
108 | requires Ruby to be installed. The source code for this is
|
---|
109 | provided in the 'packages' directory, and compiled up and installed
|
---|
110 | as part of running ./CASCADE-MAKE.sh
|
---|
111 |
|
---|
112 |
|
---|
113 |
|
---|
114 |
|
---|
115 |
|
---|