-
Notifications
You must be signed in to change notification settings - Fork 4
/
bbc_demo_queries.vsp
149 lines (138 loc) · 5.15 KB
/
bbc_demo_queries.vsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>BBC demo queries</title>
<link rel="stylesheet" type="text/css" href="/fct/css/default.css"/>
<script type="text/javascript" src="s/main.js"></script>
<script type="text/javascript" src="oat/toolkit/loader.js"></script>
<script type="text/javascript">
var featureList = ["","",""];
var sparql_ep = 'http://bbc.openlinksw.com/sparql';
var isparql_ep = 'http://bbc.openlinksw.com/isparql';
function init() { }
function sparql_qry (q_elm) {
document.location = sparql_ep + '?query=' + get_and_encode_query (q_elm);
}
function isparql_qry (q_elm) {
document.location = isparql_ep + '?default-graph-uri=%20&query=' + get_and_encode_query (q_elm);
}
function get_and_encode_query (q_elm)
{
var q_txt = document.getElementById(q_elm).firstChild;
return encodeURIComponent (q_txt.data);
}
</script>
</head>
<body>
<div id="PG">
<div id="HD">
<a class="logo" href="/fct/facet.vsp">
<img id="opl_logo" alt="OpenLink Software" src="/fct/images/openlink_site_logo.png"/>
</a>
</div> <!-- #HD -->
<div id="MD">
<div id="demo_queries_ctr">
<h1>BBC Dataset Sample Queries</h1>
<p>These queries demonstrate some of the types of queries that can be done over the BBC dataset</p>
<ul class="demo_qry_list">
<li>
<h2>EastEnders episodes</h2>
<div class="expln">List all episodes of EastEnders from the programmes data.</div>
<div class="qry">
<pre id="q1">
PREFIX po: <http://purl.org/ontology/po/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
select distinct ?title ?short_syn
where {
<http://www.bbc.co.uk/programmes/b006m86d#programme> po:episode ?e .
?e a po:Episode .
?e po:short_synopsis ?short_syn .
?e dc:title ?title
}
</pre>
</div>
<div class="actions">
<a onclick="javascript:sparql_qry('q1');" href="#">Run in SPARQL endpoint</a>
<a onclick="javascript:isparql_qry('q1');" href="#">Open in iSPARQL</a>
</div>
</li>
<li>
<h2>Led Zeppelin Record Reviews</h2>
<div class="expln">Get reviews of Led Zeppelin records, with reviewer name.</div>
<div class="qry">
<pre id="q2">
PREFIX mo: <http://purl.org/ontology/mo/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rev: <http://purl.org/stuff/rev#>
select distinct ?rtitle ?rtext ?rvname
where {
?rec foaf:maker <http://www.bbc.co.uk/music/artists/678d88b2-87b0-403b-b63d-5da7465aecc3#artist> .
?rec a mo:Record .
?rec dc:title ?rtitle .
?rev a rev:Review .
?rev foaf:primaryTopic ?rec .
?rev rev:text ?rtext .
?rev rev:reviewer ?rviewer .
?rviewer foaf:name ?rvname
}
</pre>
</div>
<div class="actions">
<a onclick="javascript:sparql_qry('q2');" href="#">Run in SPARQL endpoint</a>
<a onclick="javascript:isparql_qry('q2');" href="#">Open in iSPARQL</a>
</div>
</li>
<li>
<h2>John Paul Jones' Records</h2>
<div class="expln">List records involving John Paul Jones</div>
<div class="qry">
<pre id="q3">
PREFIX mo: <http://purl.org/ontology/mo/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rev: <http://purl.org/stuff/rev#>
PREFIX po: <http://purl.org/ontology/po/>
select distinct ?r_name, ?rev
where {
{
<http://www.bbc.co.uk/music/artists/4490113a-3880-4f5b-a39b-105bfceaed04#artist> foaf:made ?r1 .
?r1 a mo:Record .
?r1 dc:title ?r_name .
?r1 rev:hasReview ?rev
} UNION {
<http://www.bbc.co.uk/music/artists/4490113a-3880-4f5b-a39b-105bfceaed04#artist> mo:member_of ?b1 .
?b1 foaf:made ?r1 .
?r1 a mo:Record .
?r1 dc:title ?r_name .
?r1 rev:hasReview ?rev
}
}
</pre>
</div>
<div class="actions">
<a onclick="javascript:sparql_qry('q3');" href="#">Run in SPARQL endpoint</a>
<a onclick="javascript:isparql_qry('q3');" href="#">Open in iSPARQL</a>
</div>
</li>
</ul>
</div> <!-- #demo_queries_ctr -->
</div> <!-- #MD -->
<div id="FT">
<a href="http://virtuoso.openlinksw.com/">
<img alt="Powered by OpenLink Virtuoso" src="/fct/images/virt_power_no_border.png"/>
</a>
<a href="http://linkeddata.org">
<img alt="Linked Data" src="/fct/images/LoDLogo.gif"/>
</a>
<br/>
<span class="copyright">Copyright © 2009-<?V "LEFT" (datestring (now ()), 4)?> OpenLink Software</span>
<div id="FT_L"/>
<div id="FT_R"/>
</div> <!-- #FT -->
</div> <!-- #PG -->
</body>
</html>