[protege-owl] from protege-frame to protege-owl !

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[protege-owl] from protege-frame to protege-owl !

philippe-free
Hi all,

i used to to print a particular class and it's instances, from a jsp
with

        KnowledgeBase kb = project.getKnowledgeBase();
        Cls cls = kb.getCls(ClassToWork)
        Iterator i = cls.getInstances().iterator();
...
and then "instance.getName()" in a while loop


How can i do the same with owl model ?


I can create a model and query it

OWLModel model = ProtegeOWL.createJenaOWLModelFromURI(uri);
Collection classes = model.getUserDefinedOWLNamedClasses();
and the print subclasses ans instances

But how to get a particular class from the model ?

Thanks in advance

philippe

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: from protege-frame to protege-owl !

Tania Tudorache
Philippe,

you can get a class with a certain name with the following call:        

        OWLNamedClass cls = owlModel.getOWLNamedClass("Class_1");

You find the OWL programmers guide here:
http://protege.stanford.edu/plugins/owl/api/guide.html
and the OWL Javadoc:
http://protege.stanford.edu/download/prerelease_javadoc_owl/

Tania

philippe-free wrote:

>Hi all,
>
>i used to to print a particular class and it's instances, from a jsp
>with
>
>        KnowledgeBase kb = project.getKnowledgeBase();
> Cls cls = kb.getCls(ClassToWork)
>        Iterator i = cls.getInstances().iterator();
>...
>and then "instance.getName()" in a while loop
>
>
>How can i do the same with owl model ?
>
>
>I can create a model and query it
>
>OWLModel model = ProtegeOWL.createJenaOWLModelFromURI(uri);
>Collection classes = model.getUserDefinedOWLNamedClasses();
>and the print subclasses ans instances
>
>But how to get a particular class from the model ?
>
>Thanks in advance
>
>philippe
>
>-------------------------------------------------------------------------
>To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
>
>  
>

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: from protege-frame to protege-owl !

philippe-free
thanks Tania

Le dimanche 04 juin 2006 à 11:32 -0700, Tania Tudorache a écrit :

> Philippe,
>
> you can get a class with a certain name with the following call:        
>
>         OWLNamedClass cls = owlModel.getOWLNamedClass("Class_1");
>
> You find the OWL programmers guide here:
> http://protege.stanford.edu/plugins/owl/api/guide.html
> and the OWL Javadoc:
> http://protege.stanford.edu/download/prerelease_javadoc_owl/
>
> Tania
>
> philippe-free wrote:
>
> >Hi all,
> >
> >i used to to print a particular class and it's instances, from a jsp
> >with
> >
> >        KnowledgeBase kb = project.getKnowledgeBase();
> > Cls cls = kb.getCls(ClassToWork)
> >        Iterator i = cls.getInstances().iterator();
> >...
> >and then "instance.getName()" in a while loop
> >
> >
> >How can i do the same with owl model ?
> >
> >
> >I can create a model and query it
> >
> >OWLModel model = ProtegeOWL.createJenaOWLModelFromURI(uri);
> >Collection classes = model.getUserDefinedOWLNamedClasses();
> >and the print subclasses ans instances
> >
> >But how to get a particular class from the model ?
> >
> >Thanks in advance
> >
> >philippe
> >
> >-------------------------------------------------------------------------
> >To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
> >
> >
> >  
> >
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
>

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html