I use the workaround Ian mentionned.
It works fine for OntTools.namedHierarchyRoots().
But another question arises now:
I want to list properties whose domain includes Album106591815.
Here is roughly how I want to do that:
OntClass album106591815 =
theTopMostModelWithTheOwlMemSpec.getOntClass("http://dbpedia.org/class/yago/Album106591815");
List result = album106591815.listDeclaredProperties(false).toList();
This code returns an empty result.
Is it the expected behaviour?
When calling album106591815.listAllProperties(), through my debugger,
the returned list does contain
the property "http://dbpedia.org/property/after".
But when calling album106591815.listDeclaredProperties(false), then
the property "http://dbpedia.org/property/after" is absent.
Is it a feature?
In that case, what is the best way to list properties whose domain
includes Album106591815 ?
Thanks for your help.
On Thu, Jul 19, 2012 at 2:06 PM, Olivier Rossel
<[email protected]> wrote:
> On Thu, Jul 19, 2012 at 1:42 PM, Ian Dickinson <[email protected]> wrote:
>> On 19/07/12 12:19, Dave Reynolds wrote:
>>
>> In theory, you should be able to use OntTools.namedHierarchyRoots() to list
>> the non-anonymous root classes of a class hierarchy. However, Olivier's
>> example, using a reasoner attached to the model has revealed a bug in the
>> namedHierarchyRoots code. I'll log an issue to fix that bug, but in the
>> meantime you can work around it as follows:
>>
>> https://gist.github.com/3143188
>>
>> Ian
>>
>
> As usual, Jena's support is beyond expectations !
> Kudos to all of you.