use of it.unibo.arces.wot.sepa.commons.sparql.RDFTermLiteral in project SEPA by arces-wot.
the class LCDProducer method justText.
private static void justText(Producer client) {
Bindings bind = new Bindings();
while (true) {
bind = new Bindings();
bind.addBinding("value", new RDFTermLiteral("Let Things Talk"));
client.update(bind);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bind = new Bindings();
bind.addBinding("value", new RDFTermLiteral("Vaimee!"));
client.update(bind);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
use of it.unibo.arces.wot.sepa.commons.sparql.RDFTermLiteral in project SEPA by arces-wot.
the class MessageSender method sendMessage.
public boolean sendMessage(String receiver, String text) {
message.addBinding("receiver", new RDFTermLiteral(receiver));
message.addBinding("text", new RDFTermLiteral(text));
Response ret = update(message);
return ret.isUpdateResponse();
}
use of it.unibo.arces.wot.sepa.commons.sparql.RDFTermLiteral in project SEPA by arces-wot.
the class MQTTAdapter method messageArrived.
@Override
public void messageArrived(String topic, MqttMessage value) throws Exception {
logger.info(topic + " " + value.toString());
Bindings bindings = new Bindings();
bindings.addBinding("topic", new RDFTermLiteral(topic));
bindings.addBinding("value", new RDFTermLiteral(value.toString()));
bindings.addBinding("broker", new RDFTermLiteral(serverURI));
update(bindings);
}
use of it.unibo.arces.wot.sepa.commons.sparql.RDFTermLiteral in project SEPA by arces-wot.
the class MQTTServerMonitoring method addObservation.
private static void addObservation(Entry<String, JsonElement> mapping) {
String topic = mapping.getKey();
String observation = mapping.getValue().getAsJsonObject().get("observation").getAsString();
String unit = mapping.getValue().getAsJsonObject().get("unit").getAsString();
String location = mapping.getValue().getAsJsonObject().get("location").getAsString();
String comment = mapping.getValue().getAsJsonObject().get("comment").getAsString();
String label = mapping.getValue().getAsJsonObject().get("label").getAsString();
Bindings bindings = new Bindings();
bindings.addBinding("observation", new RDFTermURI(observation));
bindings.addBinding("comment", new RDFTermLiteral(comment));
bindings.addBinding("label", new RDFTermLiteral(label));
bindings.addBinding("location", new RDFTermURI(location));
bindings.addBinding("unit", new RDFTermURI(unit));
bindings.addBinding("topic", new RDFTermLiteral(topic));
logger.info("Add observation: " + bindings);
mqttInitializer.update(bindings);
}
use of it.unibo.arces.wot.sepa.commons.sparql.RDFTermLiteral in project SEPA by arces-wot.
the class MQTTSmartifier method updateObservationValue.
private void updateObservationValue(String observation, String value) {
Bindings bindings = new Bindings();
bindings.addBinding("observation", new RDFTermURI(observation));
bindings.addBinding("value", new RDFTermLiteral(value));
logger.info("Update observation: " + bindings);
update(bindings);
}
Aggregations