However, the same routine works for my own ontology. I could retrieve the top level nodes and satisfy my validation criteria.
OntClass tmpcls = cls; while(!suprcls.equalsIgnoreCase("Axonal_terminal")&&!suprcls.equalsIgnoreCase("Interneuron")&&!suprcls.equalsIgnoreCase("Principal_cell")&&!suprcls.equalsIgnoreCase("Neuron")){
tmpcls=tmpcls.getSuperClass();
out.println(tmpcls);
suprcls=tmpcls.getLocalName();
out.println(suprcls);
}
so this is a clear example of problems for trying to create a integrative approach. Ironically, the gist of ontologies is to share the domains. I want to achieve this by hook or crook
On a different note. On my other post, the stupidity that I am talking about is, the way i am trying to map with the ontology terms with a string matching like below. this obviously is not going to be a solution. there are definitely more valid terms than these four.
while(!suprcls.equalsIgnoreCase("Axonal_terminal")&&!suprcls.equalsIgnoreCase("Interneuron")&&!suprcls.equalsIgnoreCase("Principal_cell")&&!suprcls.equalsIgnoreCase("Neuron")){
-Thanks
Sri
On Monday 20 August 2007 22:38, sridevi polavaram wrote:
> On 8/17/07, Dave Reynolds <der@...> wrote:
> >
> > sridevi polavaram wrote:
> > > Thanks Dave, for now, the model.getNsPrefixURI("")
> > > is working for me. I guess the models that don't have a base URI are not
> >
> > > upto the standards? what say?
> >
> > I wouldn't go that far. Though it is true that most models will define
> > both an xml:base and a default namespace and relate the two in an
> > obvious way.
> >
> > > I have another question, How can I extract the root node (root class) of
> >
> > > the ontology hierarchy?
> > > is there a direct method that i can use.
> >
> > The builtin method is listHierarchyRootClasses().
>
> For some reason, the OntModel is returning values like this:
>
> 3ac1780f:1148518ebff:-7fd4
Those are blank nodes - the gibberish is the blank node's internal ID.
> for the listHierarchyRootClasses() and when I tried to use getLocalName()
> method, it is giving a NullPointerException at Runtime.
They have no local name. (Insert DON'T USE getLocalName RANT here.)
> How can I skip these kind of class references?
Ignore the classes that are isAnon. (Anon -- anonymous -- blank.)
--
Chris "danger, http://lost.in.space/characters/Will#Robinson !" Dollin
Hewlett-Packard Limited registered no:
registered office: Cain Road, Bracknell, Berks RG12 1HN 690597 England