owl - protege not inferring correctly? how to define precisely a class “vegetarian”?

拈花ヽ惹草 提交于 2019-12-03 16:06:44

You have hit upon a consequence of the fact that OWL reasoning uses an open-world assumption.

The reason your PastaVege recipe is not inferred to be a VegetarianRecipe is that, although the ingredients that you explicitly list in the recipe are indeed all VegeratianFood instances, it could well be that some currently unknown ingredient of your recipe is not a vegetarian food.

Since your constraint on VegetarianRecipe is that all ingredients should be VegetarianFoods (not just the ones we currently know about), it cannot be definitively concluded (in an open world) that your recipe is indeed a VegetarianRecipe.

There are a number of ways to deal with this, but none really do exactly what you want - you need to approach it from a slightly different angle.

Without going into the exact modeling details: although it is quite difficult to infer if a recipe is vegetarian given your current model, it is relatively simple to infer if a recipe is not vegetarian; any recipe that has at least one non-vegetarian ingredient is a non-vegetarian recipe.

An alternative approach is that you create a closed set of (vegetarian) ingredients (using an OWL enumerated class via the oneOf constraint), but that is a significant change to your model, and of course it is tedious to have to list all possible ingredients in this fashion.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!