{
SimpleDispelEngine engine = new SimpleDispelEngine();
RDFAdmireRegistry registry = new RDFAdmireRegistry();
SimpleRDFProcessingElementRegistry simpleRdfRegistry = new SimpleRDFProcessingElementRegistry(REGISTRY_URL_TEST2);
registry.setProcessingElementRegistry(simpleRdfRegistry);
registry.setAdmireRepository(new InMemoryAdmireRepository());
engine.setDispelOptimiser(new SimpleDispelOptimiser());
engine.setAdmireRegistry(registry);
String dispelCode = "package admire.dataAccess.relational \n" +
"{\n" +
" Type DAS13 is PE(<Connection expression; Connection locator resource> => <Connection data>);\n" +
" Type DAS14 is PE(<Connection expression; Connection locator resource> => <Connection data>);\n" +
" register DAS13, DAS14;\n" +
"}\n";
DispelEngineResult res = engine.peekDispel(dispelCode);
// register objects
for (Entry<String, RegisteredObject> register : res.getRegistration().entrySet())
{
String name = register.getKey();
DispelObject object = null;
try
{
object = new DispelObject(name, register.getValue().getObject());
ProcessingElementDescriptor pe = registry.getPEDescriptor(name, object);
HashMap<String, String> map = new HashMap<String, String>();
map.put("@version", "1781112");
pe.setMetadata(map);
simpleRdfRegistry.registerProcessingElement(pe, "PE");
System.out.println("PE : " + name + " registered");
}
catch (RegistrationFailedException e)
{
e.printStackTrace();