Github user isper3at commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/209#discussion_r134265523
  
    --- Diff: 
sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java 
---
    @@ -416,22 +419,57 @@ private void 
refreshHasValueRestrictions(Map<Resource, URI> restrictions) throws
             }
         }
     
    -    private static Vertex getVertex(Graph graph, Object id) {
    -        Iterator<Vertex> it = graph.vertices(id.toString());
    +    private void refreshHasSelfRestrictions(final Map<Resource, URI> 
restrictions) throws QueryEvaluationException {
    +        hasSelfByType = new HashMap<>();
    +        hasSelfByProperty = new HashMap<>();
    +
    +        restrictions.forEach((type, property) -> {
    +            try {
    +                final CloseableIteration<Statement, 
QueryEvaluationException> iter = RyaDAOHelper.query(ryaDAO, type, HASSELF, 
null, conf);
    +                try {
    +                    if (iter.hasNext()) {
    +                        Set<URI> typeSet = hasSelfByType.get(type);
    +                        Set<Resource> propSet = 
hasSelfByProperty.get(property);
    +
    +                        if (typeSet == null) {
    +                            typeSet = new HashSet<>();
    +                        }
    +                        if (propSet == null) {
    +                            propSet = new HashSet<>();
    +                        }
    +                        typeSet.add(property);
    +                        propSet.add(type);
    +
    +                        hasSelfByType.put(type, typeSet);
    +                        hasSelfByProperty.put(property, propSet);
    +                    }
    +                } catch (final QueryEvaluationException e) {
    --- End diff --
    
    switched to finally to follow the convention of refreshHasValue


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to