On Thursday, April 11, 2013 05:51:30 AM aarthi wrote:
> i'm comparing two classes..  if its a resource, asResource() will return
> the resource else it will through the exception..     

Yes, that's what it's for, but you /don't need to use/ asResource or
asLiteral to do an equality test.

> for this
> asResource() i found an error that
> " cannot find symbol
>   symbol:   method asResource()
> location: interface com.hp.hpl.jena.rdf.model.RDFNode"...       so what to
> do?

(fx:checking) RDFNode definitely has the asResource() method.

What version of Jena are you using? Can you construct the
smallest possible example to show us the error in detail?

Are you using an IDE for your Java development? If not, I strongly
suggest you do. (It would be best if you could find another user
to introduce you to it, though.) An IDE such as Eclipse offers useful
features like "import the right class(es) to make this reference
work" and "suggest a fix for this compilation problem". 

Chris

> 
> On Mon, Apr 8, 2013 at 3:34 AM, Chris Dollin
> <[email protected]>wrote:
> 
> > On Monday, April 08, 2013 03:06:39 AM aarthi wrote:
> > > hi.......   i'm   comparing two owl files using jena. in that i use this
> > > code for comparision
> > >
> > >
> > >
> > > private boolean areEqual(RDFNode thisOne, RDFNode thatOne){
> > >         if(thisOne.isResource() && thatOne.isResource())
> > >             return areEqual(thisOne.asResource(), thatOne.asResource());
> > >         if(thisOne.isLiteral() &&  thatOne.isLiteral())
> > >             return areEqual(thisOne.asLiteral(), thatOne.asLiteral());
> > >
> > >         return false;
> > >     }
> > >
> > > but there is an error in asLiteral() and asResource(). I have imported
> > > hp.hpl.jena.rdf.graph.RDFNode     but still i can't resolve the error.
> > > anyone help me
> >
> > Why not just use .equals()?
> >
> > (You don't tell us what the error is or what RDFNode's you're comparing
> >  or what the calling code looks like or whether you have overloads for
> >  areEqual(), so it's a bit tricky to work out what you've done wrong.)
> >
> > Chris
> >
> > --
> > "I don't want to know what the Structuralists think! I want     /Archer's
> > Goon/
> >  to know what YOU think!"
> >
> > Epimorphics Ltd, http://www.epimorphics.com
> > Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20
> > 6PT
> > Epimorphics Ltd. is a limited company registered in England (number
> > 7016688)
> >
> >
-- 
"You're down as expendable. You don't get a weapon."    /Dark Lord of Derkholm/

Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)

Reply via email to