use of org.apache.stanbol.entityhub.yard.sesame.SesameYard in project stanbol by apache.
the class SesameContextTest method initYard.
@BeforeClass
public static final void initYard() throws RepositoryException {
repo.initialize();
//create the graphs in Clerezza
//init the ClerezzaYards for the created Clerezza graphs
SesameYardConfig yard1config = new SesameYardConfig("context 1 yard");
yard1config.setName("Yard over context 1");
yard1config.setContextEnabled(true);
yard1config.setContexts(new String[] { CONTEXT1.stringValue() });
yard1 = new SesameYard(repo, yard1config);
SesameYardConfig yard2config = new SesameYardConfig("context 2 yard");
yard2config.setName("Yard over context 2");
yard2config.setContextEnabled(true);
yard2config.setContexts(new String[] { CONTEXT2.stringValue() });
yard2 = new SesameYard(repo, yard2config);
SesameYardConfig unionYardConfig = new SesameYardConfig("union yard");
unionYardConfig.setName("Union Yard");
unionYard = new SesameYard(repo, unionYardConfig);
yards = Arrays.asList(yard1, yard2, unionYard);
//add the test data (to the Repository to also test pre-existing data)
RepositoryConnection con = repo.getConnection();
con.begin();
URI entity1 = sesameFactory.createURI("http://www.test.org/entity1");
con.add(entity1, rdfType, skosConcept, CONTEXT1);
con.add(entity1, skosPrefLabel, sesameFactory.createLiteral("test context one", EN), CONTEXT1);
con.add(entity1, skosPrefLabel, sesameFactory.createLiteral("Test Context Eins", DE), CONTEXT1);
expectedEntities.put(entity1, Arrays.asList(yard1, unionYard));
URI entity2 = sesameFactory.createURI("http://www.test.org/entity2");
con.add(entity2, rdfType, skosConcept, CONTEXT2);
con.add(entity2, skosPrefLabel, sesameFactory.createLiteral("test context two", EN), CONTEXT2);
con.add(entity2, skosPrefLabel, sesameFactory.createLiteral("Test Context Zwei", DE), CONTEXT2);
expectedEntities.put(entity2, Arrays.asList(yard2, unionYard));
con.commit();
con.close();
}
use of org.apache.stanbol.entityhub.yard.sesame.SesameYard in project stanbol by apache.
the class SesameYardTest method initYard.
@BeforeClass
public static final void initYard() throws RepositoryException {
SesameYardConfig config = new SesameYardConfig("testYardId");
config.setName("Sesame Yard Test");
config.setDescription("The Sesame Yard instance used to execute the Unit Tests defined for the Yard Interface");
repo = new SailRepository(new MemoryStore());
repo.initialize();
yard = new SesameYard(repo, config);
}
use of org.apache.stanbol.entityhub.yard.sesame.SesameYard in project stanbol by apache.
the class SesameYardComponent method registerSesameYard.
/**
* @param serviceReference
* @param repo
*/
protected void registerSesameYard(ServiceReference serviceReference, Repository repo) {
yard = new SesameYard(repo, yardConfig);
yardService = bundleContext.registerService(Yard.class.getName(), yard, config);
repoServiceReference = serviceReference;
}
Aggregations