source: gs2-extensions/afrepo/trunk/src/src/html/examples.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: 5.8 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<!--
19 <script src="js/jquery-1.10.1.js" > </script>
20-->
21
22 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
23
24 <script type="text/javascript" src="https://www.google.com/jsapi"></script>
25 <script type="text/javascript" id="sgvzlr_script" src="http://sgvizler.googlecode.com/svn/release/0.5/sgvizler.js"></script>
26
27
28
29 <script type="text/javascript">
30
31 sgvizler.option.namespace.mo ='http://purl.org/ontology/mo/';
32 sgvizler.option.namespace.salami = 'http://nema.lis.illinois.edu/salamiEndpoint/';
33
34
35 $(document).ready(sgvizler.go());
36
37
38 </script>
39
40 </head>
41
42 <body>
43 <div id="container">
44
45 <div id="header">
46 <h1>The Salami SPARQL Endpoint</h1>
47 </div>
48
49 <div id="navigation">
50 <ul>
51 <li><a href="index.php">Home</a></li>
52 <li><a href="sparql.php">SPARQL</a></li>
53 <li class="selected"><a href="#">Examples</a></li>
54 <li><a href="download.php">Download</a></li>
55 <li><a href="about.php">About</a></li>
56 </ul>
57 </div>
58
59 <div id="content-container">
60
61 <div id="content">
62
63
64<!--
65 action="<?php echo htmlspecialchars($repo->getSparqlEndpoint()); ?>" method="post"
66-->
67 <h2>Example 1</h2>
68 <p>
69 Retrieve all the tracks in the Salami dataset that correspond to MusicBrainz tracks
70 </p>
71<pre>
72 PREFIX rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;
73 PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
74 PREFIX mo: &lt;http://purl.org/ontology/mo/&gt;
75 PREFIX salami: &lt;http://nema.lis.illinois.edu/salamiEndpoint/&gt;
76
77 SELECT ?o
78 WHERE {
79 ?s mo:derived_from ?o.
80 }
81</pre>
82
83<a href="<?php echo htmlspecialchars($repo->getSparqlEndpoint());?>?query=PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX+mo%3A+%3Chttp%3A%2F%2Fpurl.org%2Fontology%2Fmo%2F%3E%0APREFIX+salami%3A+%3Chttp%3A%2F%2Fnema.lis.illinois.edu%2FsalamiEndpoint%2F%3E%0A%0ASELECT+%3Fo+WHERE+%7B%0A+%3Fs+mo%3Aderived_from+%3Fo%0A%7D%0A%09++++&output=text"/>Execute Sparql Query</a>
84
85
86
87
88 <h2>Example 2</h2>
89 <p>
90 Overview of the predicates in the tripple-store
91 </p>
92<pre>
93 PREFIX mo: &lt;http://purl.org/ontology/mo/&gt;
94 PREFIX salami: &lt;http://nema.lis.illinois.edu/salamiEndpoint/&gt;
95
96 SELECT ?p (COUNT(?p) AS ?pCount)
97 WHERE {
98 ?s ?p ?o.
99 }
100 GROUP BY ?p
101 ORDER BY ?p
102</pre>
103
104
105 <a href="<?php echo htmlspecialchars($repo->getSparqlEndpoint());?>?query=PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX+mo%3A+%3Chttp%3A%2F%2Fpurl.org%2Fontology%2Fmo%2F%3E%0APREFIX+salami%3A+%3Chttp%3A%2F%2Fnema.lis.illinois.edu%2FsalamiEndpoint%2F%3E%0A%0ASELECT+%3Fp+(COUNT(%3Fp)+AS+%3FpCount)%0AWHERE+%7B%0A+%3Fs+%3Fp+%3Fo.%0A%7D%0AGROUP+BY+%3Fp%0AORDER+BY+%3Fp&output=text&soft-limit=-1"/>Execute Sparql Query</a>
106
107<div id="sgvzl_example2"
108 data-sgvizler-endpoint="<?php echo htmlspecialchars($repo->getSparqlEndpoint());?>"
109 data-sgvizler-query="
110 SELECT ?p (COUNT(?p) AS ?pCount)
111 WHERE {
112 ?s ?p ?o.
113 }
114 GROUP BY ?p
115 ORDER BY ?p"
116 data-sgvizler-chart="gTable"
117 data-sgvizler-loglevel="2"
118 style="width:100%; height:290px;"></div>
119
120
121 <h2>Example 3</h2>
122 <p>
123 Find out the distribution between mono and stereo tracks.
124 </p>
125<pre>
126 PREFIX mo: &lt;http://purl.org/ontology/mo/&gt;
127 PREFIX salami: &lt;http://nema.lis.illinois.edu/salamiEndpoint/&gt;
128
129 SELECT (STR(?channel) as ?channelStr) (COUNT(?channel) AS ?freqCount)
130 WHERE {
131 ?signalID a mo:DigitalSignal ;
132 mo:channels ?channel.
133 }
134 GROUP BY ?channel
135</pre>
136
137<a href="<?php echo htmlspecialchars($repo->getSparqlEndpoint());?>?query=PREFIX%20mo:%20%3Chttp://purl.org/ontology/mo/%3E%20PREFIX%20salami:%20%3Chttp://nema.lis.illinois.edu/salamiEndpoint/%3E%20SELECT%20?channel%20(COUNT(?channel)%20AS%20?freqCount)%20WHERE%20{%20?signalID%20a%20mo:DigitalSignal%20;%20mo:channels%20?channel.%20}%20GROUP+BY%20?channel&output=text&soft-limit=-1"/>Execute Sparql Query</a>
138
139
140
141<div id="sgvzl_example3"
142 data-sgvizler-endpoint="<?php echo htmlspecialchars($repo->getSparqlEndpoint());?>"
143 data-sgvizler-query="
144 SELECT (STR(?channel) AS ?channelStr) (COUNT(?channel) AS ?freqCount)
145 WHERE {
146 ?signalID a mo:DigitalSignal ;
147 mo:channels ?channel.
148 }
149 GROUP BY ?channel"
150 XXdata-sgvizler-chart="gPieChart"
151 data-sgvizler-chart="gBarChart"
152 data-sgvizler-loglevel="2"
153 data-sgvizler-chart-options="title=Mono vs. Stereo Tracks|vAxis.title=Number of Channels"
154 style="width:100%; height:80px;"></div>
155
156
157</div>
158
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.