Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Fw: updating one 'OWLModel' object from another

Timothy Redmond tredmond at stanford.edu
Thu Feb 12 09:38:55 PST 2009


I am not sure about the behavior of the deepCopy (haven't tested it)  
but the setName call there is questionable anyway (and it doesn't  
exist in the latest version).  Try it without the setName which should  
not be needed anyway.  If you really need to do something like this  
you can use

     deepCopy = deepCopy.rename(...)

-Timothy


On Feb 9, 2009, at 5:38 PM, Vance wrote:

> tizian,
>
> Thanks for responding, but the 'setName' method call isn't working  
> for me. I'm using Eclipse to edit my code, and it's complaining that
>
> The method setName(String) is undefined for the type OWLIndividual
>
> The version of the 'OWLIndividual' class I'm using is the one found  
> within this package:
>
> edu.stanford.smi.protegex.owl.model
>
>
> --- On Mon, 2/9/09, tiziana <tiziana.sel at libero.it> wrote:
>
> From: tiziana <tiziana.sel at libero.it>
> Subject: Re: [protege-owl] Fw: updating one 'OWLModel' object from  
> another
> To: protege-owl at lists.stanford.edu
> Date: Monday, February 9, 2009, 3:48 AM
>
>
> I have update my owlModel (owlNewModel) with the instances of  
> another model
> (owlOldMOdel) with a copy of the instances using this code...I hope  
> it helps
> you.
>
>     Collection<OWLIndividual> listIndividuals=
> owlOldMOdel.getOWLIndividuals();
>          Iterator<OWLIndividual> individualsIterator=
> listIndividuals.iterator();
>              while(individualsIterator.hasNext()){
>                  OWLIndividual temp=individualsIterator.next();
>              OWLIndividual deepCopy = (OWLIndividual)  
> temp.copy(owlNewModel,
> null,false);
>             deepCopy.setName(temp.getBrowserText());
>             }
>                    Jena.dumpRDF(owlNewModel.getOntModel(), file);
>
>
>
> Vance-15 wrote:
> >
> > Has the 'addInstance' method not been implemented yet? Looks like  
> it:
> >
> > http://protege.stanford.edu/doc/pdk/api/edu/stanford/smi/protege/model/DefaultKnowledgeBase.html#addInstance(edu.stanford.smi.protege.model.Instance,%20java.lang.String,%20edu.stanford.smi.protege.model.Cls,%20boolean)
> >
> >
> > --- On Sat, 2/7/09, Vance <aroc725 at yahoo.com> wrote:
> >
> > From: Vance <aroc725 at yahoo.com>
> > Subject: updating one 'OWLModel' object from another
> > To: protege-owl at lists.stanford.edu
> > Date: Saturday, February 7, 2009, 8:06 PM
> >
> > I'm trying to update one 'OWLModel' object with all the instances
> > belonging to another 'OWLModel' object, and then save the updated
> > 'OWLModel' object to a new file, using the following code:
> >
> >             Collection instances =
> > instanceDataOWLModel.getOWLIndividuals(true);
> >             Iterator instancesIter = instances.iterator();
> >             while (instancesIter.hasNext()) {
> >                 DefaultOWLIndividual currentInstance =
> > (DefaultOWLIndividual)instancesIter.next();
> >                 String instanceName =  
> currentInstance.getBrowserText();
> >
> >              Cls directType = currentInstance.getDirectType();
> >                 String directTypeName = directType.getBrowserText();
> >                     owlModel.addInstance(currentInstance,  
> instanceName,
> > directType, true);
> >                 }
> >             }
> > .....
> >             owlModel.save(new File(newFileName).toURI(),
> > FileUtils.langXMLAbbrev, errors);
> >
> > However, the new OWL file doesn't have the instance data. Any  
> ideas as to
> > why this is happening?
> >
> > _______________________________________________
> > protege-owl mailing list
> > protege-owl at lists.stanford.edu
> > https://mailman.stanford.edu/mailman/listinfo/protege-owl
> >
> > Instructions for unsubscribing:
> > http://protege.stanford.edu/doc/faq.html#01a.03
> >
> >
>
> -- 
> View this message in context: http://www.nabble.com/Fw%3A-updating-one-%27OWLModel%27-object-from-another-tp21902961p21909008.html
> Sent from the Protege - OWL mailing list archive at Nabble.com.
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03




More information about the protege-owl mailing list