Re: Question on query classes

Hiya, there are various (not very convenient, but working) ways: 

- you could create a class with some “sample” ranges and find their (direct) superclass (in your example,  “fish and haslength some float[= 5]” and “fish and haslength some float[= 20]” would work…but you’d need intermediate ones in case you had more fine-grained partition of fishes’ lengths…

- you could do a similar thing by creating (dummy) individuals (with lengths as above) and ask for the classes they are an instance of. 

- you could create you test-class, say C for “fish and haslength some [>= 5, <= 20]” and then iterate over your ‘candidate classes’ X_i and test whether C and X_i is satisfiable. This may become a bit cumbersome to do manually, but can easily be done using the OWL API. 

Cheers, Uli



On 29 Apr 2014, at 02:46, <ericliu_007@sina.com> <ericliu_007@sina.com> wrote:

> Hi,
> 
>       
> 
>        I'm new to ontology and currently I'm building an ontology with protege4.3. I have a problem on how to query classes with certain restrictions on dataproperty.      Specifically,I don't know how to find out all the classes(they have a dataproperty range in float) that their dataproperty ranges have intersected with the given range.
> 
>      
> 
>       In short and not strict in syntax,
> 
> Class A  haslength [20,100]
> 
> Class B haslength (100,150)
> 
> Class C haslength [150,200]
> 
> ……
> 
> I want to find all the classes which might have intances in the range [80,120],that is to say all the classes which its range of the dataproperty "haslength" is intersected with the given range [80,120]. And in this case,Class A and Class B will be the correct answer.  You may skip  the example below if you get what I mean.
> 
> 
> 
>       For  example, A class is called "Bigfish",which has a dataproperty called "haslength".And its expression is like this"haslength some float[>= 100]".
> 
>       Another class is called "Mediumfish",which also has a dataproperty called "haslength".And its expression is like this"haslength some float[> 10,< 100]".
> 
>       Still another class is called"Smallfish",which also has a dataproperty called "haslength".And its expression is like this"haslength some float[<= 10]".
> 
>       Given the range haslength some float[>= 5,<= 20],  in this case,my question is how can I find out all the classes which its range of dataproperty"haslength"have intersected with the given range[5,20]?
> 
>       In other word,I might find some fish of which the length are ranged from 5 to 20, and I want to find out which classes they might belong to.The correct anser will be "Smallfish" and "Mediumfish".
> 
> 
> 
>       So how can I solve this problem?
> 
>       Is there any plugins that may help me to accomplish this task?Am I going to directly query classes or using an instance which has the dataproperty with the given range? Or, I should use OWL-API?
> 
>      Thank you very much! Looking foward to your reply!
> 
>      
> 
> p.s.:forgive me, my english is poor....
> 
> 
> 
> 
> 
> Eric Liu
> 
> 
> 
> 
> --------------------------------
> Jiacheng Liu
> Department of Computer Science and Technology
> School of Computer Science
> Fudan University,Shanghai,200433
> Tel:(+86)13761633883

Received on Wednesday, 30 April 2014 10:07:20 UTC