Bug fix

I performed a few bug fixes in SiRPAC 1.14 .

1) As proposed by Sergey Melnik in section 8 of

I corrected Element.java because of a bug in URL.java

		URL absoluteURL = new URL (sURI);
		sResult = absoluteURL.toString();
		URL absoluteURL = new URL (sURI);
		sResult = sURI; //CHANGED

it also seemed to me, in the same method, a bit further,
that both lines

		sResult = context + "#" + sURI;
should be
	        sResult = context + (sURI.startsWith("#")?"":"#") + sURI;

2) I also had the same problem as Sergey pointed out in section 9 of the
same document.
I think the way to correct it is by making namespace(String) return
source() rather
than "" for the default namespace, that is, in SiRPAC.java

		} else if (sPrefix.equals ("xmlns")) {
			return "";
		} else if (sPrefix.equals ("xmlns")) {
			return source()+"#"; // CHANGED

3) Finally, I had problem using the following syntax

<rdf:Description ID="foo"
<s:Page about="#foo"/>

I know this is much tricky, and there's a much simple way of wrinting
But I wanted to write it this way... ;P
The triple I get is related to "#foo" instead of "file:myfile.rdf#foo".
I fixed it by changing the following line in SiRPAC.processTypedNode()

		addTriple (new Property(RDFMS + "type"),
			new Resource(sObject),
			new Resource(typedNode.name()));
		addTriple (new Property(RDFMS + "type"),
			new Resource(Element.makeAbsolute(sObject,source())), // CHANGED
			new Resource(typedNode.name()));

That's all folks, and, well, I'm quite new to SiRPAC developpement so
I may have added some mistakes...
Anyway, I tested it with all the examples shiped with SiRPAC,
plus some personnal examples, and I have no more errors than with the
original version.

(I say no more errors because examples 4 and 7 still give erratic
 working on it :)



Received on Tuesday, 8 June 1999 10:48:39 UTC