| AA wrote ... | | I have an ontology that models a building. One building has multiple | rooms. I want to have a rule that does something if a building has 3 or | more rooms. I'm trying something like: | | ''(?room1 rdf:type my:room), | (?room2 rdf:type my:room), | (?room3 rdf:type my:room), | | (?room1 my:name ?name1), | (?room2 my:name ?name2), | (?room3 my:name ?name3), | | notEqual(?name1, ?name2), | notEqual(?name1, ?name3), | notEqual(?name3, ?name2), | -> | do something'' | | The problem is that it is evaluated at least 3! times. Is there any | other way to do this? | | IBL wrote: | Here's how to do this in the Internet business Logic system. | | You can run this example by pointing a browser to www.reengineeringllc.com | and selecting 'Rooms1' in building some-building the number of rooms is some-total that-total is greater than or equal 3 ----------------------------------------------------------- we should start painting building that-building building some-building is one of ours count a-room-number : a-room-number is on the list of rooms in that-building = a-total --------------------------------------------------------------------------------------- in building that-building the number of rooms is that-total some-room-number is on the list of rooms in some-building --------------------------------------------------------- building that-building is one of ours this-room-number is on the list of rooms in this-building ========================================================= A1 Building A A2 Building A A3 Building A A4 Building A B1 Building B B2 Building B