Hello Luigi,

1. to add custom enhancements to the content you can just add triples
to the content's metadata graph (accessible in the enhancement
engine).

2. if you really want a reference to the EntityHub, indeed you can use
the OSGi API (through a BundleContent from your Activator).
http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#getServiceReference%28java.lang.Class%29



Carpe diem
                Gabriel

On Thu, Jan 10, 2013 at 4:18 PM, Luigi Selmi <[email protected]> wrote:
> Hi Rafa,
> thanks for your quick response. I know that enhancements are automatically
> stored into a triple collections for the documents metadata. Maybe my
> example was not clear. What I need to know is how to get a reference to the
> Entityhub using the Java API (not the REST API).
>
> Best
>
> Luigi
>
>
>
> 2013/1/10 Rafa Haro <[email protected]>
>
>> Hi Luigi,
>>
>> El 10/01/13 16:00, Luigi Selmi escribió:
>>
>>  Hello all,
>>> as in the subject of the email I need to store the enhancements that are
>>> extracted from some text passed to my enhancer in a ContentItem. I am
>>> quite
>>> new to Stanbol and OSGi programming and thought I should get a reference
>>> to
>>> the Entityhub service through its interface
>>>
>> I think that the enhancement graph is automatically store in the
>> ContentHub associated with the ContentItem. You can the retrieve it using
>> ContentHub REST API. Take a look to the API documentation:
>>
>> http://dev.iks-project.eu:**8081/contenthub/contenthub/**store/#<http://dev.iks-project.eu:8081/contenthub/contenthub/store/#>
>>
>>
>> Regards
>>
>>  (org.apache.stanbol.entityhub.**serviceapi.Entityhub ? ) and then call
>>> the
>>> store(..) method to store an enhancement into the Entityhub. Following the
>>> Felix documentation I should use a ServiceReference or a ServiceTracker to
>>> get the reference of the Entityhub but an enhancer in Stanbol must
>>> implement an EnhancementEngine interface that is different from a
>>> BundleActivator so I am not sure how to get the Entityhub's reference. Any
>>> help, best with some example code, will be greatly appreciated.
>>>
>>> Regards
>>>
>>> Luigi
>>>
>>>
>> This message should be regarded as confidential. If you have received this
>> email in error please notify the sender and destroy it immediately.
>> Statements of intent shall only become binding when confirmed in hard copy
>> by an authorised signatory.
>>
>> Zaizi Ltd is registered in England and Wales with the registration number
>> 6440931. The Registered Office is 222 Westbourne Studios, 242 Acklam Road,
>> London W10 5JJ, UK.
>>
>>



-- 
Gabriel Vince
Senior Consultant
Apogado
http://www.apogado.com

Reply via email to