Well spotted. Since the WHERE keyword is optional in SPARQL queries, and ?zWHERE is a perfectly valid variable name, you wouldn't get only two bindings but your third column would be empty.

Can you please check this, Carlo?

Barry



On 13/03/13 20:17, Jacek Malec wrote:
Hello!

Maybe I miss something but I don't see the trailing space after ?z in the query 
(yielding effectively ?zWHERE ...). Can this be the reason for such behaviour?

Best regards,
jacek

On 13 mar 2013, at 20:35, Carlo Allocca <carloallo...@yahoo.it> wrote:

OK. Just to clarify the Java code i am using, I attached the 
GettingStarted.java file and owlim.ttl.

1) I create an java project;
2) I crate a class GettingStarted.java with main
3) I copied the content of the GettingStarted.java that comes with the 
distribution
4) I run it.

Thank you very much for your help. I will repeat all the experiment as you 
suggested.

again Many Thanks,
Regards,
Carlo
--- Mer 13/3/13, Barry Norton <barry.nor...@ontotext.com> ha scritto:

Da: Barry Norton <barry.nor...@ontotext.com>
Oggetto: Re:
A: "Carlo Allocca" <carloallo...@yahoo.it>
Cc: owlim-discussion@ontotext.com
Data: Mercoledì 13 marzo 2013, 20:25


If I understand what you mean, you've hacked the GettingStarted.java source for 
the .jar in the OWLIM distribution.

Since you don't seem to intend to reload your data every time you run your 
code, however, it seems that what you wanted was the 'connect to remote 
repository' part of that code rather than the 'create a new in process 
repository' part.


I'd suggest to create a repository under Tomcat, convince yourself of the query 
results (using the Workbench, or using GNU tool and scripting as I did), then 
debug your Java. Your Java is simply using the Sesame API (nothing OWLIM 
specific) to talk to OWLIM over the same HTTP API that I'm using.

Barry



On 13/03/13 19:12, Carlo Allocca wrote:
Yes of course I do believe.

Please, i sent another email where i only loaded the file i sent. And, i still 
have the problem. Sorry for all my questions...it is just because I need to 
build a demo....Many Thanks for helping me...

"From where did you get:
"19:00:15 TOTAL: 2186431 statements loaded"
This number was when I loaded more files.

I am using OWLIM in java...and I am still getting the same "incomplete" 
results..


Many Thanks for your help Barry,

Regards,
Carlo
--- Mer 13/3/13, Barry Norton <barry.nor...@ontotext.com> ha scritto:

Da: Barry Norton <barry.nor...@ontotext.com>
Oggetto: Re:
A: "Carlo Allocca" <carloallo...@yahoo.it>
Cc: owlim-discussion@ontotext.com
Data: Mercoledì 13 marzo 2013, 20:06


 From where did you get:
"19:00:15 TOTAL: 2186431 statements loaded"

Is this the output from GettingStarted.jar ?

There are 63 statements in the file you sent me.

Again, from what you've passed to me "1 result(s)" is correct - do you believe 
otherwise?


Based on (unzipped) Tomcat 7 and OWLIM 5.3.5853, and creating Carlo.ttl based on editing 
getting-started/owlim.ttl (I simply set the repositoryID to "Carlo"), this is 
all I did:

