[ https://issues.apache.org/jira/browse/RYA-291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16087646#comment-16087646 ]
ASF GitHub Bot commented on RYA-291: ------------------------------------ Github user ejwhite922 commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/174#discussion_r127327585 --- Diff: sail/src/test/java/org/apache/rya/rdftriplestore/inference/HasValueVisitorTest.java --- @@ -0,0 +1,199 @@ +package org.apache.rya.rdftriplestore.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. + */ + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.apache.rya.accumulo.AccumuloRdfConfiguration; +import org.apache.rya.rdftriplestore.inference.HasValueVisitor; +import org.apache.rya.rdftriplestore.inference.InferenceEngine; +import org.apache.rya.rdftriplestore.utils.FixedStatementPattern; +import org.junit.Assert; +import org.junit.Test; +import org.openrdf.model.Resource; +import org.openrdf.model.Statement; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.model.ValueFactory; +import org.openrdf.model.impl.ValueFactoryImpl; +import org.openrdf.model.vocabulary.RDF; +import org.openrdf.query.algebra.Join; +import org.openrdf.query.algebra.Projection; +import org.openrdf.query.algebra.ProjectionElem; +import org.openrdf.query.algebra.ProjectionElemList; +import org.openrdf.query.algebra.StatementPattern; +import org.openrdf.query.algebra.TupleExpr; +import org.openrdf.query.algebra.Union; +import org.openrdf.query.algebra.Var; + +public class HasValueVisitorTest { + private final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration(); + private final ValueFactory vf = new ValueFactoryImpl(); + + private final URI chordate = vf.createURI("urn:Chordate"); + private final URI vertebrate = vf.createURI("urn:Vertebrate"); + private final URI mammal = vf.createURI("urn:Mammal"); + private final URI tunicate = vf.createURI("urn:Tunicate"); + private final URI hasCharacteristic = vf.createURI("urn:anatomicalCharacteristic"); + private final URI notochord = vf.createURI("urn:notochord"); + private final URI skull = vf.createURI("urn:skull"); + private final URI belongsTo = vf.createURI("urn:belongsToTaxon"); + private final URI chordata = vf.createURI("urn:Chordata"); + + @SuppressWarnings("unchecked") --- End diff -- To get rid of the SuppressWarnings, make the class org.apache.rya.rdftriplestore.inference.AbstractInferVisitor extend QueryModelVisitorBase<Exception> > Implement owl:hasValue inference > -------------------------------- > > Key: RYA-291 > URL: https://issues.apache.org/jira/browse/RYA-291 > Project: Rya > Issue Type: Sub-task > Components: sail > Reporter: Jesse Hatfield > Assignee: Jesse Hatfield > > *{{owl:hasValue}}* is used to define a property restriction representing the > set of resources with a specific value for a specific predicate. > If the ontology states that the class {{:ChildOfJohn}} represents all > resources with {{:parent}} equal to {{:John}}, then the inference engine > should be able to: > 1. Rewrite a query pattern {{?X rdf:type :ChildOfJohn}} to check for > resources whose {{:parent}} is {{:John}} (in addition to those explicitly > stated to have type {{:ChildOfJohn}}) > 2. Rewrite a query pattern {{:Jane :parent :?Y}} to check whether :Jane has > the type {{:ChildOfJohn}} (in addition to querying for any specifically > stated {{:parent}} s) -- This message was sent by Atlassian JIRA (v6.4.14#64029)