I am building an ontology of 3 classes :
- Messages
- Ham
- Spam
2 dataproperties , domain : Messages and range xsd:string :
- hasInterest
- hasCategory
2 SWRL Rules: Message(?x),hasInterest(?x,?a),hasCategory(?x,?b), swrl:equal(?a,?b) ->Ham(?x)
Message(?x),hasInterest(?x,?a),hasCategory(?x,?b), swrl:notEqual(?a?b) ->Spam(?x)
I want to classify instances of class Message to class Spam or Ham ; if the hasCategory value ( message category) is equal to the hasInterest value ( user interests) then the message is ham else spam
This worked correctly If I have 1 message category and 1 interest ex: m1 hasInterests sports m1 hasCategory sports
So what If I have a list of iterests or categories ex: Each message has more than 1 interests {sports, movies} Each message has more than 1 category {movies , politics}
I want to say if both lists intersect then the message is ham so the swrl:equal did not work how can i define it to compare all the individuals
What I did is repeating the hasInterests and hasCategory depending on the individual values I mean defining manually the list and it worked , is there another automatic way using a list of strings and how to compare them in swrl ?