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?

>> 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?

> 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?
 - which dependency do I need to add to my pom.xml file in order to
use Apache Felix?
 - ...

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 added "learn OSGi and Apache Felix" to my list of things to learn...

> Once you have the runtime with the deployed bundles you can lookup
> services using a ServiceTracker to find a service implementing the
> EnhancementJobManager interface and then:
>
> ContentItem ci = new InMemoryContentItem(content.getBytes("UTF-8"),
> "text/plain");
> jobManager.enhanceContent(ci);
>
> Then you can lookup the resulting annotation in the RDF graph returned by:
>
> ci.getMetaData();
>
> The RDF triple-based API is a bit low level unfortunately but that's
> the price of modularity.

I am not worried of low level APIs so long I have the sources I can learn them.
But, I usually need a small example to get me started...

Is there any way I can cut short and use internal objects of Stanbol
without the OSGi stuff?

Thanks,
Paolo

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

Reply via email to