source: gs2-extensions/apache-jena/trunk/src/README.txt@ 34966

Last change on this file since 34966 was 34966, checked in by davidb, 3 years ago

Additional notes for Apache Jena v1.x

File size: 3.5 KB
Line 
1
2Installation of this extension follows the usual pattern:
3
4 ./CASCADE-MAKE.sh
5
6
7For interative experiments with the Triplestore, you can then visit
8the home page:
9
10 http://localhost:3030/
11
12Go to the control panel:
13
14 http://localhost:3030/control-panel.tpl
15
16The control panel lets you choose which dataset to work with through a
17drop-down menu. For the Greenstone extension installation there
18should only be one:
19
20 /greenstone
21
22Pressing 'select' triggers a POST action to:
23
24 http://localhost:3030/$/dataset
25
26which triggers a redirect (through setting 'Location:' in the respose header) to:
27
28
29 http://localhost:3030/sparql.tpl
30
31
32A generic query to try out is:
33
34 select * where { ?s ?p ?o } limit 100
35
36
37#----
38# ReverseProxying
39#----
40
41If serving your Greenstone3 through a public facing web server, such as Apache2,
42then the installed '.tpl' files and the Location redirects don't work. Introducing
43a base tag into the header such as:
44
45<base href="/greenstone3-lod/" />
46
47and changing the 'control-panel.tpl' form action to be:
48
49 <form action="/greenstone3-lod/${action}" method="post">
50
51helps a bit, but the Location redirect is still an issue.
52
53Bottom-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
57For a proxied install you would (continuing the example) do:
58
59http://sowemustthink.space/greenstone3-lod/greenstone/query?query=select+*+where+%7B+%3Fs+%3Fo+%3Fp+%7D+limit+100&output=text&stylesheet=
60
61
62Factoring in these details, it is possible to setup a transform/page/sparql.xsl page in Greenstone3 this is fully operational,
63even in the ReverseProxying situation.
64
65One 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
71When asking for the SPARQL XML result to be transformed to html-links, the hyperlinks in the page generated
72also 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
74needs to be updated to the ReverseProxy setup
75
76
77 <a href="?query={$query}&amp;output=xml&amp;stylesheet=%2Fxml-to-html-links.xsl">
78->
79 <a href="?query={$query}&amp;output=xml&amp;stylesheet=%2Fgreenstone3-lod%2Fxml-to-html-links.xsl">
80
81You 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
Note: See TracBrowser for help on using the repository browser.