use of it.unibo.arces.wot.sepa.commons.sparql.RDFTermURI in project SEPA by arces-wot.
the class EventPublisher method post.
public void post(String eventURI) {
Bindings bind = new Bindings();
bind.addBinding("event", new RDFTermURI(eventURI));
bind.addBinding("thing", new RDFTermURI(thing));
publisherWithoutOutput.update(bind);
}
use of it.unibo.arces.wot.sepa.commons.sparql.RDFTermURI in project SEPA by arces-wot.
the class ApplicationProfile method subscribeBindings.
public Bindings subscribeBindings(String selectedValue) {
JsonElement elem;
Bindings ret = new Bindings();
if ((elem = doc.get("queries")) != null)
if ((elem = elem.getAsJsonObject().get(selectedValue)) != null)
if ((elem = elem.getAsJsonObject().get("forcedBindings")) != null) {
for (Entry<String, JsonElement> binding : elem.getAsJsonObject().entrySet()) {
JsonObject value = binding.getValue().getAsJsonObject();
RDFTerm bindingValue = null;
if (value.get("type") != null) {
if (value.get("type").getAsString().equals("uri")) {
bindingValue = new RDFTermURI(value.get("value").getAsString());
} else {
bindingValue = new RDFTermLiteral(value.get("value").getAsString());
}
}
ret.addBinding(binding.getKey(), bindingValue);
}
}
return ret;
}
use of it.unibo.arces.wot.sepa.commons.sparql.RDFTermURI in project SEPA by arces-wot.
the class ActionListener method startListeningForAction.
public void startListeningForAction(String actionURI) throws SEPAProtocolException, SEPASecurityException {
if (actionListener.containsKey(actionURI))
return;
WoTActionListener listener = new WoTActionListener();
Bindings bindings = new Bindings();
bindings.addBinding("action", new RDFTermURI(actionURI));
listener.subscribe(bindings);
actionListener.put(actionURI, listener);
}
use of it.unibo.arces.wot.sepa.commons.sparql.RDFTermURI in project SEPA by arces-wot.
the class ThingDescription method addProperty.
public void addProperty(String property, String name, String dataType, String stability, String writable, String value) {
Bindings bind = new Bindings();
bind.addBinding("thing", thing);
bind.addBinding("property", new RDFTermURI(property));
bind.addBinding("name", new RDFTermLiteral(name));
bind.addBinding("stability", new RDFTermLiteral(stability));
bind.addBinding("writable", new RDFTermLiteral(writable));
bind.addBinding("dataType", new RDFTermURI(dataType));
bind.addBinding("value", new RDFTermLiteral(value));
properties.update(bind);
}
use of it.unibo.arces.wot.sepa.commons.sparql.RDFTermURI in project SEPA by arces-wot.
the class ThingDescription method addTargetProperty.
public void addTargetProperty(String action_OR_event, String property) {
Bindings bind = new Bindings();
bind.addBinding("action_OR_event", new RDFTermURI(action_OR_event));
bind.addBinding("property", new RDFTermURI(property));
targetProperties.update(bind);
}
Aggregations