Hello all,My goal is to dereference a FOAF URI and place its contents in RDF into the Entityhub.
It appears to be that I'm having a problem getting the dependency working for my enhancer. The bundle appears to be installed okay if I look at it under system/console/bundles and it is active.
However, under the hood, I get the following when I install the bundle:16.01.2013 20:00:19.267 *INFO* [Background Install /tmp/install58447963373332243.tmp] demo.enhancer.engines.foafknows [eu.fusepool.demo.foaf.knows.FoafEnhancementEngine] Dependency not satisfied: entity 16.01.2013 20:00:19.267 *INFO* [Background Install /tmp/install58447963373332243.tmp] demo.enhancer.engines.foafknows [eu.fusepool.demo.foaf.knows.FoafEnhancementEngine] Dependency not satisfied: entityHubRepresentation 16.01.2013 20:00:19.267 *INFO* [Background Install /tmp/install58447963373332243.tmp] demo.enhancer.engines.foafknows [eu.fusepool.demo.foaf.knows.FoafEnhancementEngine] Not all dependencies satisified, cannot activate 16.01.2013 20:00:19.273 *INFO* [FelixDispatchQueue] demo.enhancer.engines.foafknows BundleEvent STARTED
If I actually try to run the chain:curl -X POST -H "Accept: text/turtle" -H "Content-type: text/plain" --data "foo" http://localhost:8080/enhancer/chain/FOAFChain
understandably, I get an HTTP ERROR 500:Error 500 Enhancement Chain failed because of required Engine 'demoEngine' failed with Message: Unable to process ContentItem '<urn:content-item-sha1-0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33>' with Enhancement Engine 'demoEngine' because the engine is currently not active!
My pom.xml contains:
<dependency>
<groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.entityhub.servicesapi</artifactId>
<version>0.11.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.entityhub.core</artifactId>
<version>0.11.0-SNAPSHOT</version>
</dependency>
In my engine, I have the following key imports:
import org.apache.stanbol.entityhub.servicesapi.Entityhub;
import org.apache.stanbol.entityhub.servicesapi.EntityhubException;
import org.apache.stanbol.entityhub.servicesapi.model.Entity;
import org.apache.stanbol.entityhub.servicesapi.query.FieldQuery;
import org.apache.stanbol.entityhub.servicesapi.query.QueryResultList;
import org.apache.stanbol.entityhub.servicesapi.model.Representation;
I have following references:
@Reference private Entityhub entityHub;
@Reference private Entity entity;
@Reference private Representation entityHubRepresentation;
and in my computeEnhancements():
Graph csarvenGraph = getURI("http://csarven.ca/contacts");
entityHubRepresentation.add("csarvenGraph", csarvenGraph);
Representation r = entity.getRepresentation();
Entity e = entityHub.store(r);
My understanding about how loading entities into the Entityhub is
supposed to work is that, in order to store into the entityhub it needs
to pass some representation of it. For that to happen, a representation
of some RDF graph is (temporarily?) added - although I don't think I
understand what "representation" really means here - and then that
representation is passed to entityHub.store().
I'm not certain if in the right direction, so, any help is appreciated. :) If someone can point me to a small "load entities into entityhub with the Java API" example, that'd be great as well.
Thanks! http://csarven.ca/#i
smime.p7s
Description: S/MIME Cryptographic Signature
