protegeproject / swrlapi

Java API for working with the SWRL rule and SQWRL query languages
Other
99 stars 40 forks source link

Loading of external built-ins fails #74

Closed RalphBln closed 1 year ago

RalphBln commented 2 years ago

The URLClassLoader instance created in loadExternalSWRLBuiltInLibraries is not used and loading of custom built-in library classes fails.

martinjoconnor commented 2 years ago

Thanks for contributing this.

Can you explain what the fix does?

RalphBln commented 2 years ago

Sure :)

The original code creates a URLClassLoader instance in SWRLBuiltInLibraryManager, line 82 but the instance is never used. In the fixed code, the instance is now passed to instantiateSWRLBuiltInLibraryImplementation and actually used for loading the external library classes (otherwise they would not be found because the original classloader does not have the external library directories in its classpath, at least not if the swrlapi is used from the swrltab protege plug-in).

martinjoconnor commented 2 years ago

Great - thanks. I will merge this during the week. I'm not sure it will fix the entire issue here - I never properly finished the built-in loading task because OSGi hurt my head and I ran out of time, but this sounds like a necessary first step.