[Kim-discussion] Issue with getEntites method in CoreDBApi
alistair.duke at bt.com
alistair.duke at bt.com
Thu Aug 6 08:27:04 EDT 2009
Hi DanKo,
Thanks, but I'm not sure either of those will work.
The first one will still leave me with all the entities from the
documents after step 3. I just want the entities of a particular type
e.g. organizations so I can show a list of the most popular entities in
the same way that the default CORE interface does. I had thought about
using an intersect in the following way:
1. Call getEntities(CoreDbQuery
<file://../com/ontotext/kim/client/coredb/query/CoreDbQuery.html>
query) and collect the entities as a set where the query specifies the
entitles should be e.g. protont#Organization
2. Call getEntities(Set
<http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html> docIds)
and collect the entities as a second set
3. Intersect the two sets to get the necessary entities of the required
class.
However, it seems the getEntities call is limited to returning 125
entities. Even calling setMaxResultLength on the query with a larger
number does not allow you to increase in beyond 125. As such I don't get
all the entities I need to carry out the required intersection.
With the second one, I want to refine queries using numerical data. Each
document has a money value associated with it and I want to allow the
user to define a value range to refine the document set. I currently do
this via an SQL query. Can I do this via a KIMQuery? I've had a quick
look at the java doc and can't see a way although it looks like you can
do something using SeRQL:
http://www.openrdf.org/doc/sesame/users/ch06.html#d0e1424
Actually if KIM does support this it would make things somewhat easier
as I wouldn't need to hold the documents in two separate places i.e. in
KIM and in a separate database.
Regards,
Alistair
________________________________
From: DanKo [mailto:danko at sirma.bg]
Sent: 06 August 2009 09:25
To: Duke,AK,Alistair,DER3 R
Cc: kim-discussion at ontotext.com
Subject: Re: [Kim-discussion] Issue with getEntites method in
CoreDBApi
Hi Alistar,
I consulted with my coleagues and came to the following
work-around solution:
1) Call getDocuments(CoreDbQuery
<file://\\..\com\ontotext\kim\client\coredb\query\CoreDbQuery.html>
query) and collect the document IDs as a set.
2) Then intersect you set of DocIDs with the retrieved one.
3) Then call getEntities(Set
<http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html> docIds)
with the resulting set of documents.
Other solution - if applicable - could be to add your metadata
as additional KIMDocument features. This will allow to get the whole
result in one combined search.
Greetings!
DanKo
----- Original Message -----
From: alistair.duke at bt.com
To: danko at sirma.bg
Cc: kim-discussion at ontotext.com
Sent: Wednesday, August 05, 2009 6:09 PM
Subject: RE: [Kim-discussion] Issue with getEntites
method in CoreDBApi
Hi Danko,
Thanks for the speedy reply.
The scenario is as follows. I'm running a query which
specifies constraints based on structured metadata associated with the
documents (this metadata is held outside of KIM in a simple database
table). This results in a set of documents which satisfy the query.
Since I associated the KIM docIds with these documents at index time, I
want to send the resulting KIM docids to KIM to give me the top occuring
organisations, people, etc (rather like the default CORE interface) in
that result set. The getEntites query seemed like an ideal way to
achieve this in one step.
I suppose an alternative would be to use
ResultSetIterator
<file://../com/ontotext/kim/client/coredb/ResultSetIterator.html>
getEntities(Set
<http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html> docIds)
to get all entities and then build some sort of filter
to sort the results into organisations, people, etc but this seems
rather clunky in comparison. Is there a better way?
Thanks,
Alistair
Alistair Duke
Next Generation Web Research
Centre for Information & Security Systems Research
BT Innovate & Design
___________________________
Office: +44(0) 1473 608192
Mobile: +44(0) 7730 426257
Fax : +44(0) 1473 606755
Email: alistair.duke at bt.com
This email contains BT information, which may be
privileged or confidential.
It's meant only for the individual(s) or entity named
above. If you're not the intended
recipient, note that disclosing, copying, distributing
or using this information
is prohibited. If you've received this email in error,
please let me know immediately
on the email address above. Thank you.
We monitor our email system, and may record your emails.
British Telecommunications plc
Registered office: 81 Newgate Street London EC1A 7AJ
Registered in England no: 1800000
________________________________
From: DanKo [mailto:danko at sirma.bg]
Sent: 05 August 2009 16:00
To: Duke,AK,Alistair,DER3 R
Cc: kim-discussion at ontotext.com
Subject: Re: [Kim-discussion] Issue with
getEntites method in CoreDBApi
Hi Alistar,
It happens so that from some time we do not
support the:
getEntities(Set
<http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html> docIds,
CoreDbQuery
<file://\\..\com\ontotext\kim\client\coredb\query\CoreDbQuery.html>
query)
version of the method. It just redirects the
execution to:
getEntities(CoreDbQuery
<file://\\..\com\ontotext\kim\client\coredb\query\CoreDbQuery.html>
query)
not to break old implementations.
It was our oversight that we didn't remarked it
in the documentation.
But you can share the querying scenario you try
to implements and we will help with it.
Greetings,
DanKo
----- Original Message -----
From: alistair.duke at bt.com
To: kim-discussion at ontotext.com
Sent: Wednesday, August 05, 2009 2:55 PM
Subject: [Kim-discussion] Issue with
getEntites method in CoreDBApi
Hi again,
I've found some strange behaviour when
using the getEntities method of the CoreDbApi. If I use the
ResultSetIterator
<file://../../../../../com/ontotext/kim/client/coredb/ResultSetIterator.
html> getEntities(Set
<http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html> docIds)
form it works fine i.e. I just get the
entities in the documents defined in the set. However, if I use the
ResultSetIterator
<file://../../../../../com/ontotext/kim/client/coredb/ResultSetIterator.
html> getEntities(Set
<http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html> docIds,
CoreDbQuery
<file://../../../../../com/ontotext/kim/client/coredb/query/CoreDbQuery.
html> query)
form, it only seems to look at the query
restrictions and ignores the docid restrictions. This means I get all
entites regardless of whether they are in the specified documents or
not.
I'm using KIM 2.5. Is this something
you've come across?
Thanks,
Alistair
Alistair Duke
Next Generation Web Research
Centre for Information & Security
Systems Research
BT Innovate & Design
___________________________
Office: +44(0) 1473 608192
Mobile: +44(0) 7730 426257
Fax : +44(0) 1473 606755
Email: alistair.duke at bt.com
This email contains BT information,
which may be privileged or confidential.
It's meant only for the individual(s) or
entity named above. If you're not the intended
recipient, note that disclosing,
copying, distributing or using this information
is prohibited. If you've received this
email in error, please let me know immediately
on the email address above. Thank you.
We monitor our email system, and may
record your emails.
British Telecommunications plc
Registered office: 81 Newgate Street
London EC1A 7AJ
Registered in England no: 1800000
________________________________
_______________________________________________
Kim-discussion mailing list
Kim-discussion at ontotext.com
http://ontotext.com/mailman/listinfo/kim-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ontotext.com/pipermail/kim-discussion/attachments/20090806/9faf1115/attachment-0002.html>
More information about the Kim-discussion
mailing list