-
Notifications
You must be signed in to change notification settings - Fork 4
/
demo_queries.vsp
129 lines (102 loc) · 3.63 KB
/
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
<?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="oat/toolkit/loader.js"></script>
<!--
FACET DEMO PAGE CUSTOMIZATION:
Registry keys:
'fct_demo_uri' controls generation of "Demo Queries" link on Facet Browser's front page. If not set, this page is used.
See facet_view.sql.
'sparql_demo_query_path' should point to a DAV collection with .isparql files to display. If not set,
'/DAV/home/dav/sparql_demo_queries' will be used.
'sparql_demo_xsl_uri' should point to XSL used to extract information and display entries in the list of queries.
If not set, '/fct/xslt/isparql_describe.xsl' is used.
-->
<?vsp
declare uriqa_str varchar;
declare dav_pwd varchar;
declare demo_dav_path, demo_xsl_uri varchar;
uriqa_str := cfg_item_value( virtuoso_ini_path(), 'URIQA','DefaultHost');
if (uriqa_str is null)
{
if (server_http_port () <> '80')
uriqa_str := 'localhost:'||server_http_port ();
else
uriqa_str := 'localhost';
}
demo_dav_path := registry_get ('sparql_demo_query_path');
if (0 = demo_dav_path)
demo_dav_path := '/DAV/home/dav/sparql_demo_queries/';
demo_xsl_uri := registry_get ('sparql_demo_xsl_uri');
if (0 = demo_xsl_uri) demo_xsl_uri := 'http://' || uriqa_str || '/fct/xslt/isparql_describe.xsl';
?>
<script type="text/javascript">
var featureList = ["","",""];
var sparql_ep = 'http://<?=uriqa_str?>/sparql';
var isparql_ep = 'http://<?=uriqa_str?>/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 = sparql_ep + '?query=' + get_and_encode_query (q_elm);
}
function get_and_encode_query (q_elm)
{
return encodeURIComponent (document.getElementById(q_elm).firstChild.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>
<h2>Demo SPARQL Queries</h2>
</div> <!-- #HD -->
<div id="MD">
<div id="demo_queries_ctr">
<table class="demo_qry_list">
<?vsp
declare ct_tree,xst any;
declare num_r int;
num_r := 0;
for select res_content, res_name, res_full_path
from WS.WS.SYS_DAV_RES
where RES_FULL_PATH like demo_dav_path || '%.isparql' do
{
ct_tree := xml_tree_doc (xml_tree (res_content));
http_value (xslt (demo_xsl_uri,
ct_tree,
vector ('name', res_name, 'full_path', 'http://' || uriqa_str || res_full_path)));
num_r := num_r + 1;
}
if (0 = num_r)
{
http ('<tr><td colspan="3"><span class="advisory">No demo queries available on this server.</span></td></tr>');
}
?>
</table>
</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>