diff --git a/.travis.yml b/.travis.yml
index df26cdc0..a311838b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,3 +9,7 @@ after_success:
arch:
- amd64
- ppc64le
+
+cache:
+ directories:
+ - $HOME/.m2
diff --git a/README.md b/README.md
index d1f5a5cc..f1102e69 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ From Maven
com.github.jsonld-java
jsonld-java
- 0.13.2
+ 0.13.5
Code example
@@ -323,11 +323,11 @@ Here is the basic outline for what your module's pom.xml should look like
com.github.jsonld-java
jsonld-java-parent
- 0.13.2
+ 0.13.5
4.0.0
jsonld-java-{your module}
- 0.13.2-SNAPSHOT
+ 0.13.5-SNAPSHOT
JSONLD Java :: {your module name}
JSON-LD Java integration module for {RDF Library your module integrates}
jar
@@ -449,6 +449,24 @@ Alternatively, we can also host your repository in the jsonld-java organisation
CHANGELOG
=========
+### 2023-11-06
+* Release 0.13.6
+* Bump Jackson-databind version to latest for security update
+
+### 2023-11-03
+* Release 0.13.5
+* Bump Jackson and Guava versions to latest for security updates
+
+### 2021-12-13
+* Release 0.13.4
+* Switch test logging from log4j to logback (Patch by @ansell)
+* Improve Travis CI build Performance (Patch by @YunLemon)
+
+### 2021-03-06
+* Release 0.13.3
+* Fix @type when subject and object are the same (Reported by @barthanssens, Patch by @umbreak)
+* Ignore @base if remote context is not relative (Reported by @whikloj, Patch by @dr0i)
+* Fix throwing recursive context inclusion (Patch by @umbreak)
### 2020-09-24
* Release 0.13.2
diff --git a/core/pom.xml b/core/pom.xml
index b771cbee..f14fb287 100755
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -4,7 +4,7 @@
jsonld-java-parent
com.github.jsonld-java
- 0.13.3-SNAPSHOT
+ 0.13.6
4.0.0
jsonld-java
@@ -53,8 +53,8 @@
test
- org.slf4j
- slf4j-log4j12
+ ch.qos.logback
+ logback-classic
test
diff --git a/core/src/main/java/com/github/jsonldjava/core/Context.java b/core/src/main/java/com/github/jsonldjava/core/Context.java
index bff79d8c..4e563d78 100644
--- a/core/src/main/java/com/github/jsonldjava/core/Context.java
+++ b/core/src/main/java/com/github/jsonldjava/core/Context.java
@@ -9,6 +9,7 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.regex.Pattern;
import com.github.jsonldjava.core.JsonLdError.Error;
import com.github.jsonldjava.utils.JsonLdUrl;
@@ -25,6 +26,7 @@ public class Context extends LinkedHashMap {
private static final long serialVersionUID = 2894534897574805571L;
+ private static final Pattern URL_PATTERN = Pattern.compile("^https?://.*$", Pattern.CASE_INSENSITIVE);
private JsonLdOptions options;
private Map termDefinitions;
public Map inverse = null;
@@ -141,8 +143,10 @@ && getTermDefinition(activeProperty).containsKey(JsonLdConsts.LANGUAGE)
* @throws JsonLdError
* If there is an error parsing the contexts.
*/
- @SuppressWarnings("unchecked")
public Context parse(Object localContext, List remoteContexts) throws JsonLdError {
+ if (remoteContexts == null) {
+ remoteContexts = new ArrayList();
+ }
return parse(localContext, remoteContexts, false);
}
@@ -163,11 +167,8 @@ public Context parse(Object localContext, List remoteContexts) throws Js
* @throws JsonLdError
* If there is an error parsing the contexts.
*/
- private Context parse(Object localContext, List remoteContexts,
+ private Context parse(Object localContext, final List remoteContexts,
boolean parsingARemoteContext) throws JsonLdError {
- if (remoteContexts == null) {
- remoteContexts = new ArrayList();
- }
// 1. Initialize result to the result of cloning active context.
Context result = this.clone(); // TODO: clone?
// 2)
@@ -187,13 +188,18 @@ private Context parse(Object localContext, List remoteContexts,
}
// 3.2)
else if (context instanceof String) {
- String uri = (String) result.get(JsonLdConsts.BASE);
+ String uri = null;
+ // @base is ignored when processing remote contexts, https://github.com/jsonld-java/jsonld-java/issues/304
+ if (!URL_PATTERN.matcher(context.toString()).matches()) {
+ uri = (String) result.get(JsonLdConsts.BASE);
+ }
uri = JsonLdUrl.resolve(uri, (String) context);
// 3.2.2
if (remoteContexts.contains(uri)) {
throw new JsonLdError(Error.RECURSIVE_CONTEXT_INCLUSION, uri);
}
- remoteContexts.add(uri);
+ List nextRemoteContexts = new ArrayList<>(remoteContexts);
+ nextRemoteContexts.add(uri);
// 3.2.3: Dereference context
final RemoteDocument rd = this.options.getDocumentLoader().loadDocument(uri);
@@ -208,7 +214,7 @@ else if (context instanceof String) {
.get(JsonLdConsts.CONTEXT);
// 3.2.4
- result = result.parse(tempContext, remoteContexts, true);
+ result = result.parse(tempContext, nextRemoteContexts, true);
// 3.2.5
continue;
} else if (!(context instanceof Map)) {
diff --git a/core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java b/core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java
index 74cea926..2195d09a 100644
--- a/core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java
+++ b/core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java
@@ -2001,7 +2001,8 @@ public List