Hi Fabian,

Thanks for spotting the mistake in my test. It was late and I was thinking about blank nodes!

Sure enough, when I made this change, I get the same behaviour as you. Many thanks indeed, now we have something to investigate.

For the future, please note that we appreciate very much any feedback about OWLIM, so keep your questions coming. It is the best way we have to improve our product!

Thanks again,
barry

Barry Bishop
OWLIM Product Manager
Ontotext AD
Tel: +43 650 2000 237
email: [email protected]
www.ontotext.com


On 23/03/12 08:02, Fabian Cretton wrote:
Hi Barry,
Last time I had such a question about SPARQL, it happened it was a real bug. Just saying this cause I hope I am not waisting your time for a problem on my side. I already see a difference in your little example and my situation: in your second insert, ex:b1 should be replaced by ex:b2 But I will try to reproduce it with a small data set, see if I can reproduce it, and otherwise I will tell you how to create the situation with wordNet. During that process I could discover what I do wrong. And if not, I will send you the information.
Thanks again
Fabian

>>> Barry Bishop <[email protected]> 22.03.2012 19:49 >>>
Hi Fabian,

Strangely, I can't seem to reproduce this. I created the following test and this gets the expected result from the 3rd query (I tried using a URI instead of a literal and it still worked);

    @Test
    public void mergedQueriesWithPropertyPaths() throws Exception {
        RepositoryConnection connection = null;
        TupleQueryResult result = null;

        try {
            connection = getRepository().getConnection();
            connection.setAutoCommit(false);

            String insertData =
            "INSERT DATA { " +
            "ex:ann1 ex:hasLookupURI ex:ws1. " +
            "ex:ws1 ex:linkedTo ex:b1 . " +
            "ex:b1 ex:linkedTo ex:wordsense-prey-noun-2. " +
            "ex:ann1 ex:isAnnAboutText \"text\"^^xsd:string. } ";

            SparqlHelper helper = new SparqlHelper(connection);
            helper.update(insertData, false);

            insertData =
            "INSERT DATA { " +
            "ex:ann2 ex:hasLookupURI ex:ws2. " +
            "ex:ws2 ex:linkedTo ex:b1 ." +
            "ex:b1 ex:linkedTo ex:wordsense-snake-noun-1. " +
            "ex:ann2 ex:isAnnAboutText \"text\"^^xsd:string. } ";

            helper.update(insertData, false);

            final String query1 =
                "SELECT distinct ?text WHERE { " +
                "?ann1 ex:hasLookupURI ?ws1. " +
                "?ws1 ex:linkedTo{1, 2} ex:wordsense-prey-noun-2. " +
                "?ann1 ex:isAnnAboutText ?text. }";

            helper.tupleQuery(query1, false);
            helper.verify("text", "text");
            helper.verifyNoBindingsRemaining();

            final String query2 =
                "SELECT distinct ?text WHERE { " +
                "?ann2 ex:hasLookupURI ?ws2. " +
                "?ws2 ex:linkedTo{1, 2} ex:wordsense-snake-noun-1. " +
                "?ann2 ex:isAnnAboutText ?text. }";

            helper.tupleQuery(query2, false);
            helper.verify("text", "text");
            helper.verifyNoBindingsRemaining();

/// now merging the two patterns should give me the same common result, but the resultset is empty:
            final String query3 =
                "SELECT distinct ?text WHERE { " +
                "?ann1 ex:hasLookupURI ?ws1. " +
                "?ws1 ex:linkedTo{1, 2} ex:wordsense-prey-noun-2. " +
                "?ann1 ex:isAnnAboutText ?text. " +
                "?ann2 ex:hasLookupURI ?ws2. " +
                "?ws2 ex:linkedTo{1, 2} ex:wordsense-snake-noun-1. " +
                "?ann2 ex:isAnnAboutText ?text. }";

            helper.tupleQuery(query3, false);
            helper.verify("text", "text");
            helper.verifyNoBindingsRemaining();
        } finally {
            Utils.close(result);
            Utils.close(connection);
        }
    }


And this is working with the latest OWLIM 4.3 update. Can you tell what exact version number you are using - including build number? Also, could you try to provide some minimal dataset that reproduces the problem?

Many thanks,
barry

On 22/03/12 08:00, Fabian Cretton wrote:
I forgot to mention something important about that "strange" behaviour:
In the final query, when I change my property path from {1, 2} to {1, 3}, the solution does appear:
SELECT distinct ?text WHERE {
?ann1 nlp:hasLookupURI ?ws1.
?ws1 wn20schema:linkedTo{1, 3} wn30:wordsense-prey-noun-2.
?ann1 nlp:isAnnAboutText ?text.
?ann2 nlp:hasLookupURI ?ws2.
?ws2 wn20schema:linkedTo{1, 3} wn30:wordsense-snake-noun-1.
?ann2 nlp:isAnnAboutText ?text.
}

Fabian

>>> Barry Norton <[email protected]> 21.03.2012 17:59 >>>

Hi, Fabian,

Is ?text bound to a literal when it succeeds in the two queries at the top?

Barry


On 20/03/2012 14:13, Fabian Cretton wrote:
Hi,
I do have a strange behaviour that I don't understand, working with OWLIM 4.3. I think there is no need to provide detailed information about the dataset to understand my problem, but will give more information if needed.
I have some texts with lookups on wordnet.
With a query, I want to find the texts which have a look-up that is 'linkedTo' a precise wordsense.
The linkedTo property being created by my self in the store.
If I execute 2 queries about two different wordsense, the results are correct: I get the same text as the answer But if I merge the two wordsenses in a single query: the resultset is empty, and I can't understand why.
Query 1: the following query returns one result:
SELECT distinct ?text WHERE   {
?ann1 nlp:hasLookupURI ?ws1.
?ws1 wn20schema:linkedTo{1, 2} wn30:wordsense-prey-noun-2.
?ann1 nlp:isAnnAboutText ?text.
}
Query 2: this other query returns the same result as query 1
SELECT distinct ?text WHERE   {
?ann2 nlp:hasLookupURI ?ws2.
?ws2 wn20schema:linkedTo{1, 2} wn30:wordsense-snake-noun-1.
?ann2 nlp:isAnnAboutText ?text.
}
Query 3: now merging the two patterns should give me the same common result, but the resultset is empty:
SELECT distinct ?text WHERE   {
?ann1 nlp:hasLookupURI ?ws1.
?ws1 wn20schema:linkedTo{1, 2} wn30:wordsense-prey-noun-2.
?ann1 nlp:isAnnAboutText ?text.
?ann2 nlp:hasLookupURI ?ws2.
?ws2 wn20schema:linkedTo{1, 2} wn30:wordsense-snake-noun-1.
?ann2 nlp:isAnnAboutText ?text.
}
Thank you for any help
Fabian


_______________________________________________
Owlim-discussion mailing list
[email protected]
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion



_______________________________________________
Owlim-discussion mailing list
[email protected]
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion
_______________________________________________
Owlim-discussion mailing list
[email protected]
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion

Reply via email to