/usr/share/doc/python-swap/notation3.html is in python-swap 1.2.1-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module notation3</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>notation3</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/syosi/cvs-trunk/WWW/2000/10/swap/notation3.py">/home/syosi/cvs-trunk/WWW/2000/10/swap/notation3.py</a></font></td></tr></table>
<p><tt>$Id: notation3.py,v 1.200 2007/12/11 21:18:08 syosi Exp $<br>
<br>
<br>
This module implements a Nptation3 parser, and the final<br>
part of a notation3 serializer.<br>
<br>
See also:<br>
<br>
Notation 3<br>
<a href="http://www.w3.org/DesignIssues/Notation3">http://www.w3.org/DesignIssues/Notation3</a><br>
<br>
Closed World Machine - and RDF Processor<br>
<a href="http://www.w3.org/2000/10/swap/cwm">http://www.w3.org/2000/10/swap/cwm</a><br>
<br>
To DO: See also "@@" in comments<br>
<br>
- Clean up interfaces<br>
______________________________________________<br>
<br>
Module originally by Dan Connolly, includeing notation3<br>
parser and RDF generator. TimBL added RDF stream model<br>
and N3 generation, replaced stream model with use<br>
of common store/formula API. Yosi Scharf developped<br>
the module, including tests and test harness.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="RDFSink.html">RDFSink</a><br>
<a href="codecs.html">codecs</a><br>
<a href="diag.html">diag</a><br>
</td><td width="25%" valign=top><a href="re.html">re</a><br>
<a href="string.html">string</a><br>
<a href="sys.html">sys</a><br>
</td><td width="25%" valign=top><a href="triple_maker.html">triple_maker</a><br>
<a href="types.html">types</a><br>
<a href="uripath.html">uripath</a><br>
</td><td width="25%" valign=top><a href="urllib.html">urllib</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="RDFSink.html#RDFSink">RDFSink.RDFSink</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="notation3.html#ToN3">ToN3</a>
</font></dt><dt><font face="helvetica, arial"><a href="notation3.html#tmToN3">tmToN3</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="exceptions.html#SyntaxError">exceptions.SyntaxError</a>(<a href="exceptions.html#StandardError">exceptions.StandardError</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="notation3.html#BadSyntax">BadSyntax</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="notation3.html#SinkParser">SinkParser</a>
</font></dt></dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="BadSyntax">class <strong>BadSyntax</strong></a>(<a href="exceptions.html#SyntaxError">exceptions.SyntaxError</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="notation3.html#BadSyntax">BadSyntax</a></dd>
<dd><a href="exceptions.html#SyntaxError">exceptions.SyntaxError</a></dd>
<dd><a href="exceptions.html#StandardError">exceptions.StandardError</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="BadSyntax-__init__"><strong>__init__</strong></a>(self, uri, lines, str, i, why)</dt></dl>
<dl><dt><a name="BadSyntax-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#SyntaxError">exceptions.SyntaxError</a>:<br>
<dl><dt><strong>filename</strong> = None</dl>
<dl><dt><strong>lineno</strong> = None</dl>
<dl><dt><strong>msg</strong> = ''</dl>
<dl><dt><strong>offset</strong> = None</dl>
<dl><dt><strong>print_file_and_line</strong> = None</dl>
<dl><dt><strong>text</strong> = None</dl>
<hr>
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="BadSyntax-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="SinkParser">class <strong>SinkParser</strong></a></font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="SinkParser-UEscape"><strong>UEscape</strong></a>(self, str, i, startline)</dt></dl>
<dl><dt><a name="SinkParser-__init__"><strong>__init__</strong></a>(self, store, openFormula<font color="#909090">=None</font>, thisDoc<font color="#909090">=''</font>, baseURI<font color="#909090">=None</font>, genPrefix<font color="#909090">=''</font>, metaURI<font color="#909090">=None</font>, flags<font color="#909090">=''</font>, why<font color="#909090">=None</font>)</dt><dd><tt>note: namespace names should *not* end in #;<br>
the # will get added during qname processing</tt></dd></dl>
<dl><dt><a name="SinkParser-anonymousNode"><strong>anonymousNode</strong></a>(self, ln)</dt><dd><tt>Remember or generate a term for one of these _: anonymous nodes</tt></dd></dl>
<dl><dt><a name="SinkParser-bareWord"><strong>bareWord</strong></a>(self, str, i, res)</dt><dd><tt>abc -> :abc</tt></dd></dl>
<dl><dt><a name="SinkParser-bind"><strong>bind</strong></a>(self, qn, uri)</dt></dl>
<dl><dt><a name="SinkParser-blankNode"><strong>blankNode</strong></a>(self, uri<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="SinkParser-checkDot"><strong>checkDot</strong></a>(self, str, i)</dt></dl>
<dl><dt><a name="SinkParser-commaSeparatedList"><strong>commaSeparatedList</strong></a>(self, str, j, res, what)</dt><dd><tt>return value: -1 bad syntax; >1 new position in str<br>
res has things found appended</tt></dd></dl>
<dl><dt><a name="SinkParser-directive"><strong>directive</strong></a>(self, str, i)</dt></dl>
<dl><dt><a name="SinkParser-directiveOrStatement"><strong>directiveOrStatement</strong></a>(self, str, h)</dt></dl>
<dl><dt><a name="SinkParser-endDoc"><strong>endDoc</strong></a>(self)</dt><dd><tt>Signal end of document and stop parsing. returns formula</tt></dd></dl>
<dl><dt><a name="SinkParser-feed"><strong>feed</strong></a>(self, octets)</dt><dd><tt>Feed an octet stream tothe parser<br>
<br>
if <a href="#BadSyntax">BadSyntax</a> is raised, the string<br>
passed in the exception object is the<br>
remainder after any statements have been parsed.<br>
So if there is more data to feed to the<br>
parser, it should be straightforward to recover.</tt></dd></dl>
<dl><dt><a name="SinkParser-formula"><strong>formula</strong></a>(self)</dt></dl>
<dl><dt><a name="SinkParser-here"><strong>here</strong></a>(self, i)</dt><dd><tt>String generated from position in file<br>
<br>
This is for repeatability when refering people to bnodes in a document.<br>
This has diagnostic uses less formally, as it should point one to which <br>
bnode the arbitrary identifier actually is. It gives the<br>
line and character number of the '[' charcacter or path character<br>
which introduced the blank node. The first blank node is boringly _L1C1.<br>
It used to be used only for tracking, but for tests in general<br>
it makes the canonical ordering of bnodes repeatable.</tt></dd></dl>
<dl><dt><a name="SinkParser-item"><strong>item</strong></a>(self, str, i, res)</dt></dl>
<dl><dt><a name="SinkParser-loadBuf"><strong>loadBuf</strong></a>(self, buf)</dt><dd><tt>Parses a buffer and returns its top level formula</tt></dd></dl>
<dl><dt><a name="SinkParser-loadStream"><strong>loadStream</strong></a>(self, stream)</dt></dl>
<dl><dt><a name="SinkParser-makeStatement"><strong>makeStatement</strong></a>(self, quadruple)</dt></dl>
<dl><dt><a name="SinkParser-node"><strong>node</strong></a>(self, str, i, res, subjectAlready<font color="#909090">=None</font>)</dt><dd><tt>Parse the <node> production.<br>
Space is now skipped once at the beginning<br>
instead of in multipe calls to <a href="#SinkParser-skipSpace">skipSpace</a>().</tt></dd></dl>
<dl><dt><a name="SinkParser-nodeOrLiteral"><strong>nodeOrLiteral</strong></a>(self, str, i, res)</dt></dl>
<dl><dt><a name="SinkParser-object"><strong>object</strong></a>(self, str, i, res)</dt></dl>
<dl><dt><a name="SinkParser-objectList"><strong>objectList</strong></a>(self, str, i, res)</dt></dl>
<dl><dt><a name="SinkParser-path"><strong>path</strong></a>(self, str, i, res)</dt><dd><tt>Parse the path production.</tt></dd></dl>
<dl><dt><a name="SinkParser-prop"><strong>prop</strong></a>(self, str, i, res)</dt></dl>
<dl><dt><a name="SinkParser-property_list"><strong>property_list</strong></a>(self, str, i, subj)</dt><dd><tt>Parse property list<br>
Leaves the terminating punctuation in the buffer</tt></dd></dl>
<dl><dt><a name="SinkParser-qname"><strong>qname</strong></a>(self, str, i, res)</dt><dd><tt>xyz:def -> ('xyz', 'def')<br>
If not in keywords and keywordsSet: def -> ('', 'def')<br>
:def -> ('', 'def')</tt></dd></dl>
<dl><dt><a name="SinkParser-setKeywords"><strong>setKeywords</strong></a>(self, k)</dt><dd><tt>Takes a list of strings</tt></dd></dl>
<dl><dt><a name="SinkParser-skipSpace"><strong>skipSpace</strong></a>(self, str, i)</dt><dd><tt>Skip white space, newlines and comments.<br>
return -1 if EOF, else position of first non-ws character</tt></dd></dl>
<dl><dt><a name="SinkParser-startDoc"><strong>startDoc</strong></a>(self)</dt></dl>
<dl><dt><a name="SinkParser-statement"><strong>statement</strong></a>(self, str, i)</dt></dl>
<dl><dt><a name="SinkParser-strconst"><strong>strconst</strong></a>(self, str, i, delim)</dt><dd><tt>parse an N3 string constant delimited by delim.<br>
return index, val</tt></dd></dl>
<dl><dt><a name="SinkParser-subject"><strong>subject</strong></a>(self, str, i, res)</dt></dl>
<dl><dt><a name="SinkParser-tok"><strong>tok</strong></a>(self, tok, str, i)</dt><dd><tt>Check for keyword. Space must have been stripped on entry and<br>
we must not be at end of file.</tt></dd></dl>
<dl><dt><a name="SinkParser-uEscape"><strong>uEscape</strong></a>(self, str, i, startline)</dt></dl>
<dl><dt><a name="SinkParser-uriOf"><strong>uriOf</strong></a>(self, sym)</dt></dl>
<dl><dt><a name="SinkParser-uri_ref2"><strong>uri_ref2</strong></a>(self, str, i, res)</dt><dd><tt>Generate uri from n3 representation.<br>
<br>
Note that the RDF convention of directly concatenating<br>
NS and local name is now used though I prefer inserting a '#'<br>
to make the namesapces look more like what XML folks expect.</tt></dd></dl>
<dl><dt><a name="SinkParser-variable"><strong>variable</strong></a>(self, str, i, res)</dt><dd><tt>?abc -> <a href="#SinkParser-variable">variable</a>(:abc)</tt></dd></dl>
<dl><dt><a name="SinkParser-verb"><strong>verb</strong></a>(self, str, i, res)</dt><dd><tt>has _prop_<br>
is _prop_ of<br>
a<br>
=<br>
_prop_<br>
>- prop -><br>
<- prop -<<br>
_operator_</tt></dd></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="ToN3">class <strong>ToN3</strong></a>(<a href="RDFSink.html#RDFSink">RDFSink.RDFSink</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Serializer output sink for N3<br>
<br>
keeps track of most recent subject and predicate reuses them.<br>
Adapted from Dan's ToRDFParser(Parser);<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ToN3-__init__"><strong>__init__</strong></a>(self, write, base<font color="#909090">=None</font>, genPrefix<font color="#909090">=None</font>, noLists<font color="#909090">=0</font>, quiet<font color="#909090">=0</font>, flags<font color="#909090">=''</font>)</dt></dl>
<dl><dt><a name="ToN3-bind"><strong>bind</strong></a>(self, prefixString, uri)</dt><dd><tt>Just accepting a convention here</tt></dd></dl>
<dl><dt><a name="ToN3-dummyClone"><strong>dummyClone</strong></a>(self)</dt><dd><tt>retun a version of myself which will only count occurrences</tt></dd></dl>
<dl><dt><a name="ToN3-endAnonymous"><strong>endAnonymous</strong></a>(self, subject, verb)</dt></dl>
<dl><dt><a name="ToN3-endAnonymousNode"><strong>endAnonymousNode</strong></a>(self, subj<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="ToN3-endDoc"><strong>endDoc</strong></a>(self, rootFormulaPair<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="ToN3-endFormulaObject"><strong>endFormulaObject</strong></a>(self, pred, subj)</dt></dl>
<dl><dt><a name="ToN3-endFormulaSubject"><strong>endFormulaSubject</strong></a>(self, subj)</dt></dl>
<dl><dt><a name="ToN3-endListObject"><strong>endListObject</strong></a>(self, subject, verb)</dt></dl>
<dl><dt><a name="ToN3-endListSubject"><strong>endListSubject</strong></a>(self, subj<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="ToN3-makeComment"><strong>makeComment</strong></a>(self, str)</dt></dl>
<dl><dt><a name="ToN3-makeStatement"><strong>makeStatement</strong></a>(self, triple, why<font color="#909090">=None</font>, aIsPossible<font color="#909090">=1</font>)</dt></dl>
<dl><dt><a name="ToN3-representationOf"><strong>representationOf</strong></a>(self, context, pair)</dt><dd><tt>Representation of a thing in the output stream<br>
<br>
Regenerates genids if required.<br>
Uses prefix dictionary to use qname syntax if possible.</tt></dd></dl>
<dl><dt><a name="ToN3-setDefaultNamespace"><strong>setDefaultNamespace</strong></a>(self, uri)</dt></dl>
<dl><dt><a name="ToN3-startAnonymous"><strong>startAnonymous</strong></a>(self, triple)</dt></dl>
<dl><dt><a name="ToN3-startAnonymousNode"><strong>startAnonymousNode</strong></a>(self, subj)</dt></dl>
<dl><dt><a name="ToN3-startDoc"><strong>startDoc</strong></a>(self)</dt></dl>
<dl><dt><a name="ToN3-startFormulaObject"><strong>startFormulaObject</strong></a>(self, triple)</dt></dl>
<dl><dt><a name="ToN3-startFormulaSubject"><strong>startFormulaSubject</strong></a>(self, context)</dt></dl>
<dl><dt><a name="ToN3-startListObject"><strong>startListObject</strong></a>(self, triple)</dt></dl>
<dl><dt><a name="ToN3-startListSubject"><strong>startListSubject</strong></a>(self, subj)</dt></dl>
<dl><dt><a name="ToN3-writeEncoded"><strong>writeEncoded</strong></a>(self, str)</dt><dd><tt>Write a possibly unicode string out to the output</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>flagDocumentation</strong> = 'Flags for N3 output are as follows:-<font color="#c040c0">\n</font> <font color="#c040c0">\n</font>a ...a existentially qualified explicitly named node.<font color="#c040c0">\n</font>'</dl>
<hr>
Methods inherited from <a href="RDFSink.html#RDFSink">RDFSink.RDFSink</a>:<br>
<dl><dt><a name="ToN3-checkNewId"><strong>checkNewId</strong></a>(self, uri)</dt><dd><tt>The store can override this to raise an exception if the<br>
id is not in fact new. This is useful because it is usfeul<br>
to generate IDs with useful diagnostic ways but this lays them<br>
open to possibly clashing in pathalogical cases.</tt></dd></dl>
<dl><dt><a name="ToN3-countNamespace"><strong>countNamespace</strong></a>(self, namesp)</dt><dd><tt>On output, count how many times each namespace is used</tt></dd></dl>
<dl><dt><a name="ToN3-genId"><strong>genId</strong></a>(self)</dt></dl>
<dl><dt><a name="ToN3-intern"><strong>intern</strong></a>(self, something)</dt></dl>
<dl><dt><a name="ToN3-namespaceCounts"><strong>namespaceCounts</strong></a>(self)</dt></dl>
<dl><dt><a name="ToN3-newBlankNode"><strong>newBlankNode</strong></a>(self, context, uri<font color="#909090">=None</font>, why<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="ToN3-newExistential"><strong>newExistential</strong></a>(self, context, uri<font color="#909090">=None</font>, why<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="ToN3-newFormula"><strong>newFormula</strong></a>(self, uri<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="ToN3-newList"><strong>newList</strong></a>(self, l, context)</dt></dl>
<dl><dt><a name="ToN3-newLiteral"><strong>newLiteral</strong></a>(self, str, dt<font color="#909090">=None</font>, lang<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="ToN3-newSymbol"><strong>newSymbol</strong></a>(self, uri)</dt></dl>
<dl><dt><a name="ToN3-newUniversal"><strong>newUniversal</strong></a>(self, context, uri<font color="#909090">=None</font>, why<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="ToN3-newXMLLiteral"><strong>newXMLLiteral</strong></a>(self, doc)</dt></dl>
<dl><dt><a name="ToN3-reopen"><strong>reopen</strong></a>(self)</dt><dd><tt>Un-End a document<br>
<br>
If you have added stuff to a document, thought you were done, and<br>
then want to add more, call this to get back into the sate that makeSatement<br>
is again acceptable. Remember to end the document again when done.</tt></dd></dl>
<dl><dt><a name="ToN3-setGenPrefix"><strong>setGenPrefix</strong></a>(self, genPrefix)</dt></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="tmToN3">class <strong>tmToN3</strong></a>(<a href="RDFSink.html#RDFSink">RDFSink.RDFSink</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="tmToN3-IsOf"><strong>IsOf</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-__init__"><strong>__init__</strong></a>(self, write, base<font color="#909090">=None</font>, genPrefix<font color="#909090">=None</font>, noLists<font color="#909090">=0</font>, quiet<font color="#909090">=0</font>, flags<font color="#909090">=''</font>)</dt></dl>
<dl><dt><a name="tmToN3-addAnonymous"><strong>addAnonymous</strong></a>(self, Id)</dt><dd><tt>If an anonymous shows up more than once, this is the<br>
function to call</tt></dd></dl>
<dl><dt><a name="tmToN3-addLiteral"><strong>addLiteral</strong></a>(self, lit, dt<font color="#909090">=None</font>, lang<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="tmToN3-addNode"><strong>addNode</strong></a>(self, node)</dt></dl>
<dl><dt><a name="tmToN3-addQuestionMarkedSymbol"><strong>addQuestionMarkedSymbol</strong></a>(self, sym)</dt></dl>
<dl><dt><a name="tmToN3-addSymbol"><strong>addSymbol</strong></a>(self, sym)</dt></dl>
<dl><dt><a name="tmToN3-backwardPath"><strong>backwardPath</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-beginAnonymous"><strong>beginAnonymous</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-beginFormula"><strong>beginFormula</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-beginList"><strong>beginList</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-bind"><strong>bind</strong></a>(self, prefixString, uri)</dt><dd><tt>Just accepting a convention here</tt></dd></dl>
<dl><dt><a name="tmToN3-checkIsOf"><strong>checkIsOf</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-declareExistential"><strong>declareExistential</strong></a>(self, sym)</dt></dl>
<dl><dt><a name="tmToN3-declareUniversal"><strong>declareUniversal</strong></a>(self, sym)</dt></dl>
<dl><dt><a name="tmToN3-end"><strong>end</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-endAnonymous"><strong>endAnonymous</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-endFormula"><strong>endFormula</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-endList"><strong>endList</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-endStatement"><strong>endStatement</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-forewardPath"><strong>forewardPath</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-setDefaultNamespace"><strong>setDefaultNamespace</strong></a>(self, uri)</dt></dl>
<dl><dt><a name="tmToN3-start"><strong>start</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-symbolString"><strong>symbolString</strong></a>(self, value)</dt></dl>
<dl><dt><a name="tmToN3-writeEncoded"><strong>writeEncoded</strong></a>(self, str)</dt><dd><tt>Write a possibly unicode string out to the output</tt></dd></dl>
<hr>
Methods inherited from <a href="RDFSink.html#RDFSink">RDFSink.RDFSink</a>:<br>
<dl><dt><a name="tmToN3-checkNewId"><strong>checkNewId</strong></a>(self, uri)</dt><dd><tt>The store can override this to raise an exception if the<br>
id is not in fact new. This is useful because it is usfeul<br>
to generate IDs with useful diagnostic ways but this lays them<br>
open to possibly clashing in pathalogical cases.</tt></dd></dl>
<dl><dt><a name="tmToN3-countNamespace"><strong>countNamespace</strong></a>(self, namesp)</dt><dd><tt>On output, count how many times each namespace is used</tt></dd></dl>
<dl><dt><a name="tmToN3-endDoc"><strong>endDoc</strong></a>(self, rootFormulaPair)</dt><dd><tt>End a document<br>
<br>
Call this once only at the end of parsing so that the receiver can wrap<br>
things up, oprimize, intern, index and so on. The pair given is the (type, value)<br>
identifier of the root formula of the thing parsed.</tt></dd></dl>
<dl><dt><a name="tmToN3-genId"><strong>genId</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-intern"><strong>intern</strong></a>(self, something)</dt></dl>
<dl><dt><a name="tmToN3-makeComment"><strong>makeComment</strong></a>(self, str)</dt><dd><tt>This passes on a comment line which of course has no semantics.<br>
<br>
This is only useful in direct piping of parsers to output, to preserve<br>
comments in the original file.</tt></dd></dl>
<dl><dt><a name="tmToN3-makeStatement"><strong>makeStatement</strong></a>(self, tuple, why<font color="#909090">=None</font>)</dt><dd><tt>add a statement to a stream/store.<br>
<br>
raises URISyntaxError on bad URIs<br>
tuple is a quad (context, predicate, subject, object) of things generated by calls to newLiteral etc<br>
why is reason for the statement.</tt></dd></dl>
<dl><dt><a name="tmToN3-namespaceCounts"><strong>namespaceCounts</strong></a>(self)</dt></dl>
<dl><dt><a name="tmToN3-newBlankNode"><strong>newBlankNode</strong></a>(self, context, uri<font color="#909090">=None</font>, why<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="tmToN3-newExistential"><strong>newExistential</strong></a>(self, context, uri<font color="#909090">=None</font>, why<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="tmToN3-newFormula"><strong>newFormula</strong></a>(self, uri<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="tmToN3-newList"><strong>newList</strong></a>(self, l, context)</dt></dl>
<dl><dt><a name="tmToN3-newLiteral"><strong>newLiteral</strong></a>(self, str, dt<font color="#909090">=None</font>, lang<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="tmToN3-newSymbol"><strong>newSymbol</strong></a>(self, uri)</dt></dl>
<dl><dt><a name="tmToN3-newUniversal"><strong>newUniversal</strong></a>(self, context, uri<font color="#909090">=None</font>, why<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="tmToN3-newXMLLiteral"><strong>newXMLLiteral</strong></a>(self, doc)</dt></dl>
<dl><dt><a name="tmToN3-reopen"><strong>reopen</strong></a>(self)</dt><dd><tt>Un-End a document<br>
<br>
If you have added stuff to a document, thought you were done, and<br>
then want to add more, call this to get back into the sate that makeSatement<br>
is again acceptable. Remember to end the document again when done.</tt></dd></dl>
<dl><dt><a name="tmToN3-setGenPrefix"><strong>setGenPrefix</strong></a>(self, genPrefix)</dt></dl>
<dl><dt><a name="tmToN3-startDoc"><strong>startDoc</strong></a>(self)</dt></dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-backslashUify"><strong>backslashUify</strong></a>(ustr)</dt><dd><tt>Use URL encoding to return an ASCII string corresponding<br>
to the given unicode</tt></dd></dl>
<dl><dt><a name="-dummy"><strong>dummy</strong></a>()</dt></dl>
<dl><dt><a name="-dummyWrite"><strong>dummyWrite</strong></a>(x)</dt></dl>
<dl><dt><a name="-hexify"><strong>hexify</strong></a>(ustr)</dt><dd><tt>Use URL encoding to return an ASCII string<br>
corresponding to the given UTF8 string<br>
<br>
>>> <a href="#-hexify">hexify</a>("<a href="http://example/a">http://example/a</a> b")<br>
'<a href="http://example/a%20b">http://example/a%20b</a>'</tt></dd></dl>
<dl><dt><a name="-nothing"><strong>nothing</strong></a>()</dt></dl>
<dl><dt><a name="-stringToN3"><strong>stringToN3</strong></a>(str, singleLine<font color="#909090">=0</font>, flags<font color="#909090">=''</font>)</dt><dd><tt>#"</tt></dd></dl>
<dl><dt><a name="-stripCR"><strong>stripCR</strong></a>(str)</dt></dl>
<dl><dt><a name="-toBool"><strong>toBool</strong></a>(s)</dt></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>ADDED_HASH</strong> = '#'<br>
<strong>ALL4</strong> = (0, 1, 2, 3)<br>
<strong>ANONYMOUS</strong> = 3<br>
<strong>BOOLEAN_DATATYPE</strong> = 'http://www.w3.org/2001/XMLSchema#boolean'<br>
<strong>CONTEXT</strong> = 0<br>
<strong>DAML_sameAs</strong> = (0, 'http://www.w3.org/2002/07/owl#sameAs')<br>
<strong>DAML_sameAs_URI</strong> = 'http://www.w3.org/2002/07/owl#sameAs'<br>
<strong>DECIMAL_DATATYPE</strong> = 'http://www.w3.org/2001/XMLSchema#decimal'<br>
<strong>Escapes</strong> = {'"': '"', r'\': r'\', 'a': '<font color="#c040c0">\x07</font>', 'b': '<font color="#c040c0">\x08</font>', 'f': '<font color="#c040c0">\x0c</font>', 'n': '<font color="#c040c0">\n</font>', 'r': '<font color="#c040c0">\r</font>', 't': '<font color="#c040c0">\t</font>', 'v': '<font color="#c040c0">\x0b</font>'}<br>
<strong>FLOAT_DATATYPE</strong> = 'http://www.w3.org/2001/XMLSchema#double'<br>
<strong>INTEGER_DATATYPE</strong> = 'http://www.w3.org/2001/XMLSchema#integer'<br>
<strong>LIST</strong> = 10000<br>
<strong>LITERAL</strong> = 2<br>
<strong>LITERAL_DT</strong> = 21<br>
<strong>LITERAL_LANG</strong> = 22<br>
<strong>LOG_implies_URI</strong> = 'http://www.w3.org/2000/10/swap/log#implies'<br>
<strong>List_NS</strong> = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'<br>
<strong>Logic_NS</strong> = 'http://www.w3.org/2000/10/swap/log#'<br>
<strong>N3CommentCharacter</strong> = '#'<br>
<strong>N3_Empty</strong> = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#Empty')<br>
<strong>N3_List</strong> = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#List')<br>
<strong>N3_first</strong> = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first')<br>
<strong>N3_forAll_URI</strong> = 'http://www.w3.org/2000/10/swap/log#forAll'<br>
<strong>N3_forSome_URI</strong> = 'http://www.w3.org/2000/10/swap/log#forSome'<br>
<strong>N3_li</strong> = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#li')<br>
<strong>N3_nil</strong> = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil')<br>
<strong>N3_rest</strong> = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest')<br>
<strong>OBJ</strong> = 3<br>
<strong>PARTS</strong> = (1, 2, 3)<br>
<strong>PRED</strong> = 1<br>
<strong>QUESTION</strong> = 10001<br>
<strong>RDF_NS_URI</strong> = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'<br>
<strong>RDF_spec</strong> = 'http://www.w3.org/TR/REC-rdf-syntax/'<br>
<strong>RDF_type</strong> = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type')<br>
<strong>RDF_type_URI</strong> = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'<br>
<strong>SUBJ</strong> = 2<br>
<strong>SYMBOL</strong> = 0<br>
<strong>XMLLITERAL</strong> = 25<br>
<strong>becauseSubexpression</strong> = <why.BecauseSubexpression instance><br>
<strong>digitstring</strong> = <_sre.SRE_Pattern object><br>
<strong>eof</strong> = <_sre.SRE_Pattern object><br>
<strong>eol</strong> = <_sre.SRE_Pattern object><br>
<strong>forbidden1</strong> = <_sre.SRE_Pattern object><br>
<strong>forbidden2</strong> = <_sre.SRE_Pattern object><br>
<strong>interesting</strong> = <_sre.SRE_Pattern object><br>
<strong>langcode</strong> = <_sre.SRE_Pattern object><br>
<strong>number_syntax</strong> = <_sre.SRE_Pattern object><br>
<strong>option_noregen</strong> = 0<br>
<strong>parsesTo_URI</strong> = 'http://www.w3.org/2000/10/swap/log#parsesTo'<br>
<strong>signed_integer</strong> = <_sre.SRE_Pattern object><br>
<strong>wide_build</strong> = True<br>
<strong>ws</strong> = <_sre.SRE_Pattern object></td></tr></table>
</body></html>
|