Problems with sax2rdf.py

Below is a patch to sax2rdf.py -- it fixes two bugs I found:

 - Appends the genPrefix to the base URI so that genids aren't left
"hanging" in space.

 - Uses the new FORMULA type for formulas, as opposed to RESOURCE

Hope this helps,
-- 
[ :name "Aaron Swartz" ] is dc:author of <> .

[aswartz@v123-1 swap]$ cvs diff sax2rdf.py
Index: sax2rdf.py
===================================================================
RCS file: /sources/public/2000/10/swap/sax2rdf.py,v
retrieving revision 1.3
diff -r1.3 sax2rdf.py
61a62
> FORMULA = notation3.FORMULA
85c86
<         self._genPrefix = "#_g"    # @@@ allow parameter override
---
>         self._genPrefix = self._thisURI + "#_g"    # @@@ allow parameter
override
179c180
<             self.sink.makeStatement(( (RESOURCE, self._context),
---
>             self.sink.makeStatement(( (FORMULA, self._context),
188c189
<             self.sink.makeStatement(( (RESOURCE, self._context),
---
>             self.sink.makeStatement(( (FORMULA, self._context),
207c208
<                 self.sink.makeStatement((  (RESOURCE, c),
---
>                 self.sink.makeStatement((  (FORMULA, c),
286c287
<                         self.sink.makeStatement(( (RESOURCE, c),
---
>                         self.sink.makeStatement(( (FORMULA, c),
302c303
<                                 self.sink.makeStatement(( (RESOURCE, c),
---
>                                 self.sink.makeStatement(( (FORMULA, c),
320c321
<                     self.sink.makeStatement(((RESOURCE, self._context),
---
>                     self.sink.makeStatement(((FORMULA, self._context),
326c327
<                     self.sink.makeStatement(((RESOURCE, self._context),
---
>                     self.sink.makeStatement(((FORMULA, self._context),
341c342
<             self.sink.makeStatement(( (RESOURCE, c),   # Link in new pair
---
>             self.sink.makeStatement(( (FORMULA, c),   # Link in new pair
346c347
<             self.sink.makeStatement(( (RESOURCE, c),
---
>             self.sink.makeStatement(( (FORMULA, c),
360c361
<             self.sink.makeStatement(( (RESOURCE, c), # Link to new object
---
>             self.sink.makeStatement(( (FORMULA, c), # Link to new object
381c382
<             self.sink.makeStatement(( (RESOURCE, self._context),
---
>             self.sink.makeStatement(( (FORMULA, self._context),
388c389
<             self.sink.makeStatement(( (RESOURCE, self._context),
---
>             self.sink.makeStatement(( (FORMULA, self._context),

Received on Monday, 4 June 2001 13:44:22 UTC