Copying class definition from one ontology into another

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

Copying class definition from one ontology into another

Lalit Patil
Suppose I have to work with two ontologies, A and B. I need to copy a
class from A to B along with its definition.

As an example, consider the following ontology.

Ontology
(
Class(a:Female partial)
Class(a:Male partial)
Class(a:Mother complete intersectionOf(a:Female restriction(a:hasChild
someValuesFrom (unionOf(a:Female a:Male)))))
ObjectProperty(a:hasChild)
)

Now, suppose I want to copy the class Mother from this ontology along
with its complete definition, to another ontology.

Is there a convenient method for doing this that perhaps, would
essentially walk over the relevant definitions and assert them into the
second ontology?

Once this is resolved, it may be useful for me to further modify the
existing labels (concept names, etc.) when I am copying to the new
ontology. Again, is there an already available procedure to achieve this?

Thanks,

Lalit Patil


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

Reply | Threaded
Open this post in threaded view
|

Re: Copying class definition from one ontology into another

Nick Drummond
Lalit,

You can duplicate a class and its definition by using
CloneFactory.cloneOWLNamedClass().
This utility method will create a new class IN THE CURRENTLY ACTIVE
ONTOLOGY and duplicate all of the anonymous classes required to define
it - leaving references to the named classes, properties and individuals
that are used in the definition. This will not create duplicates of
referenced classes - ie it does not create an extract of the ontology.

You can also do this in the interface (right click a class in the
classtree and select clone).
Before you make a clone, switch the currently active ontology to the
imported one (create an empty one if you need to).
Use this to check what you are expecting to happen is correct - let me
know if not - I've just made improvements to it.

The one problem that currently exists is that although refs to resources
in you existing ontology are retained, there's currently no check to
make sure there is an import statement in the imported file - I'll put
this in as a bug. You could currently work around this by adding it by hand.

Hope this helps

Nick

Lalit Patil wrote:

> Suppose I have to work with two ontologies, A and B. I need to copy a
> class from A to B along with its definition.
>
> As an example, consider the following ontology.
>
> Ontology
> (
> Class(a:Female partial)
> Class(a:Male partial)
> Class(a:Mother complete intersectionOf(a:Female restriction(a:hasChild
> someValuesFrom (unionOf(a:Female a:Male)))))
> ObjectProperty(a:hasChild)
> )
>
> Now, suppose I want to copy the class Mother from this ontology along
> with its complete definition, to another ontology.
>
> Is there a convenient method for doing this that perhaps, would
> essentially walk over the relevant definitions and assert them into
> the second ontology?
>
> Once this is resolved, it may be useful for me to further modify the
> existing labels (concept names, etc.) when I am copying to the new
> ontology. Again, is there an already available procedure to achieve this?
>
> Thanks,
>
> Lalit Patil
>
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
>

--

Nick Drummond

http://www.cs.man.ac.uk/~drummond/ <http://www.cs.man.ac.uk/%7Edrummond/>
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

Re: Copying class definition from one ontology into another

Lalit Patil
Thanks Nick,

I will try this - but I will be able to do this only after about 2
weeks. I will let you know.

Lalit

Nick Drummond wrote:

