Github user jessehatfield commented on a diff in the pull request:
https://github.com/apache/incubator-rya/pull/215#discussion_r135080995
--- Diff:
sail/src/test/java/org/apache/rya/rdftriplestore/inference/OneOfVisitorTest.java
---
@@ -0,0 +1,180 @@
+/*
+ * 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.
+ */
+package org.apache.rya.rdftriplestore.inference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.junit.Test;
+import org.openrdf.model.Resource;
+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.Binding;
+import org.openrdf.query.BindingSet;
+import org.openrdf.query.algebra.BindingSetAssignment;
+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.Var;
+import org.openrdf.query.algebra.evaluation.QueryBindingSet;
+
+import com.beust.jcommander.internal.Lists;
+import com.google.common.collect.Sets;
+
+/**
+ * Tests the methods of {@link OneOfVisitor}.
+ */
+public class OneOfVisitorTest {
+ private final AccumuloRdfConfiguration conf = new
AccumuloRdfConfiguration();
+ private static final ValueFactory VF = new ValueFactoryImpl();
+
+ private static final URI SUITS = VF.createURI("urn:Suits");
+ private static final URI RANKS = VF.createURI("urn:Ranks");
+
+ // Definition #1: :Suits owl:oneOf(:Clubs, :Diamonds, :Hearts, :Spades)
+ private static final URI CLUBS = VF.createURI("urn:Clubs");
+ private static final URI DIAMONDS = VF.createURI("urn:Diamonds");
+ private static final URI HEARTS = VF.createURI("urn:Hearts");
+ private static final URI SPADES = VF.createURI("urn:Spades");
+
+ // Definition #2: :Ranks owl:oneOf(:Ace, :2, :3, :4, :5, :6, :7, :8,
:9, :10, :Jack, :Queen, :King)
+ private static final URI ACE = VF.createURI("urn:Ace");
+ private static final URI TWO = VF.createURI("urn:2");
+ private static final URI THREE = VF.createURI("urn:3");
+ private static final URI FOUR = VF.createURI("urn:4");
+ private static final URI FIVE = VF.createURI("urn:5");
+ private static final URI SIX = VF.createURI("urn:6");
+ private static final URI SEVEN = VF.createURI("urn:7");
+ private static final URI EIGHT = VF.createURI("urn:8");
+ private static final URI NINE = VF.createURI("urn:9");
+ private static final URI TEN = VF.createURI("urn:10");
+ private static final URI JACK = VF.createURI("urn:Jack");
+ private static final URI QUEEN = VF.createURI("urn:Queen");
+ private static final URI KING = VF.createURI("urn:King");
+
+ private static final Set<Resource> CARD_SUIT_ENUMERATION =
+ Sets.newLinkedHashSet(
+ Lists.newArrayList(CLUBS, DIAMONDS, HEARTS, SPADES)
+ );
+ private static final Set<Resource> CARD_RANK_ENUMERATION =
+ Sets.newLinkedHashSet(
+ Lists.newArrayList(
+ ACE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN,
+ JACK, QUEEN, KING
+ )
+ );
+
+ @Test
+ public void testOneOf() throws Exception {
+ // Configure a mock instance engine with an ontology:
+ final InferenceEngine inferenceEngine =
mock(InferenceEngine.class);
+ final Map<Resource, Set<Resource>> enumerations = new HashMap<>();
--- End diff --
Doesn't look like this is used
---
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 [email protected] or file a JIRA ticket
with INFRA.
---