source: gs2-extensions/afrepo/trunk/src/src/html/sparql.php@ 28352

Last change on this file since 28352 was 28352, checked in by davidb, 8 years ago

Restructured to have 'about' and 'download' pages

File size: 4.3 KB
Line 
1<?php
2 require_once "setup.php";
3 $base = parse_url($repo->getURIPrefix());
4 $basepath = $base["path"];
5?>
6<!DOCTYPE HTML>
7<html>
8 <head>
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
11 <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Pacifico">
12
13 <link rel="stylesheet" href="css/core-style.css" type="text/css" media="screen" />
14
15
16 <title>SALAMI SPARQL Endpoint</title>
17
18 <script src="js/jquery-1.10.1.js" > </script>
19
20 <script>
21
22
23 function onSubmit() {
24
25 $('#rdf-execute').css("cursor","wait");
26 $('#rdf-results').css("cursor","wait");
27
28 $.ajax({
29 type: "GET",
30
31 url: "<?php echo $repo->getSparqlEndpoint();?>",
32 data: { "query": $('#rdf-query').val(), "output": $('#rdf-output').val(), "soft-limit": $('#rdf-soft-limit').val() },
33
34
35 dataType: "text",
36
37 success: function(msg) {
38 $('#rdf-execute').css("cursor","auto");
39 $('#rdf-results').css("cursor","auto");
40 $('#rdf-results').val(msg);
41 },
42
43
44 error: function(err) {
45 alert('Error:' + err.responseText + ' Status: ' + err.status);
46 }
47
48 });
49
50
51 return false;
52
53 }
54
55
56 </script>
57
58 </head>
59
60 <body>
61 <div id="container">
62
63 <div id="header">
64 <h1>The Salami SPARQL Endpoint</h1>
65 </div>
66
67 <div id="navigation">
68 <ul>
69 <li><a href="index.php">Home</a></li>
70 <li class="selected"><a href="#">SPARQL</a></li>
71 <li><a href="examples.php">Examples</a></li>
72 <li><a href="download.php">Download</a></li>
73 <li><a href="about.php">About</a></li>
74 </ul>
75 </div>
76
77 <div id="content-container">
78
79 <div id="content">
80
81 <p>
82 RDF Query:
83 </p>
84
85<!--
86 action="<?php echo htmlspecialchars($repo->getSparqlEndpoint()); ?>" method="post"
87-->
88
89 <form onsubmit="return onSubmit()">
90
91 <textarea name="query" id="rdf-query"
92 style="width: 97%; margin-left: 10px; margin-right: 20px;" rows="8">
93PREFIX rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;
94PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
95PREFIX mo: <http://purl.org/ontology/mo/>
96PREFIX salami: <http://nema.lis.illinois.edu/salamiEndpoint/>
97
98SELECT * WHERE {
99 ?s ?p ?o.
100}
101 </textarea>
102 <br/>
103
104 <span style="margin: 5px 20px 5px 20px;">
105 Output type:
106 <select name="output" id="rdf-output">
107 <option>xml</option>
108 <option>json</option>
109 <option>text</option>
110 </select>
111 </span>
112
113 <span style="margin: 5px 20px 5px 20px;">
114 Maximum results returned:
115 <select name="soft-limit" id="rdf-soft-limit">
116 <option>10</option>
117 <option>100</option>
118 <option>1000</option>
119 <option>10000</option>
120 <option>50000</option>
121 </select>
122 </span>
123
124 <span style="margin: 5px 40px 5px 40px;">
125 <input type="submit" value="Execute" id="rdf-execute">
126 </span>
127
128 <span style="margin: 5px 40px 5px 40px;">
129 <input type="reset">
130 </span>
131
132
133 </form>
134
135
136 <p>
137 RDF Results:
138 </p>
139 <textarea id="rdf-results"
140 style="width: 97%; margin-left: 10px; margin-right: 20px;" rows="16">
141 </textarea>
142
143 <p>
144 The <code>Accept</code> header you send is taken into account.
145 Various types of RDF are available, plus an HTML representation and
146 potentially the audio data (use <code>audio/*</code> to accept any
147 format of audio).
148 </p>
149
150
151 <p>
152 The machine-interfacable Sparql endpoint, which operates without
153 a limit on the number of tripples returned, is available at
154 <code><?php echo htmlspecialchars($repo->getSparqlEndpoint()); ?></code>.
155 </p>
156
157
158</div>
159
160
161 <div id="footer" style="border-top: 8px groove #7ECDF3;">
162 <table cellpadding="0px" cellspacing="0px" width="100%">
163 <tbody>
164 <tr style="background: white;">
165 <td align="center">
166 <a href="http://www.sshrc-crsh.gc.ca/Default.aspx">
167 <img width="400px" src="images/sshrc_logo.jpeg">
168 </a>
169 </td>
170 <td align="center">
171 <a href="http://www.nsf.gov/index.jsp">
172 <img width="100px" src="images/nsf_logo.jpeg">
173 </a>
174 </td>
175 <td align="center">
176 <a href="http://www.jisc.ac.uk/">
177 <img height="100px" src="images//jisc_logo.jpeg">
178 </a>
179 </td>
180 </tr>
181 </tbody>
182 </table>
183
184 </div>
185
186 </div>
187 </body>
188</html>
Note: See TracBrowser for help on using the repository browser.