> Lalit,
>
> You can duplicate a class and its definition by using
> CloneFactory.cloneOWLNamedClass().
> This utility method will create a new class IN THE CURRENTLY ACTIVE
> ONTOLOGY and duplicate all of the anonymous classes required to define
> it - leaving references to the named classes, properties and individuals
> that are used in the definition. This will not create duplicates of
> referenced classes - ie it does not create an extract of the ontology.
>
> You can also do this in the interface (right click a class in the
> classtree and select clone).
> Before you make a clone, switch the currently active ontology to the
> imported one (create an empty one if you need to).
> Use this to check what you are expecting to happen is correct - let me
> know if not - I've just made improvements to it.
>
> The one problem that currently exists is that although refs to resources
> in you existing ontology are retained, there's currently no check to
> make sure there is an import statement in the imported file - I'll put
> this in as a bug. You could currently work around this by adding it by
> hand.
>
> Hope this helps
>
> Nick
>
> Lalit Patil wrote:
>
>> Suppose I have to work with two ontologies, A and B. I need to copy a
>> class from A to B along with its definition.
>>
>> As an example, consider the following ontology.
>>
>> Ontology
>> (
>> Class(a:Female partial)
>> Class(a:Male partial)
>> Class(a:Mother complete intersectionOf(a:Female restriction(a:hasChild
>> someValuesFrom (unionOf(a:Female a:Male)))))
>> ObjectProperty(a:hasChild)
>> )
>>
>> Now, suppose I want to copy the class Mother from this ontology along
>> with its complete definition, to another ontology.
>>
>> Is there a convenient method for doing this that perhaps, would
>> essentially walk over the relevant definitions and assert them into
>> the second ontology?
>>
>> Once this is resolved, it may be useful for me to further modify the
>> existing labels (concept names, etc.) when I am copying to the new
>> ontology. Again, is there an already available procedure to achieve this?
>>
>> Thanks,
>>
>> Lalit Patil
>>
>>
>> -------------------------------------------------------------------------
>> 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: Copying class definition from one ontology into another

Nick Drummond
I've fixed Protege-OWL so that cloning into a different (imported)
active ontology also creates the appropriate imports.
Available in next release (or on Sourceforge)

Nick

Lalit Patil wrote:

> Thanks Nick,
>
> I will try this - but I will be able to do this only after about 2
> weeks. I will let you know.
>
> Lalit
>
> Nick Drummond wrote:
>
>> Lalit,
>>
>> You can duplicate a class and its definition by using
>> CloneFactory.cloneOWLNamedClass().
>> This utility method will create a new class IN THE CURRENTLY ACTIVE
>> ONTOLOGY and duplicate all of the anonymous classes required to
>> define it - leaving references to the named classes, properties and
>> individuals that are used in the definition. This will not create
>> duplicates of referenced classes - ie it does not create an extract
>> of the ontology.
>>
>> You can also do this in the interface (right click a class in the
>> classtree and select clone).
>> Before you make a clone, switch the currently active ontology to the
>> imported one (create an empty one if you need to).
>> Use this to check what you are expecting to happen is correct - let
>> me know if not - I've just made improvements to it.
>>
>> The one problem that currently exists is that although refs to
>> resources in you existing ontology are retained, there's currently no
>> check to make sure there is an import statement in the imported file
>> - I'll put this in as a bug. You could currently work around this by
>> adding it by hand.
>>
>> Hope this helps
>>
>> Nick
>>
>> Lalit Patil wrote:
>>
>>> Suppose I have to work with two ontologies, A and B. I need to copy
>>> a class from A to B along with its definition.
>>>
>>> As an example, consider the following ontology.
>>>
>>> Ontology
>>> (
>>> Class(a:Female partial)
>>> Class(a:Male partial)
>>> Class(a:Mother complete intersectionOf(a:Female
>>> restriction(a:hasChild someValuesFrom (unionOf(a:Female a:Male)))))
>>> ObjectProperty(a:hasChild)
>>> )
>>>
>>> Now, suppose I want to copy the class Mother from this ontology along
>>> with its complete definition, to another ontology.
>>>
>>> Is there a convenient method for doing this that perhaps, would
>>> essentially walk over the relevant definitions and assert them into
>>> the second ontology?
>>>
>>> Once this is resolved, it may be useful for me to further modify the
>>> existing labels (concept names, etc.) when I am copying to the new
>>> ontology. Again, is there an already available procedure to achieve
>>> this?
>>>
>>> Thanks,
>>>
>>> Lalit Patil
>>>
>>>
>>> -------------------------------------------------------------------------
>>>
>>> To unsubscribe go to
>>> http://protege.stanford.edu/community/subscribe.html
>>>
>>>
>>
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
>

--

Nick Drummond

http://www.cs.man.ac.uk/~drummond/ <http://www.cs.man.ac.uk/%7Edrummond/>
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html