diff --git a/.travis.yml b/.travis.yml
index 29a226e2..a311838b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,3 +6,10 @@ notifications:
email: false
after_success:
- mvn clean test jacoco:report coveralls:report
+arch:
+ - amd64
+ - ppc64le
+
+cache:
+ directories:
+ - $HOME/.m2
diff --git a/README.md b/README.md
index 2270d45c..f1102e69 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ From Maven
com.github.jsonld-java
jsonld-java
- 0.13.0
+ 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.0
+ 0.13.5
4.0.0
jsonld-java-{your module}
- 0.13.0-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,37 @@ 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
+* Fix Guava dependency shading (Reported by @ggrasso)
+* Fix @context issues when using a remote context (Patch by @umbreak)
+* Deprecate Context.serialize (Patch by @umbreak)
+
+### 2020-09-09
+* Release 0.13.1
+* Fix java.net.URI resolution (Reported by @ebremer and @afs, Patch by @dr0i)
+* Shade Guava failureaccess module (Patch by @peacekeeper)
+* Don't minimize Guava class shading (Patch by @elahrvivaz)
+* Follow link headers to @context files (Patch by @dr0i and @fsteeg)
### 2019-11-28
* Release 0.13.0
diff --git a/core/pom.xml b/core/pom.xml
index c7ca4139..f14fb287 100755
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -4,7 +4,7 @@
jsonld-java-parent
com.github.jsonld-java
- 0.13.1-SNAPSHOT
+ 0.13.6
4.0.0
jsonld-java
@@ -53,8 +53,8 @@
test
- org.slf4j
- slf4j-log4j12
+ ch.qos.logback
+ logback-classic
test
@@ -74,6 +74,7 @@
com.google.guava:guava
+ com.google.guava:failureaccess
@@ -81,8 +82,11 @@
com.google.common
com.github.jsonldjava.shaded.com.google.common
+
+ com.google.thirdparty
+ com.github.jsonldjava.shaded.com.google.thirdparty
+
- true
com.google.guava:guava
@@ -90,6 +94,12 @@
META-INF/maven/**
+
+ com.google.guava:failureaccess
+
+ META-INF/maven/**
+
+
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 8c149b08..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)) {
@@ -304,9 +310,7 @@ public Context parse(Object localContext) throws JsonLdError {
*
* http://json-ld.org/spec/latest/json-ld-api/#create-term-definition
*
- * @param result
* @param context
- * @param key
* @param defined
* @throws JsonLdError
*/
@@ -572,7 +576,7 @@ else if (relative) {
* the IRI to compact.
* @param value
* the value to check or null.
- * @param relativeTo
+ * @param relativeToVocab
* options for how to compact IRIs: vocab: true to split
* after @vocab, false not to.
* @param reverse
@@ -1147,6 +1151,7 @@ else if (this.get(JsonLdConsts.LANGUAGE) != null) {
return rval;
}
+ @Deprecated
public Map serialize() {
final Map ctx = newMap();
if (this.get(JsonLdConsts.BASE) != null
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