-2

Hi
i have made an ontology in protege 4.3 for users , suppose 1 of my ontology subclass of class user are:

1-"Interest" , and class "interest" have subclasses: "onlineGaming","onlineMovie","onlineshoping",... and every subclass has individual: everyday,onceAweek,onceAmonth)

and i have 3 datatype property for every user: (internetspeed,internetTraffic,Price)

data gathered based on a questionnaire
i just need to infer from this ontology how important this 3 datatype property factors is for internet users
i need to make some SWRL rules in protege to Infer user interest weight , for example if a user do onlineMovie everyday add a +3 to internetTraffic dataproperty.

user(?u) ^ hasOnlineMovieInterest(?u , everyday)-> add +3 to user(?u,InternetTraffic)
user(?u) ^ hasOnlineGamingInterest(?u , OnceAweek) and hasOnlineMovieInterest(?u , everyday)-> add +2 to user(?u,internetSpeed)

how should i write this properly in SWRL rules?
and my second question is how can i have the value of this 3 datatype property for every user in sparql and save the result?

Thanks for your help

  • 1
    Your whole modeling is really bad! A class `userInterest` is a subclass of `User`. Really? You know that this means that every `userInterest` is a user? And `userInterest` contains individuals like `everyday` - this means `everyday` is a `userInterest`. Really? – UninformedUser Jun 05 '17 at 12:01
  • 1
    And a class `userInterestRate` (again for what ever reason as subclass of user) "with 3 datatype property" . What means "with"? A class does not "have" a property. – UninformedUser Jun 05 '17 at 12:02
  • 1
    It would be better if you show the ontology in formal syntax, best solution in Manchester OWL syntax. Your rules example shows some properties, but nobody knows their definition and if there are others. – UninformedUser Jun 05 '17 at 12:05
  • @AKSW thanks for your reply i just made some big mistakes on designing my ontology i tried to change it would you please check my question again thanks for your help. – meysam motamedi Jun 05 '17 at 12:51

1 Answers1

2

First of all; it is not clear what you are doing / which technology using, etc., please consider clarifying your question. Moreover, the conceptual made you developed doesn't seem sound. Are you sure this is the best way to represent the information you want? For example, why would a UserInterest be a subClassOf User? I think you mean that UserInterest and UserInterestRate are ranges for an object property that connect User to them, i.e., hasInterest rdfs:domain User and hasInterest rdfs:range UserInterest.

Coming to your questions, do you use Protege? If you use it you can implement these SWRL rules using the SWRL tab in Protege.

After you have implemented this correctly, you can simply use some SPARQL query similar to:

select ?user ?r1 ?r2 ?r3 Where {
    ?user rdf:type yourNamespacePrefix:User.
    ?user yourNamespacePrefix:rate1 ?r1.   
    ?user yourNamespacePrefix:rate2 ?r2.   
    ?user yourNamespacePrefix:rate3 ?r3.   
}
Median Hilal
  • 1,483
  • 9
  • 17