Resource Access Interface

There is no single resource access interface in the SENSEI architecture, instead each resource description published by a REP includes information about the interface(s) available to access it, for example the URL and interface description. In order for Resource Users to easily access resources, a set of well-known resource interfaces have been defined for sensor, parameter, actuator and code-update resource types.

How to connect to these URLs using REST is described in the Connecting a Resource User section. A short example of how a response looks like is this:

   <nmib:Location mo:direction="B" mo:hasTimeStamp="17 Oct 2010 12:57:00" 
         mo:latitude="44.8300183" mo:line="24" mo:longitude="20.4559783" 
         mo:nextStationDistance="42.11" mo:nextStationID="B14" 

All responses are in the XML-RDF format so that the Semantic Query Analyser can work with them. How a Resource User gets this reference is by either querying an SQR or an RD. (see [[RuRli| the RLI Interface). Of course another way would be to browse an RD directly (/rd url) and to read all resources available, but this works well only for small systems.

The URL is provided by the Rep-Locator entry of the Resource Directory Description.

A resource may have one or more such urls, and even publish URL behind company proxies.


It is up to the client to detect if it will use IPv6 or IPv4 addresses and to select the best connected resource.

The whole RD entry looks like this:

<Name>Bus Location Sensors in Belgrade</Name>
<Description>GET returns sensor values (RDF)</Description><REP-Locator>

By using URLs to get sensor data, you can enforce AAA and Billing easily and you can use any language to query the resource. Ofcouse, you have to parse XML. A small example of a RAI Client is the monitoring plugin of the WP4 Check Service.

         * <p>res:hasDecimalValue="26.80"</p>
         * @see lia.util.DynamicThreadPoll.SchJob#doProcess()
        public Object doProcess() throws Exception {
                if (configGet == null) {
                        return null;
                Vector<Result> results = new Vector<Result>();
                HashMap<String,URL> sensors = configGet.getSensorUrls();
                for (String name : sensors.keySet()) {
                        URL url = sensors.get(name);
                        String sResult =, null);
                        String sPattern = "res:hasDecimalValue=\"((.)*)\"";
                        Pattern pattern = Pattern.compile(sPattern,
                                Pattern.UNIX_LINES | Pattern.DOTALL);
                        Matcher matcher = pattern.matcher(sResult);
                        try {
                                if (matcher.find()) {
                                        String data =;
                                        if (data != null) {
                                                Double value = new Double(data);

                                                //Store Result                                  
                                                Result result = new Result(Node.getFarmName(), 
                                                                name, ModuleName, ResTypes);
                                                result.time = System.currentTimeMillis();
                                                result.param[0] = value;
                                                if (logger.isLoggable(Level.INFO)) {
                                              "" + result.toString());
                        } catch (NumberFormatException e) {
                        } catch (NullPointerException e) {
                return results;
Last modified 12 years ago Last modified on Nov 1, 2010, 12:59:39 PM