universAAL / context

Context Information Managers enable universAAL applications to be Context-Aware
4 stars 7 forks source link

Fix Log issues with Sesame 2.9.0 #8

Open amedranogil opened 7 years ago

amedranogil commented 7 years ago

The branch sesame2.9.0 contains a modification of CHe feature that uses a version of Sesame which is more sensible with SPARQL queries. While trying to get it to work I noticed that most of the issues where regarding the log frameworks (logback vs slf4j vs pax.logging[the system used by karaf]). I am not very proficient on configuring these but in the end I managed to make it work. The only problem is that the Logging system has been hijacked by the new log framework and all the logs are writen to console, instead of in the log files like it should. May someone who is more proficient on log systems + karaf (maybe @michelegirolami or @kismet ) have a look at it and see if there is some configuration that could fix it.

procedure to replicate:

  1. check out context:sesame2.9.0 https://github.com/universAAL/context/tree/sesame2.9.0
  2. build at least the karaf feature for context
  3. run karaf and install uAAL-ctxt.CHe feature observe the matrix
Alfiva commented 6 years ago

This will be superseded if we approve #483 . When Sesame became rdf4j, at some point, their logging system changed again. In the runtime bundle I have modded in the rdf4j branch, I have set those dependencies as optional, so there is actually no need to add more logging libraries because of this. Logging should then be unmodified. The only issue may be not getting logs of the innards of rdf4j...

amedranogil commented 6 years ago

Just ensure that the new version of the backend actually constructs full objects when requested (this branch was created precisely because sesame 2.6.0 had a bug where it did not comply 100% with SPARQL specs, like constructs, and star-propertypats).

Alfiva commented 6 years ago

If Sesame 2.9.0 fixed it, then rdf4j should as well - they just changed the name AFAIK. Do you have some tests or a link to the original issue so I can test?

amedranogil commented 6 years ago

This query should get a complete resource stored in the backend:

    public Resource getFullResourceGraph(String uri){
        String query = "prefix : <urn:foo:test>\n" +
                        "CONSTRUCT { ?s ?p ?o }\n" +
                        "WHERE { <"+ uri +"> (:a|!:a)* ?s . ?s ?p ?o . }";

        Object o = getSerializer().deserialize(unserialisedQuery(query));
        Resource r = (Resource) o;
        return r;
    }

version 2.6.0 could not handle (:a|!:a) nor * for some reason.

Alfiva commented 6 years ago

I have tested that with a sample context event in the current CHe (sesame) and the new branch (rdf4j).

In the Sesame one, I got the DESCRIBE of the event, plus all properties of its properties (i.e. like one additional level deep).

In the rdf4j one I got a lot of statements that I assume are the Concise Bounded Description of the event (going all levels deep, exhausting all possbile paths - which considering the current "bug" with "hasValue" property in ont.device, is practically all info on all devices... but that's another issue).

I guess that means it works as expected? I can paste the results if you want to check.