1

I'm having difficulties grasping the concept of classes/instances/properties. If we take the following example: Class 'Pizza', Inferred Subclass 'Cheesy Pizza' = Pizza & HasIngredient Some 'Cheese'. I can follow this logic and I see the usefulness of automaticly Inferring classes.

However, I don't understand how to properly use quantitative links/properties. How could one, using RDF/OWL, expres the following: 100grams of cheese has 10g protein. And the Instance margherita pizza has 250grams of cheese? And also, could one infer that a margherita pizza thus has 25g protein?

unor
  • 92,415
  • 26
  • 211
  • 360
vincent kleine
  • 724
  • 1
  • 6
  • 22
  • n-ary relations in OWL resp. RDF need to be modeled via a blank node (resp. anonymous individual) or just some intermediate node. See for example [here](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=2ahUKEwjlj5ytl4PfAhWisKQKHYz-BDYQFjAAegQIChAB&url=https%3A%2F%2Fwww.w3.org%2FTR%2Fswbp-n-aryRelations&usg=AOvVaw03Smes1MkNLXBi6NTiqyC_) – UninformedUser Dec 03 '18 at 07:57

1 Answers1

1

For this you need to reify the quantitative relation e.g. create QtyOfX as a class of its own. A Blank node could be help you to express this (the stuff between square brackets).

:Cheese a :Ingredient .
:Cheese :hasProteinToGramsRatio 0.1 .

:Pizza1 :hasIngredientQty [ hasQuantityInGrams 250; hasIngridient :Cheese  ]

With this at hand you could build your inference for example:

:hasIngredientQty(?p,?q) ^ :hasIngredient(?q,?x) ^ :hasProteinToGramsRatio(?x,?r) ^ swrlb:multiply(?proteinCount, ?q, ?r)
-> :hasProteins(?p,?proteinCount)
Koenig Lear
  • 2,366
  • 1
  • 14
  • 29