Date: 2013-02-14 11:02:18
From: marek_surek@yahoo.co.uk
Hi everyone,
I experienced strange behavior during query answering, but Im not sure where can be problem.
This query is not working(no results returned) : 
SELECT DISTINCT ?key ?value ?label ?score FROM NAMED <http://www.ontotext.com/explicit> { ?value luc:sestateIndex "word*"^^xsd:string . ?value luc:score ?score . ?value rdfs:label ?label .? GRAPH <http://www.ontotext.com/explicit> { ?value rdf:type ?key } .? } 
but if I remove one of these (no matter which one)
?value rdfs:label ?label . OR GRAPH <http://www.ontotext.com/explicit> { ?value rdf:type ?key} OR ?value luc:score ?score?
suddelny all is perfectly working as I expect. Lucene index is properly created by this query :
INSERT DATA 
??? ??? ??? {
? ??? ??? ??? ??? luc:index luc:setParam "uris" . 
? ??? ??? ??? ??? luc:include luc:setParam "literals" . 
? ??? ??? ??? ??? luc:moleculeSize luc:setParam "1" .
? ??? ??? ??? ??? luc:includePredicates luc:setParam "http://www.w3.org/2000/01/rdf-schema#label http://www.w3.org/2004/02/skos/core#altLabel" .
? ??? ??? ??? ??? luc:analyzer luc:setParam "my.own.analyzer" .
? ??? ??? ??? ??? luc:sestateIndex luc:createIndex "true" . 
??? ??? ??? }
Could you guide me to possible solution for this?
Best regards,
Marek

asked 03 Apr '13, 12:33

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k133156205
accept rate: 30%


Date: 2013-02-14 11:54:09
From: barry.norton@ontotext.com
Marec, since I didn't hear yet I tried a couple of assumed statements:
PREFIX : <http://www.example.com>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
INSERT DATA {
:i a :C ;
rdfs:label "wordnet" .
}
Then:
PREFIX luc: <http://www.ontotext.com/owlim/lucene#>
INSERT DATA
{
luc:index luc:setParam "uris" .
luc:include luc:setParam "literals" .
luc:moleculeSize luc:setParam "1" .
luc:includePredicates luc:setParam 
"http://www.w3.org/2000/01/rdf-schema#label 
http://www.w3.org/2004/02/skos/core#altLabel" .
#                luc:analyzer luc:setParam "my.own.analyzer" .
}
(Note, I had to remove your analyzer)
Then:
PREFIX luc: <http://www.ontotext.com/owlim/lucene#>
ASK
{
luc:sestateIndex luc:createIndex "true" .
}
Now I get one binding from:
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX luc: <http://www.ontotext.com/owlim/lucene#>
SELECT DISTINCT ?value ?label ?score
FROM NAMED <http://www.ontotext.com/explicit>
{ ?value luc:sestateIndex "word*"^^xsd:string .
?value rdfs:label ?label .
?value luc:score ?score . }
And the same binding from your query:
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX luc: <http://www.ontotext.com/owlim/lucene#>
SELECT DISTINCT ?key ?value ?label ?score FROM NAMED 
<http://www.ontotext.com/explicit> { ?value luc:sestateIndex 
"word*"^^xsd:string . ?value luc:score ?score . ?value rdfs:label ?label 
.  GRAPH <http://www.ontotext.com/explicit> { ?value rdf:type ?key } .  }
In the absence of your instance data I remain, therefore, unable to 
reproduce an issue.
Barry
link

answered 03 Apr '13, 12:33

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k133156205
accept rate: 30%

Date: 2013-02-14 11:10:13
From: barry.norton@ontotext.com
Marek, I'm struggling to understand your query.
You have a clause GRAPH <http://www.ontotext.com/explicit> { ?value 
rdf:type ?key } but if the INSERT represents all of your explicit 
statement there are none with explicit classification (i.e. pred=type).
Are you saying that:
SELECT DISTINCT ?key ?value ?label ?score
FROM NAMED <http://www.ontotext.com/explicit>
{ ?value luc:sestateIndex "word*"^^xsd:string .
?value rdfs:label ?label .
GRAPH <http://www.ontotext.com/explicit> { ?value rdf:type ?key } .  }
Works over:
INSERT DATA
{
luc:index luc:setParam "uris" .
luc:include luc:setParam "literals" .
luc:moleculeSize luc:setParam "1" .
luc:includePredicates luc:setParam 
"http://www.w3.org/2000/01/rdf-schema#label 
http://www.w3.org/2004/02/skos/core#altLabel" .
luc:analyzer luc:setParam "my.own.analyzer" .
luc:sestateIndex luc:createIndex "true" .
}
What, in that case, is bound to ?key ?
Unless I misunderstood, could you tell me which ruleset you used so I 
can try to recreate?
Barry
link

answered 03 Apr '13, 12:33

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k133156205
accept rate: 30%

Date: 2013-02-14 11:16:44
From: marek_surek@yahoo.co.uk
Hi Barry,
the ?key represents explicit rdf:type of element (we use subClassOf inferencing, but I don't want those infered rdf:types for ?key variable). The query itself is bigger, but this is minimal part of it where problem appears. Other rules are not connected to this.
Id: rdfs9
???? a? <rdf:type>? x???????????????????????? [Constraint x != y]
???? x? <rdfs:subClassOf>? y
??? -------------------------------
???? a? <rdf:type>? y
Id: rdfs11
???? x? <rdfs:subClassOf>? y????????????????? [Constraint x != y, x != z, y != z]
???? y? <rdfs:subClassOf>? z
??? -------------------------------
???? x? <rdfs:subClassOf>? z
Thank you for your answer,
Marek
link

answered 03 Apr '13, 12:33

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k133156205
accept rate: 30%

Date: 2013-02-14 11:26:11
From: barry.norton@ontotext.com
But that's what I mean, that's not reproducable - I'm missing some 
instance data.
I assumed OWL-Horst and added only:
PREFIX luc: <http://www.ontotext.com/owlim/lucene#>
INSERT DATA
{
luc:index luc:setParam "uris" .
luc:include luc:setParam "literals" .
luc:moleculeSize luc:setParam "1" .
luc:includePredicates luc:setParam 
"http://www.w3.org/2000/01/rdf-schema#label 
http://www.w3.org/2004/02/skos/core#altLabel" .
luc:analyzer luc:setParam "my.own.analyzer" .
luc:sestateIndex luc:createIndex "true" .
}
And there were no bindings (as expected) for:
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX luc: <http://www.ontotext.com/owlim/lucene#>
SELECT DISTINCT ?key ?value ?label ?score
FROM NAMED <http://www.ontotext.com/explicit>
{ ?value luc:sestateIndex "word*"^^xsd:string .
?value rdfs:label ?label .
GRAPH <http://www.ontotext.com/explicit> { ?value rdf:type ?key } .  }
Just as an observation, along the way: one cannot depend on (since the 
optimiser is free to re-order) your 'setParam's being executed before 
your 'createIndex', so you should really issue two separate sequential 
updates to achieve this indexing.
If you can provide some minimal set of instances with your problem I can 
look further.
Cheers,
Barry
link

answered 03 Apr '13, 12:33

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k133156205
accept rate: 30%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×261
×243
×38

Asked: 03 Apr '13, 12:33

Seen: 1,307 times

Last updated: 21 Jan, 06:24

powered by BitNami OSQA