[protege-owl] alternate property values per individual

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

[protege-owl] alternate property values per individual

Gandalf-6
Hello,

I need to model the fact that an individual may have multiple primitive
values for a property. For example, let us assume that a country may
have several names e.g. {The United States, The Unites States of
America, The USA} and that the property hasAlternateNames whose domain
is the class country relates individuals of class country to their
alternative names.

1- What would be the most suitable datatype one would use for this
property ?
2- I thought I would use some sort of OWL Collection. But I don't know
how to specify a collection of strings since OWL Lists and other OWL
Collections are designed to includ individuals, not primitive values, as
far as I understand.
3- Must the property hasAlternateNames include all possible values for
every and each individual of class country ? Or can the alternative
values be defined at the individual level only.


Thank you for your insights.

Best regards,

GLG.

P.S.: I am no ontology specialist, thank you for your indulgence.

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

Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: alternate property values per individual

Peter North
if...
1) you do not have an inherent order for these values
2) you never need to maintain duplicate values
then...
just do NOT make the property 'Functional'

an property that is NOT 'Functional' may have multiple distinct un-ordered values
On 5/22/06, Gandalf <[hidden email]> wrote:
Hello,

I need to model the fact that an individual may have multiple primitive
values for a property. For example, let us assume that a country may
have several names e.g. {The United States, The Unites States of
America, The USA} and that the property hasAlternateNames whose domain
is the class country relates individuals of class country to their
alternative names.

1- What would be the most suitable datatype one would use for this
property ?
2- I thought I would use some sort of OWL Collection. But I don't know
how to specify a collection of strings since OWL Lists and other OWL
Collections are designed to includ individuals, not primitive values, as
far as I understand.
3- Must the property hasAlternateNames include all possible values for
every and each individual of class country ? Or can the alternative
values be defined at the individual level only.


Thank you for your insights.

Best regards,

GLG.

P.S.: I am no ontology specialist, thank you for your indulgence.

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


Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: alternate property values per individual

Gandalf-6
Peter North wrote:
> if...
> 1) you do not have an inherent order for these values
> 2) you never need to maintain duplicate values
> then...
> just do NOT make the property 'Functional'
>
> an property that is NOT 'Functional' may have multiple distinct
> un-ordered values

Peter, thank you for your reply. I do handle un-ordered distinct values
and, therefore, using a non-functional property is what I have been
doing so far. But I am afraid my problem lies elsewhere.

If I am not mistaken, using a non-functional datatype property whose
type is xsd:string makes it mandatory to add all possible values taken
by that property throughout the set of individuals having that property.
Is this correct ?

If this assumption is correct, it seems that adding a new value to the
property range is a very very costly operation which amounts to
exponential time. It takes about 17,000 seconds to add 5,400 string
values, that is 1 string every 3 seconds.

Obviously this is not the way to go, if the number of values you need to
add is 2 or 3 orders of magnitude greater than the aforementioned figures.

Specifying the possible values (a collection of strings) at the instance
level instead of doing that at the property level, if that is possible
at all in OWL, would be much faster. I would appreciate any guidance in
this regard.

Thanks.

GLG

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

Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: alternate property values per individual

Ulrike Sattler
Hi Peter, I guess i am not the only one who has difficulties  
understanding your problem:


On 22 May 2006, at 20:12, Gandalf wrote:

> Peter North wrote:
>> if...
>> 1) you do not have an inherent order for these values
>> 2) you never need to maintain duplicate values
>> then...
>> just do NOT make the property 'Functional'
>>
>> an property that is NOT 'Functional' may have multiple distinct
>> un-ordered values
>
> Peter, thank you for your reply. I do handle un-ordered distinct  
> values
> and, therefore, using a non-functional property is what I have been
> doing so far. But I am afraid my problem lies elsewhere.
>
> If I am not mistaken, using a non-functional datatype property whose
> type is xsd:string makes it mandatory to add all possible values taken
> by that property throughout the set of individuals having that  
> property.
> Is this correct ?

I don't think so -- can you give a small example?

Cheers, Uli

>
> If this assumption is correct, it seems that adding a new value to the
> property range is a very very costly operation which amounts to
> exponential time. It takes about 17,000 seconds to add 5,400 string
> values, that is 1 string every 3 seconds.
>
> Obviously this is not the way to go, if the number of values you  
> need to
> add is 2 or 3 orders of magnitude greater than the aforementioned  
> figures.
>
> Specifying the possible values (a collection of strings) at the  
> instance
> level instead of doing that at the property level, if that is possible
> at all in OWL, would be much faster. I would appreciate any  
> guidance in
> this regard.
>
> Thanks.
>
> GLG
>
> ----------------------------------------------------------------------
> ---
> 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: alternate property values per individual

Gandalf-6
Uli Sattler wrote:
> Hi Peter, I guess i am not the only one who has difficulties
> understanding your problem:
>
>> If I am not mistaken, using a non-functional datatype property whose
>> type is xsd:string makes it mandatory to add all possible values taken
>> by that property throughout the set of individuals having that property.
>> Is this correct ?
>
> I don't think so -- can you give a small example?

Let us take the following example:

1- The context: an ontology modeling world countries.

2- The ontology contains the concept "country" having several properties
like : p1=iso_code(xsd:string, functional), p2=country_name(xsd:string,
functional), other_country_names(xsd:string?,non-functional ?)

3- The ontology is populated with as many individuals as there are
countries in the world. For example, take the following individuals:

i_1=USA
p1(i_1)="US"
p2(i_1)="The United States"
p3(i_1)={"The United States of America", "The USA", "America"}

i_2=BERMUDA
p1(i_2)="MM"
p2(i_2)="Myanmar"
p3(i_2)={"Bermuda"}


etc.

Question1:

