View Source

{toc}

h2. Plug-in API improvements

h3. Support for external plug-ins

External plug-ins are implemented by a code outside the GraphDB's classpath and loaded through their own dedicated class loaders.

They are packaged in _plugin directories_ and grouped into one or more _plugin home directories_. Every plugin home directory may contain any number of _plugin directories_, each of which may contain any number of JAR files. A dedicated class loader is created for loading the code from each _plugin directory_. Every plugin should provide in its _plugin directory_ all dependencies that cannot be expected to be provided through the GraphDB's classpath.

Ideally, a single plug-in directory should provide the implementation of a single plug-in – this is _recommended_, but *not enforced* by the current implementation.

h3. Class-loading and plug-in dependencies

In order to allow you maximum freedom, each external plug-in is loaded in a self-first class loader (contrary to the Java's parent-first). It means that the external plug-ins can use whatever dependencies they want, including such that override the ones of GraphDB.

There is one limitation, though. The Java ecosystem is full of various frameworks, which do class instantiation based on reflection or custom class loaders. Be aware of the class-loading in the frameworks you use (think Spring, slf4j, GATE, XML libraries, even Lucene) in order to prevent _ClassCastException_s and _LinkageError_s. Usually, the issue is that a dependency is using the current thread's context class loader, which is actually the GraphDB class loader (since webapp containers run each webapp in its own thread pool and class loader) and this, unfortunately, allows mixing plug-in and core dependencies.

h2. External plug-ins

Here is a list of plug-ins, which were previously shipped within OWLIM and have been externalized in order to cut the core's dependency on Lucene.
* [Full-text Search|GraphDB-SE Full-text Search] - allows you to create full-text search queries through SPARQL;
* Lucene;
* [Concept Extraction Plug-in (CES)] - provides concept extraction and semantic pipeline management through a SPARQL interface;
* [Lucene2 Plug-in (deprecated)] - built on top of Lucene 3.x.x, can be used for searching concept literals and combining FTS and semantic search;
* [Lucene4 Plug-in (deprecated)] - builds on top of Lucene2 by using Lucene 4.x.x and allows blazing fast facet queries.

{note} The Lucene2 and Lucene4 plug-ins are deprecated. We recommend that you use the [GraphDB search connectors|GraphDB Connectors].{note}