[Pellet-users] Duplicated results using Pellet with the Jena API
Bruno Antunes
bema at student.dei.uc.pt
Tue Oct 30 12:51:49 UTC 2007
Hi,
After printing the statements I got this result:
[ont.owl#concept-2056, ont.owl#concept-1740, ont.owl#hyponymOf]
[ont.owl#concept-5598, ont.owl#concept-1740, ont.owl#hyponymOf]
[ont.owl#concept-16236, ont.owl#concept-1740, ont.owl#hyponymOf]
[ont.owl#concept-16236, ont.owl#hyponymOf, ont.owl#concept-1740]
[ont.owl#concept-5598, ont.owl#hyponymOf, ont.owl#concept-1740]
[ont.owl#concept-2056, ont.owl#hyponymOf, ont.owl#concept-1740]
I don't understand why I'm getting the same statements twice, but with the
predicate switched with the object.
Regards,
Bruno
-----Original Message-----
From: Evren Sirin [mailto:evren at clarkparsia.com]
Sent: terça-feira, 30 de Outubro de 2007 0:26
To: Bruno Antunes
Cc: 'Ibach, Brandon L'; pellet-users at lists.owldl.com
Subject: Re: [Pellet-users] Duplicated results using Pellet with the Jena
API
OntModel.listStatements is guaranteed not to return duplicate results.
The only possibility for duplicate results in the code fragment you
provide can be due to the URI problems. If either
jOntModel.getIndividual(DO_BASE_NAMESPACE + cptID)
or
jOntModel.getProperty(DO_PROPERTY_HYPONYMOF_URI)
returns null there might be more than one possibility for the object (or
predicate) for the same subject that would explain why you see the same
resource more than once in the output. You can check if any of these
other parameters are null to pinpoint the problem. Also you can print
the statements themselves (rather than only subjects) will make sure
that there are no duplicates returned.
Cheers,
Evren
On 10/29/07 6:41 PM, Bruno Antunes wrote:
> Ok. Thanks for answering quickly. I'll do some tests according to what
> you've pointed out and I'll keep you posted.
>
> Best regards,
> Bruno
>
> -----Original Message-----
> From: Ibach, Brandon L [mailto:brandon.l.ibach at lmco.com]
> Sent: segunda-feira, 29 de Outubro de 2007 22:32
> To: Bruno Antunes; pellet-users at lists.owldl.com
> Subject: {Spam?} RE: RE: [Pellet-users] Duplicated results using Pellet
with
> the Jena API
>
> Bruno,
> Unfortunately, this doesn't really give me much more to go on.
> >From your description and assuming, for the moment, that this is not a
> bug in Pellet, I see two possible sources of the problem. The first is
> the use of the database for storage. Not that I don't trust the
> interface to the database, but if I were running into this problem, I'd
> want to see if I could get the same results if the database were not in
> the picture.
>
> The second possibility, which I think is more likely, is that
> you're getting these duplicates because of some OWL inference that you
> did not expect. The fact that you didn't see this with the Jena OWL
> reasoner may well be due to the fact that Jena's OWL reasoner is not
> complete, while Pellet is, so the inference that is causing the problem
> may be one that the Jena reasoner does not fully implement.
>
> For both of these issues, my approach would be to create a
> fairly small dataset and a standalone Java class that I can compile and
> run against the dataset to demonstrate the problem. As I said, the mere
> exercise of producing these two items may very well help you to find the
> problem yourself, but if not, providing them to the mailing list will
> give myself and/or others everything we would need to observe the
> problem and begin to diagnose the cause.
>
> And don't worry about avoiding complexity... if these sort of
> problems could be solved without a little complexity, the stuff wouldn't
> be nearly as much fun. ;)
>
> -Brandon :)
>
>
>
>> -----Original Message-----
>> From: Bruno Antunes [mailto:bema at student.dei.uc.pt]
>> Sent: Monday, October 29, 2007 5:59 PM
>> To: Ibach, Brandon L; pellet-users at lists.owldl.com
>> Subject: RE: RE: [Pellet-users] Duplicated results using
>> Pellet with the Jena API
>>
>> Ok. I'll try to explain as far as I can without getting complex... :)
>>
>> The ontology I'm dealing with stores data similar to WordNet.
>> I have a class
>> called "Concept" and a property "hyponymOf" between instances
>> of this class.
>> To find all the instances which are hyponyms of a specific
>> instance I use
>> something like this:
>>
>> OntClass jOntClassConcept =
>> jOntModel.getOntClass(DO_CLASS_CONCEPT_URI);
>> Individual jIndividualConcept =
>> jOntModel.getIndividual(DO_BASE_NAMESPACE +
>> cptID);
>> StmtIterator jStmtIterator = jOntModel.listStatements(null,
>> jOntModel.getProperty(DO_PROPERTY_HYPONYMOF_URI), jIndividualConcept);
>> while (jStmtIterator.hasNext()) {
>> Individual jIndividual =
>> (Individual)jStmtIterator.nextStatement().getSubject().as(Indi
>> vidual.class);
>> hyponymOfList.add(jIndividual);
>> }
>>
>> The results I get in the "hyponymOfList" are all duplicated.
>> I've made some
>> queries in the database storage and found no duplicated
>> statements. This
>> code worked well with the OWL reasoner of the Jena API. So I
>> suppose it is
>> something related with the Pellet inference. I hope it became
>> clearer... :)
>>
>> Thanks,
>> Bruno
>>
>> -----Original Message-----
>> From: Ibach, Brandon L [mailto:brandon.l.ibach at lmco.com]
>> Sent: segunda-feira, 29 de Outubro de 2007 21:40
>> To: Bruno Antunes; pellet-users at lists.owldl.com
>> Subject: {Spam?} RE: [Pellet-users] Duplicated results using
>> Pellet with the
>> Jena API
>>
>> Bruno,
>> There is likely a reasonable explanation for why you're getting
>> these duplicates, but without significantly more detail, I'd guess it
>> would be impossible for anyone to tell you what the reason
>> is. Can you
>> provide a minimal, yet complete, ontology and code sample that
>> demonstrate the problem? Sometimes just the process of creating these
>> can help you to spot the problem.
>>
>> -Brandon :)
>>
>>
>>
>>> -----Original Message-----
>>> From: pellet-users-bounces at lists.owldl.com
>>> [mailto:pellet-users-bounces at lists.owldl.com] On Behalf Of
>>> Bruno Antunes
>>> Sent: Monday, October 29, 2007 5:30 PM
>>> To: pellet-users at lists.owldl.com
>>> Subject: [Pellet-users] Duplicated results using Pellet with
>>> the Jena API
>>>
>>> Hi,
>>>
>>> I'm using Pellet with the Jena API and I'm getting a
>>>
>> strange, or not,
>>
>>> behavior when I use the "listStatements(Resource s, Property
>>> p, RDFNode o)"
>>> method of the "Model" interface.
>>>
>>> When I call this method to find the resources to which
>>> applies a specific
>>> property with a specific object, I'm getting duplicated results.
>>>
>>> For instance, if I use something like this:
>>>
>>> myModel.listStatements(null, myProperty, myInstance);
>>>
>>> I get the results just like this:
>>>
>>> Resource1
>>> Resource1
>>> Resource2
>>> Resource2
>>> ...
>>>
>>> Hope someone could help me with this. I'm using Jena v2.5.2
>>>
>> and Pellet
>>
>>> v1.5.0 with persistent storage in a MySQL database.
>>>
>>> Thanks in advance, best regards,
>>> Bruno Antunes
>>>
>>> _______________________________________________
>>> Pellet-users mailing list
>>> Pellet-users at lists.owldl.com
>>> http://lists.owldl.com/mailman/listinfo/pellet-users
>>> _______________________________________________
>>>
>>> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
>>>
>>>
>>
>
> _______________________________________________
> Pellet-users mailing list
> Pellet-users at lists.owldl.com
> http://lists.owldl.com/mailman/listinfo/pellet-users
> _______________________________________________
>
> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
>
More information about the Pellet-users
mailing list