You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by ha...@apache.org on 2019/07/29 23:27:17 UTC
[clerezza] branch reunited updated: CLEREZZA-1044: Remove
deprecated SimpleMGraph
This is an automated email from the ASF dual-hosted git repository.
hasan pushed a commit to branch reunited
in repository https://gitbox.apache.org/repos/asf/clerezza.git
The following commit(s) were added to refs/heads/reunited by this push:
new 0671846 CLEREZZA-1044: Remove deprecated SimpleMGraph
0671846 is described below
commit 0671846a15dd70b301a8a3d066010cdea0784dee
Author: Hasan <ha...@apache.org>
AuthorDate: Tue Jul 30 01:26:48 2019 +0200
CLEREZZA-1044: Remove deprecated SimpleMGraph
---
.../implementation/graphmatching/GraphMatcher.java | 6 +--
.../implementation/in_memory/SimpleMGraph.java | 53 ----------------------
.../graphmatching/GraphMatcherTest.java | 30 ++++++------
.../graphmatching/Utils4Testing.java | 4 +-
.../org/apache/clerezza/dataset/TcManagerTest.java | 29 ++++++------
.../clerezza/dataset/providers/WeightedA.java | 6 +--
.../clerezza/dataset/providers/WeightedA1.java | 4 +-
.../clerezza/dataset/providers/WeightedBlight.java | 8 ++--
.../clerezza/dataset/providers/WeightedDummy.java | 6 +--
.../org/apache/clerezza/representation/Parser.java | 4 +-
10 files changed, 49 insertions(+), 101 deletions(-)
diff --git a/api-implementation/src/main/java/org/apache/clerezza/implementation/graphmatching/GraphMatcher.java b/api-implementation/src/main/java/org/apache/clerezza/implementation/graphmatching/GraphMatcher.java
index cd594d9..1a1f6ca 100644
--- a/api-implementation/src/main/java/org/apache/clerezza/implementation/graphmatching/GraphMatcher.java
+++ b/api-implementation/src/main/java/org/apache/clerezza/implementation/graphmatching/GraphMatcher.java
@@ -20,7 +20,7 @@ package org.apache.clerezza.implementation.graphmatching;
import org.apache.clerezza.*;
import org.apache.clerezza.implementation.TripleImpl;
-import org.apache.clerezza.implementation.in_memory.SimpleMGraph;
+import org.apache.clerezza.implementation.in_memory.SimpleGraph;
import java.util.Iterator;
import java.util.Map;
@@ -63,8 +63,8 @@ public class GraphMatcher {
* @return a Set of NodePairs
*/
public static Map<BlankNode, BlankNode> getValidMapping(Graph og1, Graph og2) {
- Graph g1 = new SimpleMGraph(og1);
- Graph g2 = new SimpleMGraph(og2);
+ Graph g1 = new SimpleGraph(og1);
+ Graph g2 = new SimpleGraph(og2);
if (!Utils.removeGrounded(g1, g2)) {
return null;
}
diff --git a/api-implementation/src/main/java/org/apache/clerezza/implementation/in_memory/SimpleMGraph.java b/api-implementation/src/main/java/org/apache/clerezza/implementation/in_memory/SimpleMGraph.java
deleted file mode 100644
index 579c2e1..0000000
--- a/api-implementation/src/main/java/org/apache/clerezza/implementation/in_memory/SimpleMGraph.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.clerezza.implementation.in_memory;
-
-import org.apache.clerezza.Graph;
-import org.apache.clerezza.Triple;
-import org.apache.clerezza.implementation.in_memory.SimpleGraph;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * @author reto
- * @deprecated Use SimpleGraph
- */
-@Deprecated
-public class SimpleMGraph extends SimpleGraph implements Graph {
-
- /**
- * Creates an empty SimpleMGraph
- */
- public SimpleMGraph() {
- }
-
- public SimpleMGraph(Set<Triple> baseSet) {
- super(baseSet);
- }
-
- public SimpleMGraph(Collection<Triple> baseCollection) {
- super(baseCollection);
- }
-
- public SimpleMGraph(Iterator<Triple> iterator) {
- super(iterator);
- }
-
-}
diff --git a/api-implementation/src/test/java/org/apache/clerezza/implementation/graphmatching/GraphMatcherTest.java b/api-implementation/src/test/java/org/apache/clerezza/implementation/graphmatching/GraphMatcherTest.java
index 3140a46..bf09547 100644
--- a/api-implementation/src/test/java/org/apache/clerezza/implementation/graphmatching/GraphMatcherTest.java
+++ b/api-implementation/src/test/java/org/apache/clerezza/implementation/graphmatching/GraphMatcherTest.java
@@ -17,12 +17,12 @@
*/
package org.apache.clerezza.implementation.graphmatching;
-import org.apache.clerezza.BlankNodeOrIRI;
import org.apache.clerezza.BlankNode;
+import org.apache.clerezza.BlankNodeOrIRI;
import org.apache.clerezza.Graph;
import org.apache.clerezza.IRI;
import org.apache.clerezza.implementation.TripleImpl;
-import org.apache.clerezza.implementation.in_memory.SimpleMGraph;
+import org.apache.clerezza.implementation.in_memory.SimpleGraph;
import org.junit.Assert;
import org.junit.Test;
@@ -37,8 +37,8 @@ public class GraphMatcherTest {
@Test
public void testEmpty() {
- Graph tc1 = new SimpleMGraph();
- Graph tc2 = new SimpleMGraph();
+ Graph tc1 = new SimpleGraph();
+ Graph tc2 = new SimpleGraph();
final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
Assert.assertNotNull(mapping);
Assert.assertEquals(0, mapping.size());
@@ -46,18 +46,18 @@ public class GraphMatcherTest {
@Test
public void test2() {
- Graph tc1 = new SimpleMGraph();
+ Graph tc1 = new SimpleGraph();
tc1.add(new TripleImpl(u1, u1, u1));
- Graph tc2 = new SimpleMGraph();
+ Graph tc2 = new SimpleGraph();
final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
Assert.assertNull(mapping);
}
@Test
public void test3() {
- Graph tc1 = new SimpleMGraph();
+ Graph tc1 = new SimpleGraph();
tc1.add(new TripleImpl(u1, u1, u1));
- Graph tc2 = new SimpleMGraph();
+ Graph tc2 = new SimpleGraph();
tc2.add(new TripleImpl(u1, u1, u1));
final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
Assert.assertNotNull(mapping);
@@ -66,9 +66,9 @@ public class GraphMatcherTest {
@Test
public void test4() {
- Graph tc1 = new SimpleMGraph();
+ Graph tc1 = new SimpleGraph();
tc1.add(new TripleImpl(u1, u1, new BlankNode()));
- Graph tc2 = new SimpleMGraph();
+ Graph tc2 = new SimpleGraph();
tc2.add(new TripleImpl(u1, u1, new BlankNode()));
final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
Assert.assertNotNull(mapping);
@@ -77,9 +77,9 @@ public class GraphMatcherTest {
@Test
public void test5() {
- Graph tc1 = new SimpleMGraph();
+ Graph tc1 = new SimpleGraph();
tc1.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
- Graph tc2 = new SimpleMGraph();
+ Graph tc2 = new SimpleGraph();
tc2.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
Assert.assertNotNull(mapping);
@@ -88,11 +88,11 @@ public class GraphMatcherTest {
@Test
public void test6() {
- Graph tc1 = new SimpleMGraph();
+ Graph tc1 = new SimpleGraph();
final BlankNode b11 = new BlankNode();
tc1.add(new TripleImpl(new BlankNode(), u1, b11));
tc1.add(new TripleImpl(new BlankNode(), u1, b11));
- Graph tc2 = new SimpleMGraph();
+ Graph tc2 = new SimpleGraph();
tc2.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
Assert.assertNull(mapping);
@@ -106,7 +106,7 @@ public class GraphMatcherTest {
if (size < 1) {
throw new IllegalArgumentException();
}
- Graph result = new SimpleMGraph();
+ Graph result = new SimpleGraph();
BlankNodeOrIRI lastNode = firstNode;
for (int i = 0; i < (size - 1); i++) {
final BlankNode newNode = new BlankNode();
diff --git a/api-implementation/src/test/java/org/apache/clerezza/implementation/graphmatching/Utils4Testing.java b/api-implementation/src/test/java/org/apache/clerezza/implementation/graphmatching/Utils4Testing.java
index f2dbb34..6cbf045 100644
--- a/api-implementation/src/test/java/org/apache/clerezza/implementation/graphmatching/Utils4Testing.java
+++ b/api-implementation/src/test/java/org/apache/clerezza/implementation/graphmatching/Utils4Testing.java
@@ -23,7 +23,7 @@ import org.apache.clerezza.BlankNodeOrIRI;
import org.apache.clerezza.Graph;
import org.apache.clerezza.IRI;
import org.apache.clerezza.implementation.TripleImpl;
-import org.apache.clerezza.implementation.in_memory.SimpleMGraph;
+import org.apache.clerezza.implementation.in_memory.SimpleGraph;
/**
* @author reto
@@ -34,7 +34,7 @@ public class Utils4Testing {
if (size < 1) {
throw new IllegalArgumentException();
}
- Graph result = new SimpleMGraph();
+ Graph result = new SimpleGraph();
BlankNodeOrIRI lastNode = firstNode;
for (int i = 0; i < size; i++) {
final BlankNode newNode = new BlankNode();
diff --git a/dataset/src/test/java/org/apache/clerezza/dataset/TcManagerTest.java b/dataset/src/test/java/org/apache/clerezza/dataset/TcManagerTest.java
index 9b481cc..99017aa 100644
--- a/dataset/src/test/java/org/apache/clerezza/dataset/TcManagerTest.java
+++ b/dataset/src/test/java/org/apache/clerezza/dataset/TcManagerTest.java
@@ -22,12 +22,12 @@ import org.apache.clerezza.Graph;
import org.apache.clerezza.IRI;
import org.apache.clerezza.ImmutableGraph;
import org.apache.clerezza.Triple;
-import org.apache.clerezza.implementation.TripleImpl;
-import org.apache.clerezza.implementation.in_memory.SimpleMGraph;
import org.apache.clerezza.dataset.providers.WeightedA;
import org.apache.clerezza.dataset.providers.WeightedA1;
import org.apache.clerezza.dataset.providers.WeightedAHeavy;
import org.apache.clerezza.dataset.providers.WeightedBlight;
+import org.apache.clerezza.implementation.TripleImpl;
+import org.apache.clerezza.implementation.in_memory.SimpleGraph;
import org.apache.clerezza.sparql.NoQueryEngineException;
import org.apache.clerezza.sparql.QueryEngine;
import org.apache.clerezza.sparql.query.*;
@@ -39,7 +39,8 @@ import org.mockito.Mockito;
import java.lang.reflect.Field;
import java.util.Iterator;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
/**
*
@@ -139,7 +140,7 @@ public class TcManagerTest {
injectQueryEngine(null);
// Execute
- graphAccess.executeSparqlQuery("", new SimpleMGraph());
+ graphAccess.executeSparqlQuery("", new SimpleGraph());
}
@Test(expected = NoQueryEngineException.class)
@@ -148,7 +149,7 @@ public class TcManagerTest {
injectQueryEngine(null);
// Execute
- graphAccess.executeSparqlQuery((Query) null, new SimpleMGraph());
+ graphAccess.executeSparqlQuery((Query) null, new SimpleGraph());
}
@Test(expected = NoQueryEngineException.class)
@@ -157,7 +158,7 @@ public class TcManagerTest {
injectQueryEngine(null);
// Execute
- graphAccess.executeSparqlQuery((SelectQuery) null, new SimpleMGraph());
+ graphAccess.executeSparqlQuery((SelectQuery) null, new SimpleGraph());
}
@Test(expected = NoQueryEngineException.class)
@@ -166,7 +167,7 @@ public class TcManagerTest {
injectQueryEngine(null);
// Execute
- graphAccess.executeSparqlQuery((AskQuery) null, new SimpleMGraph());
+ graphAccess.executeSparqlQuery((AskQuery) null, new SimpleGraph());
}
@Test(expected = NoQueryEngineException.class)
@@ -176,7 +177,7 @@ public class TcManagerTest {
// Execute
graphAccess
- .executeSparqlQuery((DescribeQuery) null, new SimpleMGraph());
+ .executeSparqlQuery((DescribeQuery) null, new SimpleGraph());
}
@Test(expected = NoQueryEngineException.class)
@@ -186,14 +187,14 @@ public class TcManagerTest {
// Execute
graphAccess.executeSparqlQuery((ConstructQuery) null,
- new SimpleMGraph());
+ new SimpleGraph());
}
@Test
public void executeSparqlQueryWithEngineWithString() throws Exception {
// Prepare
injectQueryEngine(queryEngine);
- Graph Graph = new SimpleMGraph();
+ Graph Graph = new SimpleGraph();
// Execute
graphAccess.executeSparqlQuery("", Graph);
@@ -210,7 +211,7 @@ public class TcManagerTest {
public void executeSparqlQueryWithEngineWithSelectQuery() throws Exception {
// Prepare
injectQueryEngine(queryEngine);
- Graph Graph = new SimpleMGraph();
+ Graph Graph = new SimpleGraph();
SelectQuery query = Mockito.mock(SelectQuery.class);
// Execute
@@ -228,7 +229,7 @@ public class TcManagerTest {
public void executeSparqlQueryWithEngineWithAskQuery() throws Exception {
// Prepare
injectQueryEngine(queryEngine);
- Graph Graph = new SimpleMGraph();
+ Graph Graph = new SimpleGraph();
AskQuery query = Mockito.mock(AskQuery.class);
Mockito.when(
@@ -252,7 +253,7 @@ public class TcManagerTest {
throws Exception {
// Prepare
injectQueryEngine(queryEngine);
- Graph Graph = new SimpleMGraph();
+ Graph Graph = new SimpleGraph();
DescribeQuery query = Mockito.mock(DescribeQuery.class);
// Execute
@@ -271,7 +272,7 @@ public class TcManagerTest {
throws Exception {
// Prepare
injectQueryEngine(queryEngine);
- Graph Graph = new SimpleMGraph();
+ Graph Graph = new SimpleGraph();
ConstructQuery query = Mockito.mock(ConstructQuery.class);
// Execute
diff --git a/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedA.java b/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedA.java
index 07ef6cf..61547fe 100644
--- a/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedA.java
+++ b/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedA.java
@@ -21,12 +21,12 @@ package org.apache.clerezza.dataset.providers;
import org.apache.clerezza.Graph;
import org.apache.clerezza.IRI;
import org.apache.clerezza.ImmutableGraph;
-import org.apache.clerezza.implementation.TripleImpl;
-import org.apache.clerezza.implementation.in_memory.SimpleMGraph;
import org.apache.clerezza.dataset.EntityUndeletableException;
import org.apache.clerezza.dataset.NoSuchEntityException;
import org.apache.clerezza.dataset.TcManagerTest;
import org.apache.clerezza.dataset.WeightedTcProvider;
+import org.apache.clerezza.implementation.TripleImpl;
+import org.apache.clerezza.implementation.in_memory.SimpleGraph;
import java.util.Collections;
import java.util.HashSet;
@@ -46,7 +46,7 @@ public class WeightedA implements WeightedTcProvider {
@Override
public ImmutableGraph getImmutableGraph(IRI name) throws NoSuchEntityException {
if (name.equals(TcManagerTest.uriRefA)) {
- Graph mResult = new SimpleMGraph();
+ Graph mResult = new SimpleGraph();
mResult.add(new TripleImpl(TcManagerTest.uriRefA,
TcManagerTest.uriRefA, TcManagerTest.uriRefA));
mGraphList.add(name);
diff --git a/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedA1.java b/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedA1.java
index c9eafd5..139f4e1 100644
--- a/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedA1.java
+++ b/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedA1.java
@@ -22,11 +22,11 @@ import org.apache.clerezza.Graph;
import org.apache.clerezza.IRI;
import org.apache.clerezza.ImmutableGraph;
import org.apache.clerezza.implementation.TripleImpl;
-import org.apache.clerezza.implementation.in_memory.SimpleMGraph;
import org.apache.clerezza.dataset.EntityUndeletableException;
import org.apache.clerezza.dataset.NoSuchEntityException;
import org.apache.clerezza.dataset.TcManagerTest;
import org.apache.clerezza.dataset.WeightedTcProvider;
+import org.apache.clerezza.implementation.in_memory.SimpleGraph;
import java.util.HashSet;
import java.util.Set;
@@ -46,7 +46,7 @@ public class WeightedA1 implements WeightedTcProvider {
@Override
public ImmutableGraph getImmutableGraph(IRI name) throws NoSuchEntityException {
if (name.equals(TcManagerTest.uriRefA)) {
- Graph mResult = new SimpleMGraph();
+ Graph mResult = new SimpleGraph();
mResult.add(new TripleImpl(TcManagerTest.uriRefA1,
TcManagerTest.uriRefA1, TcManagerTest.uriRefA1));
mGraphList.add(name);
diff --git a/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedBlight.java b/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedBlight.java
index 79033e8..6753f8c 100644
--- a/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedBlight.java
+++ b/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedBlight.java
@@ -21,12 +21,12 @@ package org.apache.clerezza.dataset.providers;
import org.apache.clerezza.Graph;
import org.apache.clerezza.IRI;
import org.apache.clerezza.ImmutableGraph;
-import org.apache.clerezza.implementation.TripleImpl;
-import org.apache.clerezza.implementation.in_memory.SimpleMGraph;
import org.apache.clerezza.dataset.EntityUndeletableException;
import org.apache.clerezza.dataset.NoSuchEntityException;
import org.apache.clerezza.dataset.TcManagerTest;
import org.apache.clerezza.dataset.WeightedTcProvider;
+import org.apache.clerezza.implementation.TripleImpl;
+import org.apache.clerezza.implementation.in_memory.SimpleGraph;
import java.util.HashSet;
import java.util.Set;
@@ -45,12 +45,12 @@ public class WeightedBlight implements WeightedTcProvider {
@Override
public ImmutableGraph getImmutableGraph(IRI name) throws NoSuchEntityException {
if (name.equals(TcManagerTest.uriRefB)) {
- Graph mResult = new SimpleMGraph();
+ Graph mResult = new SimpleGraph();
mResult.add(new TripleImpl(TcManagerTest.uriRefB, TcManagerTest.uriRefB, TcManagerTest.uriRefB));
return mResult.getImmutableGraph();
}
if (name.equals(TcManagerTest.uriRefA)) {
- Graph mResult = new SimpleMGraph();
+ Graph mResult = new SimpleGraph();
//empty ImmutableGraph
return mResult.getImmutableGraph();
}
diff --git a/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedDummy.java b/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedDummy.java
index 28e6a3c..43d463a 100644
--- a/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedDummy.java
+++ b/dataset/src/test/java/org/apache/clerezza/dataset/providers/WeightedDummy.java
@@ -21,12 +21,12 @@ package org.apache.clerezza.dataset.providers;
import org.apache.clerezza.Graph;
import org.apache.clerezza.IRI;
import org.apache.clerezza.ImmutableGraph;
-import org.apache.clerezza.implementation.in_memory.SimpleImmutableGraph;
-import org.apache.clerezza.implementation.in_memory.SimpleMGraph;
import org.apache.clerezza.dataset.EntityAlreadyExistsException;
import org.apache.clerezza.dataset.EntityUndeletableException;
import org.apache.clerezza.dataset.NoSuchEntityException;
import org.apache.clerezza.dataset.WeightedTcProvider;
+import org.apache.clerezza.implementation.in_memory.SimpleGraph;
+import org.apache.clerezza.implementation.in_memory.SimpleImmutableGraph;
import java.util.HashMap;
import java.util.HashSet;
@@ -79,7 +79,7 @@ public class WeightedDummy implements WeightedTcProvider {
// already exists
this.getGraph(name);
} catch (NoSuchEntityException e) {
- Graph result = new SimpleMGraph();
+ Graph result = new SimpleGraph();
tripleMap.put(name, result);
return result;
}
diff --git a/representation/src/main/java/org/apache/clerezza/representation/Parser.java b/representation/src/main/java/org/apache/clerezza/representation/Parser.java
index 440ed7a..4908bb3 100644
--- a/representation/src/main/java/org/apache/clerezza/representation/Parser.java
+++ b/representation/src/main/java/org/apache/clerezza/representation/Parser.java
@@ -21,7 +21,7 @@ package org.apache.clerezza.representation;
import org.apache.clerezza.Graph;
import org.apache.clerezza.IRI;
import org.apache.clerezza.ImmutableGraph;
-import org.apache.clerezza.implementation.in_memory.SimpleMGraph;
+import org.apache.clerezza.implementation.in_memory.SimpleGraph;
import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.*;
@@ -190,7 +190,7 @@ public class Parser {
*/
public ImmutableGraph parse(InputStream serializedGraph,
String formatIdentifier, IRI baseUri) throws UnsupportedFormatException {
- Graph graph = new SimpleMGraph();
+ Graph graph = new SimpleGraph();
parse(graph, serializedGraph, formatIdentifier, baseUri);
return graph.getImmutableGraph();
}