System.out.println("For more information, please see:\n"
+ " <URL:http://wiki.github.com/joshsh/twitlogic/configuring-and-running-twitlogic>.");
}
private void runDemo(final Properties config) throws Exception {
final DatasetFactory datasetFactory = new DatasetFactory(new ValueFactoryImpl());
for (RDFContentLanguage l : RDFContentLanguage.values()) {
datasetFactory.addLanguage(l);
}
RDFAgentsPlatform p = new RDFAgentsPlatformImpl("twitlogic.fortytwo.net", 8889, config);
RDFAgent twitlogic = new TwitLogicAgent(config, p,
new AgentId("urn:x-agent:twitlogic@twitlogic.fortytwo.net", "xmpp://patabot.2@jabber.org"));
RDFAgent consumer = new RDFAgentImpl(p,
new AgentId("urn:x-agent:agent1@twitlogic.fortytwo.net", "xmpp://patabot.2@jabber.org"));
QueryConsumer<Value, Dataset> client = new QueryConsumerImpl(consumer);
PubsubConsumer<Value, Dataset> subscriber = new PubsubConsumerImpl(consumer);
ConsumerCallback<Dataset> callback = new ConsumerCallback<Dataset>() {
public void success(final Dataset answer) {
System.out.println("received a query result or subscription update. Answer follows:");
try {
datasetFactory.write(System.out, answer, RDFContentLanguage.RDF_TRIG);
} catch (LocalFailure e) {
e.printStackTrace(System.err);
}
}