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] "Merging" ontologies via ProtegeOWL API

Ralf Weinand weinanr at cs.tu-berlin.de
Mon Jan 7 06:17:17 PST 2008


Hi Ely,

you can go through all ontologies A. B, C .... via the API
and copy them into a new model, then save the new model.
here is a code snippet that might help:

	    Collection<RDFIndividual> individuals =
fromOwlModel.getRDFIndividuals(true);
	
	    for (Iterator<RDFIndividual> it = individuals.iterator(); it.hasNext();)
	    {
	        RDFIndividual individual = it.next();
	
	        RDFIndividual deepCopy = (RDFIndividual)
individual.deepCopy(toOwlModel, null);
	    }

...
		
	Collection clses = toOwlModel.getUserDefinedOWLNamedClasses();
	    JenaCreator jenaCreator = new JenaCreator(toOwlModel, false,
true, clses, null);
	    OntModel ontModel = jenaCreator.createOntModel(spec);
	
	    JenaOWLModel.save(new File(new URI(toOwlModel)), ontModel,
FileUtils.langXMLAbbrev, resultingOntURI);


You can find more information about this topic if you search in the
forum archive for "deepCopy" and "JenaCreator".

Good luck!

Ralf



On Jan 7, 2008 1:19 PM, Ely Edison Matos <ely.matos at ufjf.edu.br> wrote:
>
>
> Hello,
> Thanks, Bill. But I need to do the "merge" programmatically and then save
> the "merged" ontology with all individuals, without to use the Protege GUI.
> Is it possible?
>
> Thanks,
> Ely
>
>
>
> ----- Original Message -----
> From: Bill Dickinson
> To: Ely Edison Matos ; User support for the Protege-OWL editor
> Sent: Sunday, January 06, 2008 3:35 AM
> Subject: Re: [protege-owl] "Merging" ontologies via ProtegeOWL API
>
>
> HI Ely,
>
> My knee-jerk response would be to load the base ontology and then import the
> others.  Then merge whatever needs merging from with Protege.  Of course
> this is impractical if any one of the ontologies is huge.
>
> Bill
>
> ----- Original Message -----
> From: Ely Edison Matos
> To: protege-owl at lists.stanford.edu
> Sent: Saturday, January 05, 2008 11:21 PM
> Subject: [protege-owl] "Merging" ontologies via ProtegeOWL API
>
>
> Hello,
> I have a "base" ontology in file base.owl, with classes and definitions.
> I have other files (A.owl, B.owl, C.owl,...) with individuals from base
> ontology. I want create a new file (e.g. new.owl) that "merges" the
> individuals from A, B, C. How can I do this (programatically, via API)?
>
> Thanks,
> Ely
>
>
>  ________________________________
>
>
> _______________________________________________
> 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