Dear Leandro,
i have found out the reason for this malfunction and it is both a
feature and a bug (complex world).
Let me clarify how the semantic queries work when you require documents
as result.
The first thing happening after you execute the query is that all
entities matching the criteria are being retrieved.
This is the place of the short-circuit. Here we have applied a default
limit over the number of entities which are to be returned in order not
to over-flood result set. Since the modelling of location instances in
the knowledge base is extensive, simply - the adequate entities have not
succeeded to be among the result set. From there on the documents are
not appearing in the result set.
I agree it is a stupid behaviour. We have worked in the direction to
improve this and i expected it not to have these limitations. What we've
done is : we have introduced methods for getting entities or documents
with an additional parameter limiting the expected result sets. However,
this means that the methods without this additional parameter should
return an unlimited result set, obviously - not the case now.
I guess Ilian will check it a bit further on Monday.
The way to make it work is to narrow down the set of entities matching
your query. What i've done was:
adding a name restriction over X
seq.addNameRestriction("X",seq.COMPARE_STYLE_CONTAINS,"Earth");
which returns the indexed document(s).
After these clarifications, we will be happy to hear what you think will
be the best way these methods should function.
Thanks for the source code and the log, it really made it very easy for
me to reproduce it
have a nice weekend
borislav
Leandro Loss wrote:
>
> Dear KIM Team,
> Dear All.
>
> We are working in the API and we have detected a possible bug, so that
> we would like to know your opinion about it.
>
> In order to demonstrate the bug behavior, we implemented a sample
> program (BugTest.java).
>
> It was implemented a simple application for some tasks:
> 1 - To create a document (the same document in KIM web page - examples).
> 2 - To annotate this document.
> 3 - To store and index the document.
> 4 - Finally, to search it through a very simple semantic query.
> 5 - To show the content and semantic annotation that is found.
>
> This application receives as an input a class name, for example,
> Organization, Person, Country and so on.
> It seems to work fine when searching for entities like Planet,
> Country, Continent and Organization. However it is not able to find
> entities related to Person or Location.
>
> Interestingly, these entities appear as annotated on the document when
> it is searched for the first ones (Planet, Coutry, etc).
>
> It is important to emphasize that this "problem" also occurs using the
> KIM Document and Store Population Tool (used to annotate) and Web UI
> (used to search for it).
>
> Please, find attached the program source code (BugTest.java) and its
> output (log.txt).
>
>
> Finally, we have some questions:
>
> Is it the expected behavior?
> Why some entities are found while others are not?
> If these entities are shown as annotated why they cannot be found?
>
> Kind Regards,
>
> Leandro and Rui.
>
>
>
> --
> ------------------------------------------------------------------------
> Leandro Loss, M. Eng.
> UFSC - Universidade Federal de Santa Catarina
> DAS - Departamento de Automação e Sistemas
> GSIGMA - Grupo de Sistemas Inteligentes de Manufatura
> Cx. Postal 476 - Florianópolis - SC CEP 88040-900
> Tel.: (++48) 3331 9742
> E-mail: [EMAIL PROTECTED]
> Homepage: http://www.gsigma.ufsc.br/~loss
> <http://www.gsigma.ufsc.br/%7Eloss>
>
>
> ------------------------------------------------------------------------
>
> KIM Server connected.
> Number of documents in store: 0
> LastPersistenceID=9
> New document created: "Blair and Bush ? are they doing the right thing for
> Iraq, America, Europe, the Earth... for civilization... or just guided by
> their blinded eyes are in favor of the big coporations:enter here new
> unrecognized corporations with a clue suffix:MicroZoftRR Inc."
> Number of documents in store: 1
>
> Type a class name: Organization
> Semantic query for documents containing:
> http://proton.semanticweb.org/2005/04/protont#Organization
> Number of resulting documents: 1
>
> [ DOCUMENT CONTENT BEGIN ]
> Blair and Bush ? are they doing the right thing for Iraq, America, Europe,
> the Earth... for civilization... or just guided by their blinded eyes are in
> favor of the big coporations:enter here new unrecognized corporations with a
> clue suffix:MicroZoftRR Inc.
> [ DOCUMENT CONTENT END ]
>
> [ Document's Annotations (begin) ]
> KIMAnnotationImpl: id=146; type=Organization; features={orgType=null,
> inst=http://www.ontotext.com/kim/2005/04/wkb#Organization.MicroZoftRR%20_R.49473,
> rule1=OrgXEnding, rule2=OrgFinal, originalName=MicroZoftRR Inc.,
> class=http://proton.semanticweb.org/2005/04/protont#Organization}; start=241;
> end=257
>
> KIMAnnotationImpl: id=145; type=Location;
> features={inst=http://www.ontotext.com/kim/2005/04/wkb#Planet_T.2,
> rule1=GazLocation, rule2=LocFinal, originalName=Earth,
> class=http://proton.semanticweb.org/2005/04/protonu#Planet}; start=79; end=84
>
> KIMAnnotationImpl: id=140; type=Person; features={gender=null,
> inst=http://www.ontotext.com/kim/2005/04/wkb#Person_T.96, rule1=GazPerson,
> rule=PersonFinal, originalName=Blair,
> class=http://proton.semanticweb.org/2005/04/protont#Person}; start=0; end=5
>
> KIMAnnotationImpl: id=143; type=Location;
> features={inst=http://www.ontotext.com/kim/2005/04/wkb#Country_T.4,
> rule1=GazLocation, rule2=LocFinal, originalName=America,
> class=http://proton.semanticweb.org/2005/04/protonu#Country}; start=58; end=65
>
> KIMAnnotationImpl: id=144; type=Location;
> features={inst=http://www.ontotext.com/kim/2005/04/wkb#Continent_T.4,
> rule1=GazLocation, rule2=LocFinal, originalName=Europe,
> class=http://proton.semanticweb.org/2005/04/protonu#Continent}; start=67;
> end=73
>
> KIMAnnotationImpl: id=142; type=Location;
> features={inst=http://www.ontotext.com/kim/2005/04/wkb#Country_T.IZ,
> rule1=GazLocation, rule2=LocFinal, originalName=Iraq,
> class=http://proton.semanticweb.org/2005/04/protonu#Country}; start=52; end=56
>
> KIMAnnotationImpl: id=141; type=Person; features={gender=null,
> inst=http://www.ontotext.com/kim/2005/04/wkb#Person_T.80, rule1=GazPerson,
> rule=PersonFinal, originalName=Bush,
> class=http://proton.semanticweb.org/2005/04/protont#Person}; start=10; end=14
>
> [ Document's Annotations (end) ]
> Document deleted.
> Number of documents in store: 0
> LastPersistenceID=10
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> NOTE: Please REPLY TO ALL to ensure that your reply reaches all members of
> this mailing list.
>
> KIM-discussion mailing list
> [email protected]
> http://ontotext.com/mailman/listinfo/kim-discussion_ontotext.com
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.405 / Virus Database: 268.11.7/435 - Release Date: 8/31/2006
>
_______________________________________________
NOTE: Please REPLY TO ALL to ensure that your reply reaches all members of this
mailing list.
KIM-discussion mailing list
[email protected]
http://ontotext.com/mailman/listinfo/kim-discussion_ontotext.com