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 Problem

James Howison james at
Tue Oct 7 10:20:55 PDT 2008

On 7 Oct 2008, at 11:06 AM, Michael Lodemann wrote:

> Thanks for your quick answers.
> Yes, it's all about inconsisty checking!
> I want to check if a xml-File is semantically correct - eg:
> - Signs belonging to a road-section are in a right position ... like  
> sign
> "position" being between "from" and "to" of the road-section
> - road-section is not longer than length_km of belonging road
> - etc.
> So your hints, James, really helped me to initally model my problem.
> I slightly changed your suggestions, because I don't need towns.
> And I wonder if it is practicable for me to merge "sign" and
> "sign_placement".

Yeah, that might work, but since a :Sign can be moved it might give  
you some flexibility (ie change the :SignPlacement rather than  
the :Sign).  But you almost definitely don't need it, then you could  
directly infer (see below) a :MisplacedSign.

> so
>> :road_sec1 rdf:type :RoadSection ;
>>            :from :town1 ;
>>            :to :town2 ;
>>            :start_km "7.8"^^xsd:float ;
>>            :end_km   "17.8"^^xsd:float .
> becomes
> :road_sec1
>      a       :RoadSection ;
>      :belongsTo :road1 ;
>      :from   "7.8"^^xsd:float ;
>      :to     "17.8"^^xsd:float .
> and the sign
>> :sign1 rdf:type :Sign ;
>>       rdfs:label "7km to End Town" ;
>>       :dist_to_dest_km "7"^^xsd:float ;
>>       :targetTown :town2 .
> becomes
> :sign1
>      a       :Sign ;
>      rdfs:label "Beware of Kangaroos" ;
>      :onRoadSection :road_sec1 ;
>      :position "10.8"^^xsd:float .
> Honestly ... I didn't get what the purpose of "SignPlacement" is.
>> :CorrectPlacement rdf:type owl:Class ;
>>                      rdfs:subClassOf :SignPlacement ;
>>                      rdfs:comment "A placement is correct if the
>> position and the content of the sign match " .
>> :InCorrectPlacement rdf:type owl:Class ;
>>                      rdfs:subClassOf :SignPlacement ;
>>                      rdfs:comment "A placement is incorrect if the
>> position and the content of the sign do not match" .
>> :sign1placement rdf:type :CorrectPlacement .
>> :sign1 rdf:type :CorrectlyPlacedSign .  // define this as a :Sign
>> associated with a :CorrectPlacement
>> // Assume an incorrectly placed sign.
>> :sign2placement rdf:type :InCorrectPlacement .
>> :sign2 rdf:type :MisplacedSign .
>> Then you can think about what mechanism you might use to produce the
>> desired result.  Since this involves math you will probably need to
>> look at SWRL to generate the assertions about CorrectlyPlacedSigns.
>> Only some reasoners, like Pellet, cope with some SWRL constructions.
>> Protege offers the Jess Bridge which understands some extension  
>> built-
>> ins for SWRL, but you probably don't need those.
> Ok, there might be a way to tell the reasoner (I am using Pellet) to  
> infer
> if a sign is placed correctly or not. Is this the mechanism you are
> talking about? Well today I started looking at SWRL and SQWRL and  
> tried
> the family.owl example out in Protege 3.3.1 and Protege 3.4 (for SQWRL
> reasons) but I'n not able to map these cognitions to my problem.

I'm not familiar with SQWRL.

> Can you give me a hint how do such a SWRL rule looks like regarding  
> the
> above example with the placement-check of the sign?

Well first you need to figure out the features of the sign which  
determine its correct placement (with reference to the :Road  
or :RoadSection).  I'm not sure how you do that with "Beware of  
Kangaroos", unless you have other information about where a sign  
should go.  With the distance to all the data you need to do the math  
to determine whether the current placement of the sign (or the  
position attribute of the sign) is correct.

You want to get to here (untested and illustrative):

curr_position(?sign, ?pos) ^ correct_position(?sign, ?correct) ^  
swrlb:equal(?pos, ?correct) -> CorrectlyPlacedSign(?sign)
curr_position(?sign, ?pos) ^ correct_position(?sign, ?correct) ^  
swrlb:notEqual(?pos, ?correct) -> MisPlacedSign(?sign)

which requires a way of calculating the correct_position for  
each :Sign.  For some that might be possible using the swrl math  
transforms to generate a new statement (ie a SWRL result of ->  
correct_position(?sign, ?calculated) )

You might find that calculating the correct_position is best done  
procedurally, accessing the knowledge base (ontology) via Jena or  
similar.  That said by the time you are working procedurally you could  
do the generation of the CorrectlyPlacedSign and MisPlacedSign  
statements procedurally too, taking SWRL out of the equation.


More information about the protege-owl mailing list