$ cp owlim-se-5.3.5853/sesame_owlim/*.war apache-tomcat-7.0.22/webapps/
$ apache-tomcat-7.0.22/bin/startup.sh
$ curl -T Carlo.ttl -H "Content-Type:text/turtle" 
localhost:8080/openrdf-sesame/repositories/SYSTEM/rdf-graphs/service?graph=http://example.com/Carlo
$ curl -T WoRMS.nt -H "Content-Type:text/plain" 
localhost:8080/openrdf-sesame/repositories/Carlo/statements
$ diff \
<(curl -sH "Accept:text/csv" -d "query=SELECT ?z {<WoRMS:159343/Thunnus_atlanticus> 
a ?z}" localhost:8080/openrdf-sesame/repositories/Carlo) \
<(curl -sH "Accept:text/csv" -d "query=SELECT * {<WoRMS:159343/Thunnus_atlanticus> a 
?z}" localhost:8080/openrdf-sesame/repositories/Carlo)
Conclusion: There's no difference between those two queries.

Barry


On 13/03/13 18:56, Carlo Allocca wrote:
Yes. In fact,  I also tried, right now, with Workbench and Virtuoso, and the results are 
correct...however, i am using OWLIM from Java and I have only modified the class 
"GettingStart" in order to load the file i sent to you and I am running the 
queries i sent.

I have just tried again the following:

     "SELECT Distinct ?z" +
                        "WHERE { " +
                        "<WoRMS:159343/Thunnus_atlanticus> rdf:type ?z"+
                    "}";

REsults:
19:00:15 TOTAL: 2186431 statements loaded

---------------------------------------------


19:00:16 1 result(s) in 101ms.
What Am i doing wrong?please.

Regards,
Carlo


--- Mer 13/3/13, Barry Norton <barry.nor...@ontotext.com> ha scritto:

Da: Barry Norton <barry.nor...@ontotext.com>
Oggetto: Re:
A: "Carlo Allocca" <carloallo...@yahoo.it>
Cc: owlim-discussion@ontotext.com
Data: Mercoledì 13 marzo 2013, 19:43


OK, under OWL-Horst inference I get only 
<http://www.tlo.ics.forth.gr/TLO_entity#WoRMSSpeciesType> bound to ?z whether I 
use ?z or * as the projection.

When I use a variable predicate (3) I get:

Y       Z
rdf:type        <http://www.tlo.ics.forth.gr/TLO_entity#WoRMSSpeciesType>
<http://www.tlo.ics.forth.gr/TLO_entity#belongsTo>        <WoRMS:126065/Thunnus>
This seems quite consistent with:

$ apache-jena-2.7.4/bin/rdfparse WoRMS_instances11032013.owl > WoRMS.nt
$ grep '<WoRMS:159343/Thunnus_atlanticus>' WoRMS.nt

<WoRMS:159343/Thunnus_atlanticus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.tlo.ics.forth.gr/TLO_entity#WoRMSSpeciesType> .
<WoRMS:159343/Thunnus_atlanticus> <http://www.tlo.ics.forth.gr/TLO_entity#belongsTo> 
<WoRMS:126065/Thunnus> .

Especially since:

$ grep 'subClassOf' WoRMS.nt
[nothing]

$ grep 'equivalentClass' WoRMS.nt
[nothing]

Or should you have sent me an ontology too?

Barry



On 13/03/13 18:23, Carlo Allocca wrote:
Not yet in Workbench as I have other problems there...

I am using it as Jar...i am writing java code. This is the string for the query:

[1]         String FindTheWoRMSClassificationOfthunnus_albacares=
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
                         "PREFIX owl: <http://www.w3.org/2002/07/owl#> " +
                         "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>"+
                        "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " 
+
                        "PREFIX tlo: <http://www.tlo.ics.forth.gr/TLO_entity#>"+
                        "SELECT Distinct *" +
                        "WHERE { " +
                        "<WoRMS:159343/Thunnus_atlanticus> rdf:type ?z"+
                    "}";


[2]               String FindTheWoRMSClassificationOfthunnus_albacares=
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
                         "PREFIX owl: <http://www.w3.org/2002/07/owl#> " +
                         "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>"+
                        "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " 
+
                        "PREFIX tlo: <http://www.tlo.ics.forth.gr/TLO_entity#>"+
                        "SELECT Distinct ?z" +
                        "WHERE { " +
                        "<WoRMS:159343/Thunnus_atlanticus> rdf:type ?z"+
                    "}";

[3]:        String FindTheWoRMSClassificationOfthunnus_albacares=
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
                         "PREFIX owl: <http://www.w3.org/2002/07/owl#> " +
                         "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>"+
                        "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " 
+
                        "PREFIX tlo: <http://www.tlo.ics.forth.gr/TLO_entity#>"+
                        "SELECT Distinct ?y ?z" +
                        "WHERE { " +
                        "<WoRMS:159343/Thunnus_atlanticus> ?y ?z"+
                    "}";

I also attached the file containing the data.

Please, any help?
Regards,
Carlo


--- Mer 13/3/13, Barry Norton <barry.nor...@ontotext.com> ha scritto:

Da: Barry Norton <barry.nor...@ontotext.com>
Oggetto: Re:
A: "Carlo Allocca" <carloallo...@yahoo.it>
Cc: owlim-discussion@ontotext.com
Data: Mercoledì 13 marzo 2013, 19:10


OK, have you tried these queries in the Workbench?

What's with the quotes?

I see no close bracket on:
(1) [...]                       "<WoRMS:159343/Thunnus_atlanticus> rdf:type ?z"+
and
(3) [...]                       "<WoRMS:159343/Thunnus_atlanticus> ?y ?z"+

And the quote is outside the bracket (not sure how this could even Java parse) 
in:
(2) [...]                       "<WoRMS:159343/Thunnus_atlanticus> rdf:type 
?z"+}

Could I take a fuller look at the code, or at the data?

Barry



On 13/03/13 18:05, Carlo Allocca wrote:
Hi Barry and ALL,

I am having the same problem also with the version 5.3. Here the report:

1)      "SELECT Distinct *" +
                        "WHERE { " +
                        "<WoRMS:159343/Thunnus_atlanticus> rdf:type ?z"+

Results:
z
---------------------------------------------
http://www.tlo.ics.forth.gr/TLO_entity#TLOSpecies
http://www.tlo.ics.forth.gr/TLO_entity#WoRMSSpeciesType
http://www.tlo.ics.forth.gr/TLO_entity#BioticElementType
http://www.tlo.ics.forth.gr/TLO_entity#PhysicalObjectType
http://www.tlo.ics.forth.gr/TLO_entity#TLO_Entity_Type
http://www.tlo.ics.forth.gr/TLO_entity#WoRMSBioticElementType



2) "SELECT Distinct ?z" +
                        "WHERE { " +
                        "<WoRMS:159343/Thunnus_atlanticus> rdf:type ?z"+}
Results:
---------------------------------------------


18:06:46 1 result(s) in 37ms.

I should see at least one.

3) "SELECT Distinct ?y ?z" +
                        "WHERE { " +
                        "<WoRMS:159343/Thunnus_atlanticus> ?y ?z"+
Results:
y
---------------------------------------------
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.tlo.ics.forth.gr/TLO_entity#belongsTo

18:08:45 2 result(s) in 345ms.


Why not ?z


Any help on this?Please.

Regards,
Carlo

--- Mer 13/3/13, Barry Norton <barry.nor...@ontotext.com> ha scritto:

Da: Barry Norton <barry.nor...@ontotext.com>
Oggetto: Re:
A: "Carlo Allocca" <carloallo...@yahoo.it>
Cc: owlim-discussion@ontotext.com
Data: Mercoledì 13 marzo 2013, 16:16


Carlo, is there a motivation for using such an old version of OWLIM?

I'm sure one of the devs could, but I'd not be keen to go so far back to 
duplicate and diagnose your problem.

Barry


On 13/03/13 15:13, Carlo Allocca wrote:
Hi All,

I am using BigOWLIM 3.2 as jar and everything is working fine, except the 
following:

1) I run a very simple query such as:
     "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
     "SELECT Distinct ?z" +
                "WHERE { " +
                "<WoRMS:403218/WoRMS:127027/Thunnus_albacores> rdf:type ?z"+"}"
and I got no answer.

2) I run the "almost same query (changed ?z to *)"
     "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
     "SELECT Distinct * " +
                "WHERE { " +
                "<WoRMS:403218/WoRMS:127027/Thunnus_albacores> rdf:type ?z"+"}"

and I got the reselts i wanted:
[z=http://www.tlo.ics.forth.gr/TLO_entity#TLOSpecies]
[z=http://www.tlo.ics.forth.gr/TLO_entity#WoRMSSpeciesType]
[z=http://www.tlo.ics.forth.gr/TLO_entity#BioticElementType]
[z=http://www.tlo.ics.forth.gr/TLO_entity#PhysicalObjectType]
[z=http://www.tlo.ics.forth.gr/TLO_entity#TLO_Entity_Type]
[z=http://www.tlo.ics.forth.gr/TLO_entity#WoRMSBioticElementType]

It is very strange for me.
Does anybody can help me on this?

Here I report the main configuration file info:

[] a rep:Repository ;
    rep:repositoryID "owlim" ;
    rdfs:label "TLO Testing" ;
    rep:repositoryImpl [
      rep:repositoryType "openrdf:SailRepository" ;
      sr:sailImpl [
        owlim:ruleset "owl-max" ;
        owlim:entity-index-size "5000000" ;
        owlim:cache-size "3000" ;
        sail:sailType "owlim:Sail" ;
        owlim:partialRDFS  "true" ;
        owlim:noPersist "false" ;
        owlim:storage-folder "TLOBigOwlimStorage" ;
        owlim:base-URL "http://www.tlo.ics.forth.gr/TLO_entity#"; ;
        owlim:repository-type "file-repository" ;
        owlim:console-thread "false"
       ]
    ].


Thank you very much for your help, please.

Best,
Carlo

--- Gio 7/3/13, Barry Norton <barry.nor...@ontotext.com> ha scritto:

Da: Barry Norton <barry.nor...@ontotext.com>
Oggetto: Re: [Owlim-discussion] setting Ruleset owlim repository using sesame 
workbench
A: "Carlo Allocca" <carloallo...@yahoo.it>
Cc: owlim-discussion@ontotext.com
Data: Giovedì 7 marzo 2013, 18:58

Yeah, I got caught out by 'doing things properly'. If you've not added any data 
you won't do any harm by changing the ruleset post-creation (I guess as long as 
you restart to compile the new ruleset then add data)

B

----- Reply message -----
From: "Carlo Allocca" <carloallo...@yahoo.it>
To: "Barry Norton" <barry.nor...@ontotext.com>
Cc: <owlim-discussion@ontotext.com>
Subject: [Owlim-discussion] setting Ruleset owlim repository using sesame 
workbench
Date: Thu, Mar 7, 2013 5:10 PM


Hello Barry,

while you wrote me I was doing what you suggested in the previous email and I 
did it. It is working fine doing it using Sesame workbench.

One more, following the link 
http://owlim.ontotext.com/display/OWLIMv53/OWLIM+FAQ#OWLIMFAQ-HowdoIchangetheconfigurationofanOWLIMSesamerepositoryafterithasbeencreated%3F
as you suggester earlier, it is written explicitly that "...but there are other 
parameters that can not be changed once the
repository is created, e.g. the rule-set (in the case of OWLIM-SE)."

I read it after i run the query, but it is working!!!.

Many Thanks,
Regards,
Carlo


--- Gio 7/3/13, Barry Norton <barry.nor...@ontotext.com> ha scritto:

Da: Barry Norton <barry.nor...@ontotext.com>
Oggetto: Re: [Owlim-discussion] setting Ruleset owlim repository using sesame 
workbench
A: "Carlo Allocca" <carloallo...@yahoo.it>
Cc: owlim-discussion@ontotext.com
Data: Giovedì 7 marzo 2013, 16:25


      Sorry, no, not with the Sesame Workbench.

      The OWLIM Workbench has a field where you can fill this in, but
      that's also a change in way of doing things...

      Barry

      On 07/03/2013 14:14, Carlo Allocca wrote:

Hi Barry, thank you for your reply. As I have to prepare a demo
                very soon (less than one week time), the only parameter
                i need is ruleset as i need to use customized rules.
              Any suggestion using sesame workbench?
Carlo
                --- Gio 7/3/13, Barry Norton <barry.nor...@ontotext.com>
                ha scritto:

                  Da: Barry Norton <barry.nor...@ontotext.com>

                  Oggetto: Re: [Owlim-discussion] setting Ruleset owlim
                  repository using sesame workbench

                  A: "Carlo Allocca" <carloallo...@yahoo.it>

                  Cc: owlim-discussion@ontotext.com

                  Data: Giovedì 7 marzo 2013, 14:39

                        Carlo, I'd personally avoid using the Workbench
                        if you've significant parameters to set.

                        In the getting-started/ folder of the
                        distribution you'll find a set of parameters in
                        owlim.ttl, which you can copy and edit. One can
                        either instantiate a repository these with using
                        GettingStarted.jar (which will also help you
                        load ontologies and data), or can push it
                        directly to your live Sesame endpoint over its
                        HTTP interface with curl (my preference).

                        Barry

                        On 07/03/2013 13:33, Carlo Allocca wrote:

Dear
                                All,
it is again me. I would like to ask
                                  the following:
I creating a new OWLIM-SE
                                  repository with sesame workbench and
                                  my question is:
How Can I set "RulesSet" with
                                  myfile.pie ?
I have done it using OWLIM as java
                                  library, but how to do it using sesame
                                  workbench?
Thank you very much for your help. Regards,
                                Carlo
<GettingStarted.java><owlim.ttl>_______________________________________________
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion

_______________________________________________
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion

Reply via email to