Change CC RE from CC-BY.* to CC.*
Includes more liberal CC variants than CC-BY and different spellings
like "CC BY" into the "free" class.
Change-Id: Ie4f05efc5803f1e7f01e004a0433468e75e0a53a
diff --git a/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java b/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java
index 819f7a3..07f4485 100644
--- a/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java
+++ b/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java
@@ -81,7 +81,7 @@
+ "\"foundry\"}]}},\"@context\":\"http://korap.ids-mannheim.de/ns"
+ "/koral/0.3/context.jsonld\",\"collection\":{\"@type\":\"koral:"
+ "doc\",\"match\":\"match:eq\",\"type\":\"type:regex\",\"value\":"
- + "\"CC-BY.*\",\"key\":\"availability\",\"rewrites\":[{\"@type\":"
+ + "\"CC.*\",\"key\":\"availability\",\"rewrites\":[{\"@type\":"
+ "\"koral:rewrite\",\"src\":\"Kustvakt\",\"operation\":\"operation:"
+ "insertion\",\"scope\":\"availability(FREE)\"}]}}";
int cacheKey = searchService.createTotalResultCacheKey(query);
diff --git a/src/test/java/de/ids_mannheim/korap/rewrite/CollectionRewriteTest.java b/src/test/java/de/ids_mannheim/korap/rewrite/CollectionRewriteTest.java
index e205ce3..7a19e1f 100644
--- a/src/test/java/de/ids_mannheim/korap/rewrite/CollectionRewriteTest.java
+++ b/src/test/java/de/ids_mannheim/korap/rewrite/CollectionRewriteTest.java
@@ -180,7 +180,7 @@
User.UserFactory.getUser("test_user")));
assertNotNull(node);
assertEquals(node.at("/collection/key").asText(), "availability");
- assertEquals(node.at("/collection/value").asText(), "CC-BY.*");
+ assertEquals(node.at("/collection/value").asText(), "CC.*");
assertEquals(node.at("/collection/rewrites/0/@type").asText(),
"koral:rewrite");
assertEquals(node.at("/collection/rewrites/0/scope").asText(),
@@ -204,7 +204,7 @@
assertEquals(node.at("/collection/operands/0/key").asText(),
"availability");
assertEquals(node.at("/collection/operands/0/value").asText(),
- "CC-BY.*");
+ "CC.*");
assertEquals(node.at("/collection/operands/1/operands/0/key").asText(),
"docSigle");
assertEquals(node.at("/collection/operands/1/operands/1/key").asText(),
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java
index 42d7a68..4ad3ba3 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java
@@ -24,7 +24,7 @@
assertEquals(node.at("/collection/operands/0/key").asText(),
"availability");
assertEquals(node.at("/collection/operands/0/value").asText(),
- "CC-BY.*");
+ "CC.*");
assertEquals(node.at("/collection/rewrites/0/operation").asText(),
"operation:insertion");
assertEquals(node.at("/collection/rewrites/0/scope").asText(),
@@ -45,7 +45,7 @@
"availability");
assertEquals(
node.at("/collection/operands/0/operands/0/value").asText(),
- "CC-BY.*");
+ "CC.*");
assertEquals(
node.at("/collection/operands/0/operands/1/operands/0/match")
.asText(),
@@ -88,7 +88,7 @@
assertEquals(node.at("/operands/0/match").asText(), "match:eq");
assertEquals(node.at("/operands/0/type").asText(), "type:regex");
assertEquals(node.at("/operands/0/key").asText(), "availability");
- assertEquals(node.at("/operands/0/value").asText(), "CC-BY.*");
+ assertEquals(node.at("/operands/0/value").asText(), "CC.*");
assertEquals(node.at("/operands/1/operands/0/match").asText(),
"match:eq");
assertEquals(node.at("/operands/1/operands/0/type").asText(),
@@ -118,7 +118,7 @@
assertEquals(node.at("/operands/0/match").asText(), "match:eq");
assertEquals(node.at("/operands/0/type").asText(), "type:regex");
assertEquals(node.at("/operands/0/key").asText(), "availability");
- assertEquals(node.at("/operands/0/value").asText(), "CC-BY.*");
+ assertEquals(node.at("/operands/0/value").asText(), "CC.*");
assertEquals(
node.at("/operands/1/operands/1/operands/0/match").asText(),
"match:eq");
@@ -184,7 +184,7 @@
@Test
public void testAvailabilityRegexNoRewrite () throws KustvaktException {
Response response = searchQuery(
- "availability = /CC-BY.*/ & availability = /ACA.*/");
+ "availability = /CC.*/ & availability = /ACA.*/");
assertEquals(Status.OK.getStatusCode(), response.getStatus());
String json = response.readEntity(String.class);
JsonNode node = JsonUtils.readTree(json);
@@ -197,7 +197,7 @@
assertEquals(node.at("/collection/operands/0/key").asText(),
"availability");
assertEquals(node.at("/collection/operands/0/value").asText(),
- "CC-BY.*");
+ "CC.*");
assertEquals(node.at("/collection/operands/1/match").asText(),
"match:eq");
assertEquals(node.at("/collection/operands/1/value").asText(), "ACA.*");
@@ -215,7 +215,7 @@
@Test
public void testNegationAvailabilityFreeUnauthorized ()
throws KustvaktException {
- Response response = searchQuery("availability != /CC-BY.*/");
+ Response response = searchQuery("availability != /CC.*/");
assertEquals(Status.OK.getStatusCode(), response.getStatus());
checkAndFree(response.readEntity(String.class));
}
@@ -232,7 +232,7 @@
public void testNegationAvailabilityWithOperationOrUnauthorized ()
throws KustvaktException {
Response response = searchQuery(
- "availability = /CC-BY.*/ | availability != /CC-BY.*/");
+ "availability = /CC.*/ | availability != /CC.*/");
assertEquals(Status.OK.getStatusCode(), response.getStatus());
checkAndFree(response.readEntity(String.class));
}
@@ -241,7 +241,7 @@
public void testComplexNegationAvailabilityFreeUnauthorized ()
throws KustvaktException {
Response response = searchQuery(
- "textClass=politik & availability != /CC-BY.*/");
+ "textClass=politik & availability != /CC.*/");
assertEquals(Status.OK.getStatusCode(), response.getStatus());
checkAndFree(response.readEntity(String.class));
}
@@ -338,7 +338,7 @@
@Test
public void testAvailabilityOr () throws KustvaktException {
Response response = searchQuery(
- "availability=/CC-BY.*/ | availability=/ACA.*/");
+ "availability=/CC.*/ | availability=/ACA.*/");
assertEquals(Status.OK.getStatusCode(), response.getStatus());
checkAndFree(response.readEntity(String.class));
}
@@ -346,7 +346,7 @@
@Test
public void testRedundancyOrPub () throws KustvaktException {
Response response = searchQueryWithIP(
- "availability=/CC-BY.*/ | availability=/ACA.*/ | availability=/QAO-NC/",
+ "availability=/CC.*/ | availability=/ACA.*/ | availability=/QAO-NC/",
"149.27.0.32");
assertEquals(Status.OK.getStatusCode(), response.getStatus());
String json = response.readEntity(String.class);
@@ -358,7 +358,7 @@
@Test
public void testAvailabilityOrCorpusSigle () throws KustvaktException {
Response response = searchQuery(
- "availability=/CC-BY.*/ | corpusSigle=GOE");
+ "availability=/CC.*/ | corpusSigle=GOE");
assertEquals(Status.OK.getStatusCode(), response.getStatus());
checkAndFree(response.readEntity(String.class));
}
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java
index 9e932fc..b17d2f3 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java
@@ -117,7 +117,7 @@
assertNotNull(node);
assertEquals(node.at("/collection/@type").asText(), "koral:doc");
assertEquals(node.at("/collection/key").asText(), "availability");
- assertEquals(node.at("/collection/value").asText(), "CC-BY.*");
+ assertEquals(node.at("/collection/value").asText(), "CC.*");
assertEquals(node.at("/collection/rewrites/0/scope").asText(),
"availability(FREE)");
assertEquals(node.at("/collection/rewrites/0/operation").asText(),
@@ -180,7 +180,7 @@
assertNotEquals(0, node.path("matches").size());
assertEquals(node.at("/collection/@type").asText(), "koral:doc");
assertEquals(node.at("/collection/key").asText(), "availability");
- assertEquals(node.at("/collection/value").asText(), "CC-BY.*");
+ assertEquals(node.at("/collection/value").asText(), "CC.*");
assertEquals(node.at("/collection/rewrites/0/scope").asText(),
"availability(FREE)");
assertEquals(node.at("/collection/rewrites/0/operation").asText(),
@@ -200,7 +200,7 @@
assertNotEquals(0, node.path("matches").size());
assertEquals(node.at("/collection/@type").asText(), "koral:doc");
assertEquals(node.at("/collection/key").asText(), "availability");
- assertEquals(node.at("/collection/value").asText(), "CC-BY.*");
+ assertEquals(node.at("/collection/value").asText(), "CC.*");
assertEquals(node.at("/collection/rewrites/0/scope").asText(),
"availability(FREE)");
assertEquals(node.at("/collection/rewrites/0/operation").asText(),
@@ -225,7 +225,7 @@
assertNotEquals(0, node.path("matches").size());
assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
assertEquals(node.at("/collection/operands/0/value").asText(),
- "CC-BY.*");
+ "CC.*");
assertEquals(
node.at("/collection/operands/1/operands/0/value").asText(),
"ACA.*");
@@ -257,7 +257,7 @@
// System.out.println(node);
assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
assertEquals(node.at("/collection/operands/0/value").asText(),
- "CC-BY.*");
+ "CC.*");
assertEquals(
node.at("/collection/operands/1/operands/0/value").asText(),
"ACA.*");
@@ -290,7 +290,7 @@
"operation:and");
assertEquals(2, node.at("/collection/operands").size());
assertEquals(node.at("/collection/operands/0/value").asText(),
- "CC-BY.*");
+ "CC.*");
assertEquals(node.at("/collection/operands/1/value").asText(),
"gingko");
assertEquals(node.at("/collection/operands/1/match").asText(),
@@ -321,7 +321,7 @@
assertEquals(node.at("/collection/operands/0/key").asText(),
"availability");
assertEquals(node.at("/collection/operands/0/value").asText(),
- "CC-BY.*");
+ "CC.*");
assertEquals(node.at("/collection/operands/1/operands/0/key").asText(),
"textClass");
assertEquals(node.at("/collection/operands/1/operands/1/key").asText(),
@@ -346,7 +346,7 @@
assertNotEquals(0, node.path("matches").size());
assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
assertEquals(node.at("/collection/operands/0/value").asText(),
- "CC-BY.*");
+ "CC.*");
assertEquals(node.at("/collection/operands/1/value").asText(), "ACA.*");
assertEquals(node.at("/collection/operation").asText(), "operation:or");
assertEquals(node.at("/collection/rewrites/0/scope").asText(),
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/StatisticsControllerTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/StatisticsControllerTest.java
index 8b2ec7c..61499b5 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/StatisticsControllerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/StatisticsControllerTest.java
@@ -135,7 +135,7 @@
.post(Entity.json("{ \"collection\" : {\"@type\": "
+ "\"koral:doc\", \"key\": \"availability\", \"match\": "
+ "\"match:eq\", \"type\": \"type:regex\", \"value\": "
- + "\"CC-BY.*\"} }"));
+ + "\"CC.*\"} }"));
assertEquals(response.getHeaders().getFirst("X-Index-Revision"),
"Wes8Bd4h1OypPqbWF5njeQ==");
assertEquals(Status.OK.getStatusCode(), response.getStatus());
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusReferenceTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusReferenceTest.java
index 3618c3a..db1df98 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusReferenceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusReferenceTest.java
@@ -128,7 +128,7 @@
@Test
public void testStatisticsWithRef () throws KustvaktException {
- String corpusQuery = "availability = /CC-BY.*/ & referTo named-vc1";
+ String corpusQuery = "availability = /CC.*/ & referTo named-vc1";
Response response = target().path(API_VERSION).path("statistics")
.queryParam("cq", corpusQuery).request().get();
String ent = response.readEntity(String.class);
@@ -185,7 +185,7 @@
JsonNode node = JsonUtils.readTree(ent);
assertTrue(node.at("/matches").size() > 0);
assertEquals(node.at("/collection/operands/0/value").asText(),
- "CC-BY.*");
+ "CC.*");
assertEquals(node.at("/collection/operands/1/@type").asText(),
"koral:doc");
assertEquals(node.at("/collection/operands/1/value").asText(), "GOE");
diff --git a/src/test/java/de/ids_mannheim/korap/web/lite/LiteStatisticControllerTest.java b/src/test/java/de/ids_mannheim/korap/web/lite/LiteStatisticControllerTest.java
index 141aafa..699536a 100644
--- a/src/test/java/de/ids_mannheim/korap/web/lite/LiteStatisticControllerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/lite/LiteStatisticControllerTest.java
@@ -68,7 +68,7 @@
.post(Entity.json("{ \"collection\" : {\"@type\": "
+ "\"koral:doc\", \"key\": \"availability\", \"match\": "
+ "\"match:eq\", \"type\": \"type:regex\", \"value\": "
- + "\"CC-BY.*\"} }"));
+ + "\"CC.*\"} }"));
assertEquals(Status.OK.getStatusCode(), response.getStatus());
String ent = response.readEntity(String.class);
assertEquals(response.getHeaders().getFirst("X-Index-Revision"),
diff --git a/src/test/resources/kustvakt-dnb.conf b/src/test/resources/kustvakt-dnb.conf
index 3b8d190..b23d474 100644
--- a/src/test/resources/kustvakt-dnb.conf
+++ b/src/test/resources/kustvakt-dnb.conf
@@ -63,7 +63,7 @@
# Availability regex only support |
# It should be removed/commented when the data doesn't contain availability field.
#
-availability.regex.free = CC-BY.*
+availability.regex.free = CC.*
availability.regex.public = ACA.*|QAO-NC
availability.regex.all = QAO.*
diff --git a/src/test/resources/kustvakt-icc.conf b/src/test/resources/kustvakt-icc.conf
index 84a38a8..a87e3f0 100644
--- a/src/test/resources/kustvakt-icc.conf
+++ b/src/test/resources/kustvakt-icc.conf
@@ -48,7 +48,7 @@
# availability regex only support |
# It should be removed/commented when the data doesn't contain availability field.
#
-# availability.regex.free = CC-BY.*
+# availability.regex.free = CC.*
# availability.regex.public = ACA.*|QAO-NC
# availability.regex.all = QAO.*
diff --git a/src/test/resources/kustvakt-test.conf b/src/test/resources/kustvakt-test.conf
index c88388f..b9c8f74 100644
--- a/src/test/resources/kustvakt-test.conf
+++ b/src/test/resources/kustvakt-test.conf
@@ -61,7 +61,7 @@
# Availability regex only support |
# It should be removed/commented when the data doesn't contain availability field.
#
-availability.regex.free = CC-BY.*
+availability.regex.free = CC.*
availability.regex.public = ACA.*|QAO-NC
availability.regex.all = QAO.*
diff --git a/src/test/resources/network-output/search-result.jsonld b/src/test/resources/network-output/search-result.jsonld
index da55e09..2c364fd 100644
--- a/src/test/resources/network-output/search-result.jsonld
+++ b/src/test/resources/network-output/search-result.jsonld
@@ -58,7 +58,7 @@
"@type": "koral:doc",
"match": "match:eq",
"type": "type:regex",
- "value": "CC-BY.*",
+ "value": "CC.*",
"key": "availability",
"rewrites": [
{