2011/11/6 Paolo Castagna <[email protected]>:
> Hi Oliver
>
> On 6 November 2011 13:39, Olivier Grisel <[email protected]> wrote:
>> You can start from the JAX-RS resource that publishes enhancement
>> engines as an HTTP service: see the class EnginesRootResources
>
> In which Stanbol module do I find the EngineRootResources class?

Type mvn eclipse:eclipse at the root of the stanbol source tree,
import all the projects into eclipse using
 "Import... > Existing projects into Workspace".

Then type "Shift-Ctrl-T" to lookup for any Java type (class,
interface, enum...) by name and "Shift-Ctrl-R" to lookup any resource
file (XML, CSS, javascript, ...) by filename.

>>> Is it possible to add a dependency to one or more Stanbol modules and
>>> avoid using an OSGi runtime (such Apache Felix and/or Eclipse Equinox)?
>>
>> The enhancement engines are OSGi services and need the runtime to find
>> their configuration and resources.
>
> Are you saying it is not possible to run/use any of the Stanbol machinery
> without an OSGi runtime?

Either use the HTTP endpoint or embed the Felix runtime. As I said
most engines require various configuration parameters and resources.
For instance the EntityLinking engine needs a configured referenced
site with a Solr index of DBpedia. All this configuration is done
automatically through the Felix runtime. You don't want to try and do
that by hand.

>> However embedding an OSGi runtime
>> into your Java app is not such a big deal, felix is very lightweight.
>> Here is the documentation:
>>
>>  https://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html#ApacheFelixFrameworkLaunchingandEmbedding-StandardFelixFrameworkLauncher
>
> I am left with too many questions open:
>
>  - BUNDLE_DIR_SWITCH where is that set?

By reading the source code of the example I guess this just a String
constant with value set to "-b".

>  - which dependency do I need to add to my pom.xml file in order to
> use Apache Felix?

Have a look at the list of common OSGi bundles Stanbol uses by default:

launchers/basebundlelist/src/main/bundles/list.xml

The engines you are interested in are provided by this additional list
of stanbol specific bundles:

launchers/stable/src/main/bundles/list.xml

> I agree, it's not a big deal for OSGi experts... but now I need to
> stop learning
> about by Stanbol and switch to learning about OSGi and Apache Felix.
> Don't get me wrong, I like learning new things every day... but this
> is becoming a
> 4 hours task for me rather than a 2-5 minutes HelloWorld Stanbol example.

I know I have already said that we need to write some documentation to
show how to embed Stanbol in a Java application. If you want a 2min
stanbol example use the HTTP endpoint. It's really easy to write a
simple HTTP client in Java using API such as:

https://blogs.oracle.com/enterprisetechtips/entry/consuming_restful_web_services_with

Apache Wink in the incubator also provides such a simple high level
HTTP client API if you prefer Apache licensed projects:

  https://incubator.apache.org/wink/0.1/api/org/apache/wink/client/Resource.html

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

Reply via email to