Search in sources :

Example 16 with RDFTermURI

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);
}
Also used : RDFTermURI(it.unibo.arces.wot.sepa.commons.sparql.RDFTermURI) Bindings(it.unibo.arces.wot.sepa.commons.sparql.Bindings)

Example 17 with RDFTermURI

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;
}
Also used : JsonElement(com.google.gson.JsonElement) RDFTermURI(it.unibo.arces.wot.sepa.commons.sparql.RDFTermURI) JsonObject(com.google.gson.JsonObject) RDFTerm(it.unibo.arces.wot.sepa.commons.sparql.RDFTerm) Bindings(it.unibo.arces.wot.sepa.commons.sparql.Bindings) RDFTermLiteral(it.unibo.arces.wot.sepa.commons.sparql.RDFTermLiteral)

Example 18 with RDFTermURI

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);
}
Also used : RDFTermURI(it.unibo.arces.wot.sepa.commons.sparql.RDFTermURI) Bindings(it.unibo.arces.wot.sepa.commons.sparql.Bindings)

Example 19 with RDFTermURI

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);
}
Also used : RDFTermURI(it.unibo.arces.wot.sepa.commons.sparql.RDFTermURI) Bindings(it.unibo.arces.wot.sepa.commons.sparql.Bindings) RDFTermLiteral(it.unibo.arces.wot.sepa.commons.sparql.RDFTermLiteral)

Example 20 with RDFTermURI

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);
}
Also used : RDFTermURI(it.unibo.arces.wot.sepa.commons.sparql.RDFTermURI) Bindings(it.unibo.arces.wot.sepa.commons.sparql.Bindings)

Aggregations

Bindings (it.unibo.arces.wot.sepa.commons.sparql.Bindings)21 RDFTermURI (it.unibo.arces.wot.sepa.commons.sparql.RDFTermURI)21 RDFTermLiteral (it.unibo.arces.wot.sepa.commons.sparql.RDFTermLiteral)15 ErrorResponse (it.unibo.arces.wot.sepa.commons.response.ErrorResponse)5 Response (it.unibo.arces.wot.sepa.commons.response.Response)5 SubscribeResponse (it.unibo.arces.wot.sepa.commons.response.SubscribeResponse)4 UpdateResponse (it.unibo.arces.wot.sepa.commons.response.UpdateResponse)3 JsonElement (com.google.gson.JsonElement)2 JsonObject (com.google.gson.JsonObject)2 RDFTerm (it.unibo.arces.wot.sepa.commons.sparql.RDFTerm)2 Producer (it.unibo.arces.wot.sepa.pattern.Producer)2 QueryResponse (it.unibo.arces.wot.sepa.commons.response.QueryResponse)1 ARBindingsResults (it.unibo.arces.wot.sepa.commons.sparql.ARBindingsResults)1 BindingsResults (it.unibo.arces.wot.sepa.commons.sparql.BindingsResults)1 ApplicationProfile (it.unibo.arces.wot.sepa.pattern.ApplicationProfile)1 Font (java.awt.Font)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 ActionEvent (java.awt.event.ActionEvent)1