Is it interesting or *mandatory* to have :
Range(p3)=Union(p3(i_1), p3(i_2), ..., p3(i_n)) ?

Question2:

Given the following code:

OWLNamedClass owlClass = getModel().getOWLNamedClass("country");
// assume no exception is thrown here for the sake of brevity
OWLIndividual country = owlClass.createOWLIndividual("USA");

OWLDatatypeProperty p1 = getModel().getOWLDatatypeProperty("iso_code");
OWLDatatypeProperty p2 =
getModel().getOWLDatatypeProperty("country_name");
OWLDatatypeProperty p3 =
getModel().getOWLDatatypeProperty("other_country_names");

country.setPropertyValue(p1, "US");
country.setPropertyValue(p2, "The United States");

// a collection of alternative names for this country
Collection<String> input = new ArrayList<String>();
input.add("The United States of America");
input.add("The USA");
input.add("America");

How would you attach the content of the collection called "input" to the
OWLIndividual "called" country ?

Thank you.

Best regards.

GLG

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

Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: alternate property values per individual

Ulrike Sattler

On 23 May 2006, at 15:21, Gandalf wrote:

> Uli Sattler wrote:
>> Hi Peter, I guess i am not the only one who has difficulties
>> understanding your problem:
>>
>>> If I am not mistaken, using a non-functional datatype property whose
>>> type is xsd:string makes it mandatory to add all possible values  
>>> taken
>>> by that property throughout the set of individuals having that  
>>> property.
>>> Is this correct ?
>>
>> I don't think so -- can you give a small example?
>
> Let us take the following example:
>

thanks - this makes things clearer

> 1- The context: an ontology modeling world countries.
>
> 2- The ontology contains the concept "country" having several  
> properties
> like : p1=iso_code(xsd:string, functional), p2=country_name
> (xsd:string,
> functional), other_country_names(xsd:string?,non-functional ?)
>
> 3- The ontology is populated with as many individuals as there are
> countries in the world. For example, take the following individuals:
>
> i_1=USA
> p1(i_1)="US"
> p2(i_1)="The United States"
> p3(i_1)={"The United States of America", "The USA", "America"}
>
> i_2=BERMUDA
> p1(i_2)="MM"
> p2(i_2)="Myanmar"
> p3(i_2)={"Bermuda"}
>
>
> etc.
>
> Question1:
>
> Is it interesting or *mandatory* to have :
> Range(p3)=Union(p3(i_1), p3(i_2), ..., p3(i_n)) ?

I don't think so: the range of all your properties is "String", so  
this wouldn't give you anything!

>

I guess it would be more helpful to have

p1, p2, and p3 being properties of (another) property "cc" . This  
would allow you to query, eg, for those countries having a cc "US",  
without having to do a disjunction "having p1 "US" OR having p2 "US"  
OR having p3 "US"":

when p is declared to be a subproperty of cc and x is related to y  
via p, then (a reasoner infers that) x is related to y via cc.

> Question2:
>
> Given the following code:
>
> OWLNamedClass owlClass = getModel().getOWLNamedClass("country");
> // assume no exception is thrown here for the sake of brevity
> OWLIndividual country = owlClass.createOWLIndividual("USA");
>
> OWLDatatypeProperty p1 = getModel().getOWLDatatypeProperty
> ("iso_code");
> OWLDatatypeProperty p2 =
> getModel().getOWLDatatypeProperty("country_name");
> OWLDatatypeProperty p3 =
> getModel().getOWLDatatypeProperty("other_country_names");
>
> country.setPropertyValue(p1, "US");
> country.setPropertyValue(p2, "The United States");
>
> // a collection of alternative names for this country
> Collection<String> input = new ArrayList<String>();
> input.add("The United States of America");
> input.add("The USA");
> input.add("America");

> How would you attach the content of the collection called "input"  
> to the
> OWLIndividual "called" country ?
>

can you do this in owl only?

> Thank you.
>
> Best regards.
>
> GLG
>
> ----------------------------------------------------------------------
> ---
> 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: alternate property values per individual

Gandalf-6
Uli Sattler wrote:

>> Question2:
>>
>> Given the following code:
>>
>> OWLNamedClass owlClass = getModel().getOWLNamedClass("country");
>> // assume no exception is thrown here for the sake of brevity
>> OWLIndividual country = owlClass.createOWLIndividual("USA");
>>
>> OWLDatatypeProperty p1 =        
>> getModel().getOWLDatatypeProperty("iso_code");
>> OWLDatatypeProperty p2 =    
>> getModel().getOWLDatatypeProperty("country_name");
>> OWLDatatypeProperty p3 =    
>> getModel().getOWLDatatypeProperty("other_country_names");
>>
>> country.setPropertyValue(p1, "US");
>> country.setPropertyValue(p2, "The United States");
>>
>> // a collection of alternative names for this country
>> Collection<String> input = new ArrayList<String>();
>> input.add("The United States of America");
>> input.add("The USA");
>> input.add("America");
>
>> How would you attach the content of the collection called "input" to the
>> OWLIndividual "called" country ?
>>
>
> can you do this in owl only?


The answer seems to be yes, since it is feasable through the GUI.

And the answer to my question is:
for(Iterator<String> iter = input.iterator();iter.hasNext();){
country.addPropertyValue(p3, iter.next());
}

Thank you, Uli and Peter, for taking the time.

GLG

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

Reply | Threaded
Open this post in threaded view
|

[protege-owl] Importing using the Protégé/OWL API

Carlos S. Zamudio-2
In reply to this post by Ulrike Sattler
Hi,
I've not been able to figure out how to use the Protégé/OWL API to import an
ontology when creating a new ontology. The documentation suggests that this
is possible, but no real direction.  Could someone direct me to the
appropriate components in the API? Thanks.
Carlos
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html