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] Modeling "for-each" in swrl

Thomas Russ tar at ISI.EDU
Tue Oct 14 15:25:05 PDT 2008

On Oct 14, 2008, at 7:37 AM, Michael Lodemann wrote:

>>> I want to verify, that the length of all road-sections belonging  
>>> to a
>>> specific road doesn't exceed the road-length.
>>> To descibe it in an object-oriented style:
>>> int section_length = 0;
>>> foreach(road_section in road.sections)
>>> {
>>> section_length += road_section.length;
>>> }
>> One problem that you will encounter is the open-world reasoning.  You
>> can't find ALL of the road sections just by looking at the fillers.
>> You will need to add some additional assertions to the language to
>> enable the reasoning you desire.
>> Specifically:
>>   1.  You need to make all of the road-section individuals
>> differentFrom each other.
> Ok, this is done by using the individuals-wizard and making the
> individuals "AllDifferent", right? Btw. is there a way to make  
> individuals
> differ without using the wizard?

Yes, there is a menu item that allows you to add, remove and edit  
AllDifferent assertions.

    OWL > Edit owl:AllDifferents...

>>   2.  You will need to use an enumerated class and an allValuesFrom
>> restriction to provide a closed set of fillers.  Something like
>>     Road1  =>  belongsTo allValuesFrom {RoadSection1 RoadSection2 ...
>> RoadSectionN}
> I don't understand this completely.
> First of all, I'm having my classes and instances in two seperate
> ontologies and I want to keep it like that.

That can be done, somewhat, as long as you don't mind adding  
additional restrictions in the instance ontology.  OWL has the  
flexibility to allow that.

> Second ... In my model the belongsTo-Property has Domain:RoadSection  
> and
> Range:Road.
> And the restriction you have written is for individuals, not classes?

No.  The restriction is for classes.  But the class definition is  
defined as an explicitly enumerated set of individuals.  This is the  
owl:oneOf construct for class definition.

> Well, ok, you mean the RoadSections are part of the mentioned  
> enumerated
> class, but what about the Road1-individual?

The Road1 individual is defined to have as an additional type the  
anonymous class defined by the restriction that all of the values for  
the belongsTo property come from the enumerated set.  Using this or an  
asserted cardinality restriction is the only way that you can limit  
the fillers in OWL so that you can have a closed set of fillers for a  
property.  I think, but am not completely sure, that the reasoners can  
use cardinality restrictions along with a matching number of  
allDifferent individuals to know that all of the fillers are present.

> So with that suggestion I do have to know the individuals at design- 
> time?
> Unfortunately that is unwanted.

Depends on what you mean by design time.

Once you have created and asserted the individual road sections, you  
would have to take an additional step to create (or count) the  
enumerated set and assert the additional restriction in order to have  
a closed set of fillers.

>>> Does anyone can make it clear how to describe sth. like this in
>>> SWRL? Is
>>> it possible only with some swrlb:add statements, or do I have to use
>>> SQWRL?
>> I know that there is a summing operator, but I can't recall right now
>> if that is only available in SQWRL.  The problem is that you can't  
>> use
>> SQWRL results for inference, in part because it would provide a way  
>> to
>> violate open world semantics.
> So it seems to me, that I'm not able to ship around a programatical
> approach, where I can make my own closed world and make use of
> query-results, right?

Not sure what you mean here.

You can certainly use procedural programming via, for example, a Java  
OWL API to perform computations and make your own additional  
assertions to the ontology.  In your own implementation of the  
reasoning, you can make whatever assumptions or perform any other type  
of reasoning that you can implement.

What doesn't exist so far is an OWL reasoner with closed-world  
semantics.  It would not be compliant with the standard semantics of  
OWL, but one could imagine someone creating such a reasoner.

> Is there a good and complete example of how to use S(Q)WRLQueryAPI?  
> The
> wiki ( just  
> shows
> some snippets.

I'll leave this one to Martin O'Connor.

More information about the protege-owl mailing list