Search code examples
semanticsprotegerulevalidationrulesswrl

SWRL rule does not the right thing


I have an ontology wishing Protege and now I would like to implement rules.

I have an individual that has a literal PANEL = "R1-2B". I like to formulate a rule that if this value is "R1-2" then this individual has the object property "isGiveWaySign".

I have tried some things, but I SWRL does is not like supposed. I get just man new classes instead of setting just an object property.

My approaches look like:

PANEL(?a, ?b) ^ swrlb:substring(?b, "R1-2") -> isGiveWaySign(?a)

did I miss something?


Solution

  • correction to the solution above that worked for me better:

    Panel(?s, ?gws) ^ swrlb:contains(?gws, "R1-2") ^ Sign(?s) -> GiveWaySign(?s)