You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@rya.apache.org by jessehatfield <gi...@git.apache.org> on 2017/08/08 20:42:34 UTC
[GitHub] incubator-rya pull request #201: RYA-295 owl:allValuesFrom inference
GitHub user jessehatfield opened a pull request:
https://github.com/apache/incubator-rya/pull/201
RYA-295 owl:allValuesFrom inference
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## Description
Inference applies owl:allValuesFrom semantics for queries including statement patterns of the form "?x rdf:type :DefinedClass".
An owl:allValuesFrom property restriction is a universal class expression: it defines type T1 to be the set of individuals such that, for a given property p and type T2, all values of that property (i.e. all objects of triples where the predicate is p and the subject belongs to T1) have type T2. Therefore, if an individual is known to belong to the universal class expression (T1), then it can be inferred that all of its values for the property belong to the value type (T2). This is similar to rdfs:range except that it only applies when the subject of the triple belongs to the appropriate class expression.
InferenceEngine, at refresh time, stores information about owl:allValuesFrom restrictions (universal class expressions). These definitions can then be accessed by the value type: getAllValuesFromByValueType(<value type>) returns every (restriction type, property) pair.
AllValuesFromVisitor processes statement patterns of the form "?x rdf:type :T2", and if :T2 is the value type for any owl:allValuesFrom restriction according to the inference engine, it replaces the statement pattern with a union: of 1) that same statement pattern (in case the type is explicitly asserted or can be inferred by some other rule); and 2) a subquery of the form "?y \:p ?x . ?y rdf:type :T1" for the appropriate (restriction type, property) pair.
RdfCloudTripleStoreConnection calls the visitor along with the other inference logic. Because the original statement pattern is preserved as one branch of the union, other visitors can still apply if there are other ways to derive the type.
Added a simple example of a query that relies on this inference to MongoRyaDirectExample.
### Tests
Unit test to verify that InferenceEngine stores and returns the schema; unit test to verify that AllValuesFromVisitor rewrites queries of the proper form; integration test to verify correct results for sample ontology+instances+query relying on allValuesFrom inference.
### Links
[Jira](https://issues.apache.org/jira/browse/RYA-295)
### Checklist
- [ ] Code Review
- [ ] Squash Commits
#### People To Reivew
@ejwhite922
@isper3at
@meiercaleb
@pujav65
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jessehatfield/incubator-rya RYA-295-allValuesFrom-inference
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-rya/pull/201.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #201
----
commit 55eae37e2f4aaef2f8cd41c735241c2ae85b88af
Author: Jesse Hatfield <je...@parsons.com>
Date: 2017-08-08T19:58:10Z
RYA-295 owl:allValuesFrom inference
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rya issue #201: RYA-295 owl:allValuesFrom inference
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:
https://github.com/apache/incubator-rya/pull/201
Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/415/
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rya pull request #201: RYA-295 owl:allValuesFrom inference
Posted by meiercaleb <gi...@git.apache.org>.
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.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rya issue #201: RYA-295 owl:allValuesFrom inference
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:
https://github.com/apache/incubator-rya/pull/201
Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/390/<h2>Failed Tests: <span class='status-failure'>3</span></h2><h3><a name='incubator-rya-master-with-optionals-pull-requests/org.apache.rya:rya.prospector' /><a href='https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/390/org.apache.rya$rya.prospector/testReport'>incubator-rya-master-with-optionals-pull-requests/org.apache.rya:rya.prospector</a>: <span class='status-failure'>3</span></h3><ul><li><a href='https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/390/org.apache.rya$rya.prospector/testReport/org.apache.rya.prospector.mr/ProspectorTest/testCount/'><strong>org.apache.rya.prospector.mr.ProspectorTest.testCount</strong></a></li><li><a href='https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/390/org.apache.rya$rya.prospector/testReport/org.apache.rya.prospector.service/ProspectorServiceEvalStatsDAOTest/testCount
/'><strong>org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAOTest.testCount</strong></a></li><li><a href='https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/390/org.apache.rya$rya.prospector/testReport/org.apache.rya.prospector.service/ProspectorServiceEvalStatsDAOTest/testNoAuthsCount/'><strong>org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAOTest.testNoAuthsCount</strong></a></li></ul>
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rya issue #201: RYA-295 owl:allValuesFrom inference
Posted by jessehatfield <gi...@git.apache.org>.
Github user jessehatfield commented on the issue:
https://github.com/apache/incubator-rya/pull/201
Fixed a typo in a log message and a redundant line in the example; updated with latest changes to master.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rya pull request #201: RYA-295 owl:allValuesFrom inference
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-rya/pull/201
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rya issue #201: RYA-295 owl:allValuesFrom inference
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:
https://github.com/apache/incubator-rya/pull/201
Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/411/<h2>Build result: FAILURE</span></h2>[...truncated 222.12 KB...][INFO] ------------------------------------------------------------------------[INFO] Total time: 05:50 min[INFO] Finished at: 2017-08-18T16:08:52+00:00[INFO] Final Memory: 114M/3031M[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project rya.sail: Compilation failure: Compilation failure:[ERROR] /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java:[998,5] illegal start of expression[ERROR] /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java:[998,63] ';' expected[ERROR
] /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java:[998,82] ';' expected[ERROR] /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java:[1024,2] reached end of file while parsing[ERROR] -> [Help 1][ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException[ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR] mvn <goals> -rf :rya.sailchannel stoppedSetting status of 89747b21f680643216466158dcb779940822cc93 to FAILURE w
ith url https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/411/ and message: 'FAILURE 'Using context: Jenkins: clean package -Pgeoindexing
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-rya issue #201: RYA-295 owl:allValuesFrom inference
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:
https://github.com/apache/incubator-rya/pull/201
Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/373/
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---