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" href="css/core-style.css" type="text/css" media="screen" />
|
---|
12 |
|
---|
13 |
|
---|
14 | <title>SALAMI SPARQL Endpoint</title>
|
---|
15 |
|
---|
16 | <script src="js/jquery-1.10.1.js" > </script>
|
---|
17 |
|
---|
18 | <script>
|
---|
19 |
|
---|
20 |
|
---|
21 | function onSubmit() {
|
---|
22 |
|
---|
23 | $.ajax({
|
---|
24 | type: "GET",
|
---|
25 |
|
---|
26 | beforeSend: function (request) {
|
---|
27 | //request.setRequestHeader("Authority", authorizationToken);
|
---|
28 | //request.setRequestHeader("origin", "http://nema.lis.illinois.edu");
|
---|
29 | },
|
---|
30 |
|
---|
31 | url: "<?php echo $repo->getSparqlEndpoint();?>",
|
---|
32 | data: { "query": $('#rdf-query').val(), "output": $('#rdf-output').val() },
|
---|
33 | //processData: false,
|
---|
34 |
|
---|
35 | /*
|
---|
36 | xhrFields: {
|
---|
37 | withCredentials: true
|
---|
38 | },
|
---|
39 | crossDomain: true,
|
---|
40 | */
|
---|
41 |
|
---|
42 | // accepts: "text/plain",
|
---|
43 | //converters: {},
|
---|
44 | dataType: "text",
|
---|
45 |
|
---|
46 | success: function(msg) {
|
---|
47 | //var $msg = $(msg);
|
---|
48 | //alert("msg = " +msg);
|
---|
49 |
|
---|
50 | //$('#rdf-results').val(msg.documentElement.outerHTML);
|
---|
51 | $('#rdf-results').val(msg);
|
---|
52 | },
|
---|
53 |
|
---|
54 |
|
---|
55 | error: function(err) {
|
---|
56 | alert(err.toString());
|
---|
57 | if (err.status == 200) {
|
---|
58 | ParseResult(err);
|
---|
59 | }
|
---|
60 | else { alert('Error:' + err.responseText + ' Status: ' + err.status); }
|
---|
61 | }
|
---|
62 |
|
---|
63 | });
|
---|
64 |
|
---|
65 | return false;
|
---|
66 |
|
---|
67 | }
|
---|
68 |
|
---|
69 |
|
---|
70 | </script>
|
---|
71 |
|
---|
72 | </head>
|
---|
73 |
|
---|
74 | <body>
|
---|
75 | <div id="container">
|
---|
76 |
|
---|
77 | <div id="header">
|
---|
78 | <h1>The SALAMI SPARQL Endpoint</h1>
|
---|
79 | </div>
|
---|
80 |
|
---|
81 | <div id="navigation">
|
---|
82 | <ul>
|
---|
83 | <li><a href="index.php">Home</a></li>
|
---|
84 | <li class="selected"><a href="#">SPARQL</a></li>
|
---|
85 | <li><a href="contact.php">Contact</a></li>
|
---|
86 | </ul>
|
---|
87 | </div>
|
---|
88 |
|
---|
89 | <div id="content-container">
|
---|
90 |
|
---|
91 | <div id="content">
|
---|
92 |
|
---|
93 | <p>
|
---|
94 | RDF Query:
|
---|
95 | </p>
|
---|
96 |
|
---|
97 | <!--
|
---|
98 | action="<?php echo htmlspecialchars($repo->getSparqlEndpoint()); ?>" method="post"
|
---|
99 | -->
|
---|
100 |
|
---|
101 | <form onsubmit="return onSubmit()">
|
---|
102 |
|
---|
103 | <textarea name="query" id="rdf-query"
|
---|
104 | style="width: 97%; margin-left: 10px; margin-right: 20px;" rows="8">
|
---|
105 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
---|
106 | PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
---|
107 |
|
---|
108 | SELECT * WHERE {
|
---|
109 | ?s ?p ?o
|
---|
110 | } LIMIT 10
|
---|
111 | </textarea>
|
---|
112 | <br/>
|
---|
113 |
|
---|
114 | <span style="margin: 5px 20px 5px 20px;">
|
---|
115 | Output type:
|
---|
116 | <select name="output" id="rdf-output">
|
---|
117 | <option>xml</option>
|
---|
118 | <option>json</option>
|
---|
119 | <option>text</option>
|
---|
120 | </select>
|
---|
121 | </span>
|
---|
122 |
|
---|
123 | <span style="margin: 5px 20px 5px 20px;">
|
---|
124 | Maximum results returned:
|
---|
125 | <select name="soft-limit">
|
---|
126 | <option>10</option>
|
---|
127 | <option>100</option>
|
---|
128 | <option>1000</option>
|
---|
129 | </select>
|
---|
130 | </span>
|
---|
131 |
|
---|
132 | <span style="margin: 5px 40px 5px 40px;">
|
---|
133 | <input type="submit" value="Execute">
|
---|
134 | </span>
|
---|
135 |
|
---|
136 | <span style="margin: 5px 40px 5px 40px;">
|
---|
137 | <input type="reset">
|
---|
138 | </span>
|
---|
139 |
|
---|
140 |
|
---|
141 | </form>
|
---|
142 |
|
---|
143 |
|
---|
144 | <p>
|
---|
145 | RDF Results:
|
---|
146 | </p>
|
---|
147 | <textarea id="rdf-results"
|
---|
148 | style="width: 97%; margin-left: 10px; margin-right: 20px;" rows="8">
|
---|
149 | </textarea>
|
---|
150 |
|
---|
151 | <p>
|
---|
152 | The <code>Accept</code> header you send is taken into account.
|
---|
153 | Various types of RDF are available, plus an HTML representation and
|
---|
154 | potentially the audio data (use <code>audio/*</code> to accept any
|
---|
155 | format of audio).
|
---|
156 | </p>
|
---|
157 |
|
---|
158 |
|
---|
159 | <p>
|
---|
160 | The machine-interfacable Sparql endpoint, which operates without
|
---|
161 | a limit on the number of tripples returned, is available at
|
---|
162 | <code><?php echo htmlspecialchars($repo->getSparqlEndpoint()); ?></code>.
|
---|
163 | </p>
|
---|
164 |
|
---|
165 |
|
---|
166 | </div>
|
---|
167 |
|
---|
168 |
|
---|
169 | <div id="footer" style="border-top: 8px groove #7ECDF3;">
|
---|
170 | <table cellpadding="0px" cellspacing="0px" width="100%">
|
---|
171 | <tbody>
|
---|
172 | <tr style="background: white;">
|
---|
173 | <td align="center">
|
---|
174 | <a href="http://www.sshrc-crsh.gc.ca/Default.aspx">
|
---|
175 | <img width="400px" src="images/sshrc_logo.jpeg">
|
---|
176 | </a>
|
---|
177 | </td>
|
---|
178 | <td align="center">
|
---|
179 | <a href="http://www.nsf.gov/index.jsp">
|
---|
180 | <img width="100px" src="images/nsf_logo.jpeg">
|
---|
181 | </a>
|
---|
182 | </td>
|
---|
183 | <td align="center">
|
---|
184 | <a href="http://www.jisc.ac.uk/">
|
---|
185 | <img height="100px" src="images//jisc_logo.jpeg">
|
---|
186 | </a>
|
---|
187 | </td>
|
---|
188 | </tr>
|
---|
189 | </tbody>
|
---|
190 | </table>
|
---|
191 |
|
---|
192 | </div>
|
---|
193 |
|
---|
194 | </div>
|
---|
195 | </body>
|
---|
196 | </html>
|
---|