-
Notifications
You must be signed in to change notification settings - Fork 4
/
HEADER.html
328 lines (251 loc) · 23.8 KB
/
HEADER.html
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Index of /2005/03/css-dep</title>
</head>
<body>
<h1 id="title">SWObjects Source Code Directory</h1>
<p>This is a set of utilities implemented in C++ for working with SemWeb objects (triples, graphs, query patterns, SPARQL and N3 operations, etc). This implements query mapping based on <a href="../../07/MappingRules/">Mapping Rules</a> and provides the base for a SPASQL engine in MySQL.</p>
<ul>
<li><em style="font-weight: bold">source tarball</em>: <a href="SWObjects_0.1.tar.gz">SWObjects_0.1.tar.gz</a><!-- keep space after href= to avoid packing the tarball in the tarball. --></li>
<li><em style="font-weight: bold">linux libstdc++6 executable</em>: <a href="linux-libstdc++6/SWtransformer">linux-libstdc++6/SWtransformer</a><!-- keep space after href= to avoid packing executables in the tarball. --></li>
<li><em style="font-weight: bold">windows executable</em>: <a href="win/SWtransformer.exe">win/SWtransformer.exe</a><!-- keep space after href= to avoid packing executables in the tarball. --></li>
</ul>
<p>For more information on SPASQL: ① <a href="../../../2004/10/04-pharmaFederate/">SPASQL Example</a> · ② <a href=".">SPASQL-MySQL</a> · ③ <a href="../../../2005/05/22-SPARQL-MySQL/XTech">SPASQL XTech Paper</a> · ④ <a href="../../../2006/Talks/0518-SPASQL/">XTech Slides</a> · ⑤ <a href="http://dev.w3.org/cvsweb/2006/spasql/">SPASQL CVS Tree</a></p>
<h2 id="TOC">Table of Contents</h2>
<ul>
<li><a href="#build">Building SWObjects</a></li>
<li><a href="#files">Files</a>
<ul>
<li><a href="#make">Building and Testing</a></li>
<li><a href="#core">Core</a></li>
<li><a href="#parsers">Parsers</a></li>
</ul></li>
<li><a href="#arch">Architecture</a></li>
<li><a href="#sampComp">Sample Compilation</a></li>
<li><a href="#issues">Issues</a></li>
<li><a href="#dir">Apache Directory Listing</a></li>
</ul>
<h2 id="build">Building SWObjects</h2>
<p>The SWObjects library and executables can be built from the source in the <a href="SWObjects_0.1.tar.gz">tarball</a>. This package includes one directory, <code>SWObjects_0.1</code>; running <span style="background-color: #ee8">make test</span> from this directory will build and test the executables. Building the parsers requires bison 2.3 or flex 2.5 but you may use the pre-build parsers by adding an include directory to the compilation: <span style="background-color: #ee8">INCLUDES=-Iwin make test</span>. Cygwin's version of make requires an extra environment variable as well: <span style="background-color: #ee8">PWD=. make test</span> (note, these can be combined). The Makefile compilation has been tested on linux, OSX and Windows/Cygwin (windows users may also use the <a href="SWObjects.sln">MSVC project</a>). Below is a <a href="#sampComp">sample compilation</a>.</p>
<p>The executable <code>tests/execute_HealthCare1</code> (which will be renamed soon and place in a bin/ directory) serves as a general interface to SWObjects query mapping functionality. It takes as an argument the name of a file containing a SPARQL SELECT query. With no other input, they query is validated and printed out in a normalized form.</p>
<pre style="background-color: #ee8; border: 2px #cc6 solid; float: left; margin-top: -1em; ">./test/execute_HealthCare1 tests/query_HealthCare1.rq</pre>
<p style="clear:both;"><code>execute_HealthCare1</code> accepts any number of files containing SPARQL CONSTRUCTs which are used to tranform the SELECT query according to a <a href="../../07/MappingRules/#QMA">Query Mapping Algorithm</a>.</p>
<pre style="background-color: #ee8; border: 2px #cc6 solid; float: left; margin-top: -1em; ">./test/execute_HealthCare1 tests/query_HealthCare1.rq tests/ruleMap_HealthCare1.rq</pre>
<p style="clear:both;"><code>execute_HealthCare1</code> also accepts -s and -b flags to set the stem or base URI. The base URI is used to resolve relative URIs in parsing input. It defauts to <code><http://example.org/></code>. The stem URI, if provided, allowes <code>execute_HealthCare1</code> to generate an SQL query based on the input SELECT query, transformed by any supplied CONSTRUCT rules.</p>
<pre style="background-color: #ee8; border: 2px #cc6 solid; float: left; margin-top: -1em; ">./test/execute_HealthCare1 -s http://someClinic.exampe/DB/ tests/query_HealthCare1.rq</pre>
<p style="clear:both;">The mapping from a SPARQL query to an SQL query is described in <a href="../../07/MappingRules/#stemMap">Stem Query Mapping</a>.</p>
<h2 id="files">Files</h2>
<p>The directory structure of the <em>SWObjects Library</em> is intentionally flat, as it is expected to be linked to other libraries to support web access, persistent storage, and other functionalities.</p>
<h3 id="make">Building and Testing</h3>
<ul>
<li><em><a class="tar" href="Makefile">Makefile</a></em> — targets for <code>libSWObjects.a</code> and sample executables.</li>
<li><em><a class="tar" href="SWObjects.vcproj">SWObjects.vcproj</a> and <a class="tar" href="SWObjects.sln">SWObjects.sln</a></em> — MSVC++ build script.</li>
<li><em><a class="tar" href="tests/test_HealthCare1.cpp">tests/test_HealthCare1.cpp</a></em> — query-mapping test to link to <code>libSWObjects.a</code>. Works with:<ul>
<li><em><a class="tar" href="tests/query_HealthCare1.rq">tests/query_HealthCare1.rq</a></em> — simple example HCLS COI query.</li>
<li><em><a class="tar" href="tests/ruleMap_HealthCare1.rq">tests/ruleMap_HealthCare1.rq</a></em> — simple example HCLS COI rule-map.</li>
<li><em><a class="tar" href="tests/query_stem_Person.rq">tests/query_stem_Person.rq</a></em> — simple example HCLS COI query to access Helen's data.</li>
</ul></li>
</ul>
<h3 id="core">Core</h3>
<ul>
<li><em><a class="tar" href="SWObjects.cpp">SWObjects.cpp</a></em> and <em><a class="tar" href="SWObjects.hpp">SWObjects.hpp</a></em> — data structures to represent graph patterns for SPARQL and N3.</li>
<li><em><a class="tar" href="RdfDB.cpp">RdfDB.cpp</a></em> and <em><a class="tar" href="RdfDB.hpp">RdfDB.hpp</a></em> — implementation of a simple RDF database with multiple named graphs.</li>
<li><em><a class="tar" href="RdfQueryDB.cpp">RdfQueryDB.cpp</a></em> and <em><a class="tar" href="RdfQueryDB.hpp">RdfQueryDB.hpp</a></em> — overload of <a href="RdfDB.hpp">RdfDB</a> which performs queries on graph patterns.</li>
<li><em><a class="tar" href="ResultSet.cpp">ResultSet.cpp</a></em> and <em><a class="tar" href="ResultSet.hpp">ResultSet.hpp</a></em> — simple SPARQL result set data structure.</li>
<li><em><a class="tar" href="SWObjectDuplicator.hpp">SWObjectDuplicator.hpp</a></em> — deep-copy of a SPARQL compile tree (RDF Atoms allocated from a <code>POSFactory</code>.</li>
<li><em><a class="tar" href="QueryMapper.hpp">QueryMapper.hpp</a></em> — overload of <a href="SWObjectDuplicator.hpp">SWObjectDuplicator</a> which maps queries backwards through deduction rules.</li>
<li><em><a class="tar" href="RuleInverter.hpp">RuleInverter.hpp</a></em> — overload of <a href="SWObjectDuplicator.hpp">SWObjectDuplicator</a> which reverses SPARQL CONSTRUCT queries to transform queries acting on unmaterialized views; used by <a href="QueryMapper.hpp">QueryMapper</a>.</li>
<li><em><a class="tar" href="SQLizer.hpp">SQLizer.hpp</a></em> — overload of <a href="SWObjectDuplicator.hpp">SWObjectDuplicator</a> which maps from stem queries to SQL queries.</li>
<li><em><a class="tar" href="POS2BGPMap.hpp">POS2BGPMap.hpp</a></em> — a query tree walker which gathers statistics about the use of POSs; used by <a href="QueryMapper.hpp">QueryMapper</a> and <a href="SQLizer.hpp">SQLizer</a>.</li>
<li><em><a class="tar" href="SPARQLSerializer.hpp">SPARQLSerializer.hpp</a></em> — serialize SWObject tree as a SPARQL query.</li>
<li><em><a class="tar" href="XMLSerializer.hpp">XMLSerializer.hpp</a></em> — simple XML serializer interface.</li>
<li><em><a class="tar" href="XMLQueryExpressor.hpp">XMLQueryExpressor.hpp</a></em> — simple XML representation of a SPARQL query.</li>
<li><em><a class="tar" href="exs.hpp">exs.hpp</a></em> — simple stack trace exception generator to aid in development.</li>
<li><em><a class="tar" href="common.hpp">common.hpp</a></em> — common header file to streamline compilation.</li>
</ul>
<h3 id="parsers">Parsers</h3>
<ul>
<li><em><a class="tar" href="ParserCommon.cpp">ParserCommon.cpp</a></em> and <em><a class="tar" href="ParserCommon.hpp">ParserCommon.hpp</a></em> — common Driver source for all RDF-related parsers.</li>
<li><em><a class="tar" href="SPARQLfedParser/SPARQLfedParser.ypp">SPARQLfedParser/SPARQLfedParser.ypp</a></em>, <em><a class="tar" href="SPARQLfedScanner.hpp">SPARQLfedScanner.hpp</a></em> and <em><a class="tar" href="SPARQLfedScanner.lpp">SPARQLfedScanner.lpp</a></em> — parser for the SPARQLfed language; generates:<ul>
<li><a class="tar" href="SPARQLfedParser/SPARQLfedParser.hpp">SPARQLfedParser/SPARQLfedParser.hpp</a> - tokens passed from scanner to parser.</li>
<li><a class="tar" href="SPARQLfedScanner.cpp">SPARQLfedScanner.cpp</a> - lexical lex-style scannar.</li>
<li><a class="tar" href="SPARQLfedParser/SPARQLfedParser.cpp">SPARQLfedParser/SPARQLfedParser.cpp</a> - LALR(1) parser tables and semantic actions.</li>
<li><em><a class="tar" href="SPARQLfedParser/location.hh">SPARQLfedParser/location.hh</a></em>, <em><a class="tar" href="SPARQLfedParser/position.hh">SPARQLfedParser/position.hh</a></em> and <em><a class="tar" href="SPARQLfedParser/stack.hh">SPARQLfedParser/stack.hh</a></em> — auxilliary parser files created by bison.</li>
</ul></li>
<li><em><a class="tar" href="TurtleSParser/TurtleSParser.ypp">TurtleSParser/TurtleSParser.ypp</a></em>, <em><a class="tar" href="TurtleSScanner.hpp">TurtleSScanner.hpp</a></em> and <em><a class="tar" href="TurtleSScanner.lpp">TurtleSScanner.lpp</a></em> — parser for the Turtle language; generates:<ul>
<li><a class="tar" href="TurtleSParser/TurtleSParser.hpp">TurtleSParser/TurtleSParser.hpp</a> - tokens passed from scanner to parser.</li>
<li><a class="tar" href="TurtleSScanner.cpp">TurtleSScanner.cpp</a> - lexical lex-style scannar.</li>
<li><a class="tar" href="TurtleSParser/TurtleSParser.cpp">TurtleSParser/TurtleSParser.cpp</a> - LALR(1) parser tables and semantic actions.</li>
<li><em><a class="tar" href="TurtleSParser/location.hh">TurtleSParser/location.hh</a></em>, <em><a class="tar" href="TurtleSParser/position.hh">TurtleSParser/position.hh</a></em> and <em><a class="tar" href="TurtleSParser/stack.hh">TurtleSParser/stack.hh</a></em> — auxilliary parser files created by bison.</li>
</ul></li>
<li><em><a class="tar" href="win/FlexLexer.h">win/FlexLexer.h</a></em> — supplementary flex file for systems without bison and flex.</li>
<!--
<li><em><a class="tar" href="X">X</a></em> — .</li>
<li><em><a class="tar" href="X.cpp">X.cpp</a></em> and <em><a class="tar" href="X.hpp">X.hpp</a></em> — .</li>
-->
</ul>
<h2 id="arch">Architecture</h2>
<h3>Matching <code>BasicGraphPattern</code>s</h3>
<p>Given a set of TriplePatterns to match against a set of triples (which are also implemented as TriplePatterns), each atom (</p>
<h3>Matching <code>GraphPattern</code>s</h3>
<h3>URI, BNode, Literal and TriplePattern Atoms</h3>
<p>The primitive parts of speach (class: <em style="font-weight: bold" id="POS">POS</em>) and (class: <em style="font-weight: bold" id="TriplePattern">TriplePattern</em>) are created only once-each by a <em style="font-weight: bold" id="POSFactory">POSFactory</em>. Applications typically create such a factory at the beginning of execution and destroy it at the end:</p>
<pre style="margin: 2em; border: thin solid #ccffcc; background-color: #eeffee;">int main(int argc,char** argv) {
w3c_sw::POSFactory posFactory;
w3c_sw::SPARQLfedDriver sparqlParser("", &posFactory);
...
}</pre>
<h3 id="storage">Storage</h3>
<p>An <em style="font-weight: bold" id="RdfDB">RdfDB</em> contains a <em style="font-weight: bold" id="DefaultGraphPattern">DefaultGraphPattern</em> and a set of <em style="font-weight: bold" id="NamedGraphPattern">NamedGraphPattern</em>s, each of which contains <em style="font-weight: bold" id="TriplePattern">TriplePattern</em>s. This is more general than a strict RDF store in that the TriplePattern data structure allows for triples with variables in either the subject, predicate or object position.</p>
<h3 id="queries">Queries</h3>
<p>The structure of queries is informed largely by the compile tree produced by a <a href="http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/#rQuery">SPARQL parser</a>, after it has <a href="http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/#convertGraphPattern">simpified the tree</a>. A typical query will construct a <em style="font-weight: bold" id="Select">Select</em> comprised of a <em style="font-weight: bold" id="WhereClause">WhereClause</em>, which in turn holds a <em style="font-weight: bold" id="TableOperation">TableOperation</em> and a <em style="font-weight: bold" id="BindingClause">BindingClause</em>. TableOperations contain <em style="font-weight: bold" id="Filter">Filter</em>s and some, like <em style="font-weight: bold" id="TableConjunction">TableConjunction</em> and <em style="font-weight: bold" id="OptionalGraphPattern">OptionalGraphPattern</em>, contain other graph patterns. This TableOperation tree terminates in <a href="#DefaultGraphPattern">DefaultGraphPattern</a>s and <a href="#NamedGraphPattern">NamedGraphPattern</a>, which contain the <a href="#TriplePattern">TriplePattern</a>s described in <a href="#storage">Storage</a>.</p>
<h2 id="sampComp">Sample Compilation</h2>
<p>Following is an annotated sample build. The command you have to type are <span style="background-color: #ee8">highlighted</span>:</p>
<p>Get the tarball, either by web browser or a command-line tool like wget.</p>
<pre style="background-color: #eef">
eric@mouni:/tmp/t$ <span style="background-color: #ee8">wget http://www.w3.org/2008/04/SPARQLfed/SWObjects_0.1.tar.gz</span>
--2008-09-07 18:07:56-- http://www.w3.org/2008/04/SPARQLfed/SWObjects_0.1.tar.gz
Resolving www.w3.org... 127.0.0.1
Connecting to www.w3.org|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 225799 (221K) [application/x-gzip]
Saving to: `SWObjects_0.1.tar.gz'
100%[======================================>] 225,799 --.-K/s in 0.001s
2008-09-07 18:09:36 (149 MB/s) - `SWObjects_0.1.tar.gz' saved [225799/225799]
</pre>
<p>Expand the tarball (for instance, with winzip).</p>
<pre style="background-color: #eef">
eric@mouni:/tmp/t$ <span style="background-color: #ee8">tar xzf SWObjects_0.1.tar.gz</span>
eric@mouni:/tmp/t$ <span style="background-color: #ee8">cd SWObjects_0.1/</span>
</pre>
<p>build the source tree and test it.</p>
<pre style="background-color: #eef">
eric@mouni:/tmp/t/SWObjects_0.1$ <span style="background-color: #ee8">make test</span>
</pre>
<p>builds dependencies...</p>
<pre style="background-color: #eef">
touch SWObjects.d
makedepend -y -f SWObjects.d SWObjects.cpp -DYYTEXT_POINTER=1 -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser 2>/dev/null
touch ResultSet.d
makedepend -y -f ResultSet.d ResultSet.cpp -DYYTEXT_POINTER=1 -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser 2>/dev/null
touch RdfQueryDB.d
makedepend -y -f RdfQueryDB.d RdfQueryDB.cpp -DYYTEXT_POINTER=1 -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser 2>/dev/null
touch RdfDB.d
makedepend -y -f RdfDB.d RdfDB.cpp -DYYTEXT_POINTER=1 -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser 2>/dev/null
touch ParserCommon.d
makedepend -y -f ParserCommon.d ParserCommon.cpp -DYYTEXT_POINTER=1 -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser 2>/dev/null
</pre>
<p>builds parsers...</p>
<pre style="background-color: #eef">
flex -o TurtleSScanner.cpp TurtleSScanner.lpp
touch TurtleSScanner.d
makedepend -y -f TurtleSScanner.d TurtleSScanner.cpp -DYYTEXT_POINTER=1 -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser 2>/dev/null
flex -o SPARQLfedScanner.cpp SPARQLfedScanner.lpp
touch SPARQLfedScanner.d
makedepend -y -f SPARQLfedScanner.d SPARQLfedScanner.cpp -DYYTEXT_POINTER=1 -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser 2>/dev/null
bison -o TurtleSParser/TurtleSParser.cpp TurtleSParser/TurtleSParser.ypp
sed -i~ 's,# define PARSER_HEADER_H,#pragma once,' TurtleSParser/TurtleSParser.hpp
touch TurtleSParser/TurtleSParser.d
makedepend -y -f TurtleSParser/TurtleSParser.d TurtleSParser/TurtleSParser.cpp -DYYTEXT_POINTER=1 -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser 2>/dev/null
bison -o SPARQLfedParser/SPARQLfedParser.cpp SPARQLfedParser/SPARQLfedParser.ypp
sed -i~ 's,# define PARSER_HEADER_H,#pragma once,' SPARQLfedParser/SPARQLfedParser.hpp
touch SPARQLfedParser/SPARQLfedParser.d
makedepend -y -f SPARQLfedParser/SPARQLfedParser.d SPARQLfedParser/SPARQLfedParser.cpp -DYYTEXT_POINTER=1 -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser 2>/dev/null
</pre>
<p>builds core modules...</p>
<pre style="background-color: #eef">
g++ -DYYTEXT_POINTER=1 -g -W -Wall -Wextra -Wnon-virtual-dtor -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser -pipe -c -o SPARQLfedParser/SPARQLfedParser.o SPARQLfedParser/SPARQLfedParser.cpp
g++ -DYYTEXT_POINTER=1 -g -W -Wall -Wextra -Wnon-virtual-dtor -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser -pipe -c -o TurtleSParser/TurtleSParser.o TurtleSParser/TurtleSParser.cpp
g++ -DYYTEXT_POINTER=1 -g -W -Wall -Wextra -Wnon-virtual-dtor -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser -pipe -c -o SPARQLfedScanner.o SPARQLfedScanner.cpp
g++ -DYYTEXT_POINTER=1 -g -W -Wall -Wextra -Wnon-virtual-dtor -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser -pipe -c -o TurtleSScanner.o TurtleSScanner.cpp
g++ -DYYTEXT_POINTER=1 -g -W -Wall -Wextra -Wnon-virtual-dtor -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser -pipe -c -o ParserCommon.o ParserCommon.cpp
g++ -DYYTEXT_POINTER=1 -g -W -Wall -Wextra -Wnon-virtual-dtor -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser -pipe -c -o RdfDB.o RdfDB.cpp
g++ -DYYTEXT_POINTER=1 -g -W -Wall -Wextra -Wnon-virtual-dtor -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser -pipe -c -o RdfQueryDB.o RdfQueryDB.cpp
g++ -DYYTEXT_POINTER=1 -g -W -Wall -Wextra -Wnon-virtual-dtor -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser -pipe -c -o ResultSet.o ResultSet.cpp
g++ -DYYTEXT_POINTER=1 -g -W -Wall -Wextra -Wnon-virtual-dtor -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser -pipe -c -o SWObjects.o SWObjects.cpp
</pre>
<p>builds library...</p>
<pre style="background-color: #eef">
ar rcvs libSWObjects.a SPARQLfedParser/SPARQLfedParser.o TurtleSParser/TurtleSParser.o SPARQLfedScanner.o TurtleSScanner.o ParserCommon.o RdfDB.o RdfQueryDB.o ResultSet.o SWObjects.o
a - SPARQLfedParser/SPARQLfedParser.o
a - TurtleSParser/TurtleSParser.o
a - SPARQLfedScanner.o
a - TurtleSScanner.o
a - ParserCommon.o
a - RdfDB.o
a - RdfQueryDB.o
a - ResultSet.o
a - SWObjects.o
</pre>
<p>builds test...</p>
<pre style="background-color: #eef">
g++ -DYYTEXT_POINTER=1 -g -W -Wall -Wextra -Wnon-virtual-dtor -I/tmp/t/SWObjects_0.1 -I/tmp/t/SWObjects_0.1/SPARQLfedParser -I/tmp/t/SWObjects_0.1/TurtleSParser -pipe -o tests/execute_HealthCare1 tests/test_HealthCare1.cpp -L/tmp/t/SWObjects_0.1 -lSWObjects
</pre>
<p>(these warnings indicate parts of the code that aren't done.)</p>
<pre style="background-color: #eef">
In file included from /tmp/t/SWObjects_0.1/QueryMapper.hpp:10,
from tests/test_HealthCare1.cpp:8:
/tmp/t/SWObjects_0.1/RuleInverter.hpp:170:2: warning: #warning not including dependent optionals yet
In file included from tests/test_HealthCare1.cpp:10:
/tmp/t/SWObjects_0.1/SQLizer.hpp:665: warning: unused parameter ‘p_SolutionModifier’
/tmp/t/SWObjects_0.1/SQLizer.hpp: In member function ‘virtual w3c_sw::Create* w3c_sw::SQLizer::create(w3c_sw::e_Silence, w3c_sw::URI*)’:
/tmp/t/SWObjects_0.1/SQLizer.hpp:732: warning: suggest braces around empty body in an ‘if’ statement
/tmp/t/SWObjects_0.1/SQLizer.hpp: In member function ‘virtual w3c_sw::Drop* w3c_sw::SQLizer::drop(w3c_sw::e_Silence, w3c_sw::URI*)’:
/tmp/t/SWObjects_0.1/SQLizer.hpp:737: warning: suggest braces around empty body in an ‘if’ statement
</pre>
<p>execute test with a sample query and a rule map...</p>
<pre style="background-color: #eef">
tests/execute_HealthCare1 tests/query_HealthCare1.rq tests/ruleMap_HealthCare1.rq -s http://someClinic.exampe/DB/ > HealthCare1_test.results && cat HealthCare1_test.results
</pre>
<p>output is the query transformed for the antecedent of the rule...</p>
<pre style="background-color: #eef">
post-rule query (SPARQL):
SELECT ?somePerson
WHERE
{
{
{
_:ADMINISTRATION <http://myCo.exampe/DB/Patient#name> _:PATIENT_name .
}
{
_:PATIENT_name <http://myCo.exampe/DB/Names#patient> ?someTest .
?someTest <http://myCo.exampe/DB/bar#attr2> ?FOOP_gen0 .
}
}
UNION
{
{
_:ADMINISTRATION <http://myCo.exampe/DB/Patient#name> _:PATIENT_name .
}
{
_:PATIENT_name <http://myCo.exampe/DB/Names#patient> ?somePerson .
?somePerson <http://myCo.exampe/DB/bar#attr2> ?FOOP_gen0 .
}
}
}
</pre>
<p>and transformed again into SQL...</p>
<pre style="background-color: #eef">
Transformed query:
SELECT union1.somePerson AS somePerson
FROM (
SELECT 1 AS _DISJOINT_, NULL AS somePerson, ADMINISTRATION.id AS ADMINISTRATION, ADMINISTRATION.name AS PATIENT_name, someTest.attr2 AS FOOP_gen0
FROM Patient AS ADMINISTRATION
INNER JOIN Names AS PATIENT_name ON PATIENT_name.id=ADMINISTRATION.name
INNER JOIN bar AS someTest ON someTest.id=PATIENT_name.patient
UNION
SELECT 2 AS _DISJOINT_, PATIENT_name.patient AS somePerson, ADMINISTRATION.id AS ADMINISTRATION, ADMINISTRATION.name AS PATIENT_name, somePerson.attr2 AS FOOP_gen0
FROM Patient AS ADMINISTRATION
INNER JOIN Names AS PATIENT_name ON PATIENT_name.id=ADMINISTRATION.name
INNER JOIN bar AS somePerson ON somePerson.id=PATIENT_name.patient
) AS union1
</pre>
<h2 id="issues">Issues</h2>
<ul>
<li id="smart_ptrs"><em style="font-weight: bold">smart_ptrs</em> — is the overhead of keeping a <a href="#POSFactory">POSFactory</a> worth the performance windfall? It makes memory management more challenging. In general, should SWObjects use more copying? Should they instead use <a href="http://en.wikipedia.org/wiki/Smart_pointer">smart pointers</a>?</li>
<li id="ser_union"><em style="font-weight: bold">ser_union</em> — SPARQLSerializer current fails to bound UNIONs in {}.</li>
</ul>
<h2 id="dir">Apache Directory Listing</h2>
</body></html>