[ https://issues.apache.org/jira/browse/RYA-295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16131206#comment-16131206 ]
ASF GitHub Bot commented on RYA-295: ------------------------------------ Github user meiercaleb commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/201#discussion_r133811286 --- Diff: sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java --- @@ -416,6 +418,36 @@ private void refreshHasValueRestrictions(Map<Resource, URI> restrictions) throws } } + private void refreshAllValuesFromRestrictions(Map<Resource, URI> restrictions) throws QueryEvaluationException { --- End diff -- I think it would be good to outline the flow of logic here. E.g. refreshes allValuesRestrictions by creating a map of maps from the value class to a map that associates restrictions with properties. > Implement owl:allValuesFrom inference > ------------------------------------- > > Key: RYA-295 > URL: https://issues.apache.org/jira/browse/RYA-295 > Project: Rya > Issue Type: Sub-task > Components: sail > Reporter: Jesse Hatfield > Assignee: Jesse Hatfield > > An *{{owl:allValuesFrom}}* restriction defines the set of resources for > which, given a particular predicate and other type, every value of that > predicate is a member of that type. Note that there may be no values at all. > For example, the ontology may state that resources of type {{:Person}} have > all values from {{:Person}} for type {{:parent}}: that is, a person's parents > are all people as well. Therefore, a pattern of the form {{?x rdf:type > :Person}} should be expanded to: > {noformat} > { ?y rdf:type :Person . > ?y :parent ?x } > UNION > { ?x rdf:type :Person } > {noformat} > i.e. we can infer {{?x}}'s personhood from the fact that child {{?y}} is > known to satisfy the restriction. > Notes: > -We can infer "x is a person, therefore all of x's parents are people". But > we can't infer "all of x's parents are people, therefore x is a person", > because of the open world semantics: we don't know that the parents given by > the data are in fact all of x's parents. (If there were also a cardinality > restriction and we could presume consistency, then we could infer this in the > right circumstances, but this is outside the scope of basic allValuesFrom > support.) This differs with most other property restriction rules in that we > can't infer that an object belongs to the class defined by the restriction, > but rather use the fact that an object is already known to belong in that > class in order to infer something about its neighbors in the graph (the types > of the values). > -The example above could be applied recursively, but to implement this as a > simple query rewrite we'll need to limit recursion depth (and interactions > with other rules, for the same reasons). -- This message was sent by Atlassian JIRA (v6.4.14#64029)