I am looking at TestModelRead.testSimpleLoadImplictBase() where the test
cases are being read from the jena-core tests jar v 2.10.1.
public void testSimpleLoadImplictBase() throws IRIException,
FileNotFoundException
{
final Model mBasedImplicit = createModel();
final String fn = IRIResolver
.resolveFileURL( getFileName("modelReading/based.n3"));
final Model wanted = createModel().add(ModelHelper.resource(fn),
ModelHelper.property("ja:predicate"),
ModelHelper.resource("ja:object"));
mBasedImplicit.read(fn, "N3");
ModelHelper.assertIsoModels(wanted, mBasedImplicit);
}
the method getFileName("modelReading/based.n3") returns a
jar:file://[jarPath]![enclosedFile] url. I have registered a new Locator
(LocatorJarURL) using StreamManager.get().addLocator( new LocatorJarURL()
);
LocatorJarURL does as you would expect and extracts the stream from the jar.
The problem is that the IRIResolver.resolveFileURL() does not recognize the
jar: URL and converts it to
file://[directory]/jar:file://[jarPath]![enclosedFile]
While I could patch
IRIResolver.resolveFileURL() to handle the jar based URL I think this
points to a larger problem wherein file locators added to the StreamManager
do not add capabilities to the IRIResolver.
Is there a recommended way to register file based scheme (like jar) with
the IRIResolver? I am more than happy to code it if we have a
recommendation.
Claude
--
I like: Like Like - The likeliest place on the web<http://like-like.xenei.com>
Identity: https://www.identify.nu/[email protected]
LinkedIn: http://www.linkedin.com/in/claudewarren