From a9b22ee90e100606c238c513423ef6e3d9fc5956 Mon Sep 17 00:00:00 2001 From: Didac Montero Date: Sat, 12 Dec 2020 14:53:41 +0100 Subject: [PATCH 01/23] Throw RECURSIVE_CONTEXT_INCLUSION only when cyclic dependency exists --- .../com/github/jsonldjava/core/Context.java | 13 ++-- .../jsonldjava/core/ContextRecursionTest.java | 75 +++++++++++++++++++ 2 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 core/src/test/java/com/github/jsonldjava/core/ContextRecursionTest.java 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..dafc43ce 100644 --- a/core/src/main/java/com/github/jsonldjava/core/Context.java +++ b/core/src/main/java/com/github/jsonldjava/core/Context.java @@ -143,6 +143,9 @@ && getTermDefinition(activeProperty).containsKey(JsonLdConsts.LANGUAGE) */ @SuppressWarnings("unchecked") public Context parse(Object localContext, List remoteContexts) throws JsonLdError { + if (remoteContexts == null) { + remoteContexts = new ArrayList(); + } return parse(localContext, remoteContexts, false); } @@ -163,11 +166,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) @@ -193,7 +193,8 @@ else if (context instanceof String) { 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 +209,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/test/java/com/github/jsonldjava/core/ContextRecursionTest.java b/core/src/test/java/com/github/jsonldjava/core/ContextRecursionTest.java new file mode 100644 index 00000000..4e92bd36 --- /dev/null +++ b/core/src/test/java/com/github/jsonldjava/core/ContextRecursionTest.java @@ -0,0 +1,75 @@ +package com.github.jsonldjava.core; + +import com.github.jsonldjava.utils.JsonUtils; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.io.IOException; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + + +public class ContextRecursionTest { + + @BeforeClass + public static void setup() { + System.setProperty(DocumentLoader.DISALLOW_REMOTE_CONTEXT_LOADING, "true"); + } + + @AfterClass + public static void tearDown() { + System.setProperty(DocumentLoader.DISALLOW_REMOTE_CONTEXT_LOADING, "false"); + } + + @Test + public void testAllowedRecursion() throws IOException { + + final String contextB = "{\"@context\": [\"http://localhost/d\", {\"b\": \"http://localhost/b\"} ] }"; + final String contextC = "{\"@context\": [\"http://localhost/d\", {\"c\": \"http://localhost/c\"} ] }"; + final String contextD = "{\"@context\": [\"http://localhost/e\", {\"d\": \"http://localhost/d\"} ] }"; + final String contextE = "{\"@context\": {\"e\": \"http://localhost/e\"} }"; + + final DocumentLoader dl = new DocumentLoader(); + dl.addInjectedDoc("http://localhost/b", contextB); + dl.addInjectedDoc("http://localhost/c", contextC); + dl.addInjectedDoc("http://localhost/d", contextD); + dl.addInjectedDoc("http://localhost/e", contextE); + final JsonLdOptions options = new JsonLdOptions(); + options.setDocumentLoader(dl); + + final String jsonString = "{\"@context\": [\"http://localhost/d\", \"http://localhost/b\", \"http://localhost/c\", {\"a\": \"http://localhost/a\"} ], \"a\": \"A\", \"b\": \"B\", \"c\": \"C\", \"d\": \"D\"}"; + final Object json = JsonUtils.fromString(jsonString); + final Object expanded = JsonLdProcessor.expand(json, options); + assertEquals( + "[{http://localhost/a=[{@value=A}], http://localhost/b=[{@value=B}], http://localhost/c=[{@value=C}], http://localhost/d=[{@value=D}]}]", + expanded.toString()); + } + + @Test + public void testCyclicRecursion() throws IOException { + + final String contextC = "{\"@context\": [\"http://localhost/d\", {\"c\": \"http://localhost/c\"} ] }"; + final String contextD = "{\"@context\": [\"http://localhost/e\", {\"d\": \"http://localhost/d\"} ] }"; + final String contextE = "{\"@context\": [\"http://localhost/c\", {\"e\": \"http://localhost/e\"} ] }"; + + final DocumentLoader dl = new DocumentLoader(); + dl.addInjectedDoc("http://localhost/c", contextC); + dl.addInjectedDoc("http://localhost/d", contextD); + dl.addInjectedDoc("http://localhost/e", contextE); + final JsonLdOptions options = new JsonLdOptions(); + options.setDocumentLoader(dl); + + final String jsonString = "{\"@context\": [\"http://localhost/c\", {\"a\": \"http://localhost/a\"} ]}"; + final Object json = JsonUtils.fromString(jsonString); + try { + JsonLdProcessor.expand(json, options); + fail("it should throw"); + } catch(JsonLdError err) { + assertEquals(err.getType(), JsonLdError.Error.RECURSIVE_CONTEXT_INCLUSION); + assertEquals(err.getMessage(), "recursive context inclusion: http://localhost/c"); + } + } + +} From 45c29428328abb78b7468d8d339b50a9044c9fcd Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 26 Jan 2021 14:26:20 +0100 Subject: [PATCH 02/23] Ignore @base if remote context is not relative If the remote context is not relative and seems to be a http URI don't prefix the base IRI to it. The remote context is not validated nor tested if it's resolvable. It's just tested if it's not a relative URI - which is totally possible and would, in conjunction with a base IRI, made into valid remote context. See #304. --- .../java/com/github/jsonldjava/core/Context.java | 6 +++++- .../github/jsonldjava/core/DocumentLoaderTest.java | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) 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..a5277259 100644 --- a/core/src/main/java/com/github/jsonldjava/core/Context.java +++ b/core/src/main/java/com/github/jsonldjava/core/Context.java @@ -187,7 +187,11 @@ 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 (!context.toString().matches("^[hH][tT][tT][pP][sS]?://.*")) { + uri = (String) result.get(JsonLdConsts.BASE); + } uri = JsonLdUrl.resolve(uri, (String) context); // 3.2.2 if (remoteContexts.contains(uri)) { diff --git a/core/src/test/java/com/github/jsonldjava/core/DocumentLoaderTest.java b/core/src/test/java/com/github/jsonldjava/core/DocumentLoaderTest.java index c16d40b5..57b8f5ce 100644 --- a/core/src/test/java/com/github/jsonldjava/core/DocumentLoaderTest.java +++ b/core/src/test/java/com/github/jsonldjava/core/DocumentLoaderTest.java @@ -381,11 +381,19 @@ public void testDisallowRemoteContexts() throws Exception { } @Test - public void injectContext() throws Exception { + public void testInjectContext() throws Exception { + injectContext(new JsonLdOptions()); + } + + @Test + public void testIssue304_remoteContextAndBaseIri() throws Exception { + injectContext(new JsonLdOptions("testing:baseIri")); + } + + private void injectContext(final JsonLdOptions options) throws Exception { final Object jsonObject = JsonUtils.fromString( "{ \"@context\":\"http://nonexisting.example.com/thing\", \"pony\":5 }"); - final JsonLdOptions options = new JsonLdOptions(); // Verify fails to find context by default try { From b6edd7b3d8b842aeeb6ad2a19fcf6a6c7e0a5d9b Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 26 Jan 2021 17:53:51 +0100 Subject: [PATCH 03/23] Fix order of assertEquals parameters - rename one test to point to the issue Complements a9b22ee90e100606c238c513423ef6e3d9fc5956. --- .../com/github/jsonldjava/core/ContextRecursionTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/com/github/jsonldjava/core/ContextRecursionTest.java b/core/src/test/java/com/github/jsonldjava/core/ContextRecursionTest.java index 4e92bd36..d6610121 100644 --- a/core/src/test/java/com/github/jsonldjava/core/ContextRecursionTest.java +++ b/core/src/test/java/com/github/jsonldjava/core/ContextRecursionTest.java @@ -24,7 +24,7 @@ public static void tearDown() { } @Test - public void testAllowedRecursion() throws IOException { + public void testIssue302_allowedRecursion() throws IOException { final String contextB = "{\"@context\": [\"http://localhost/d\", {\"b\": \"http://localhost/b\"} ] }"; final String contextC = "{\"@context\": [\"http://localhost/d\", {\"c\": \"http://localhost/c\"} ] }"; @@ -67,8 +67,8 @@ public void testCyclicRecursion() throws IOException { JsonLdProcessor.expand(json, options); fail("it should throw"); } catch(JsonLdError err) { - assertEquals(err.getType(), JsonLdError.Error.RECURSIVE_CONTEXT_INCLUSION); - assertEquals(err.getMessage(), "recursive context inclusion: http://localhost/c"); + assertEquals(JsonLdError.Error.RECURSIVE_CONTEXT_INCLUSION, err.getType()); + assertEquals("recursive context inclusion: http://localhost/c", err.getMessage()); } } From 9af0572b88a85fcfe5c8f35679d80d640c93e1eb Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 28 Jan 2021 16:07:09 +0100 Subject: [PATCH 04/23] Use precompiled pattern As proposed by @umbreak in #305. Complements 45c29428328abb78b7468d8d339b50a9044c9fcd. --- core/src/main/java/com/github/jsonldjava/core/Context.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 a5277259..069aaf2f 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; @@ -189,7 +191,7 @@ private Context parse(Object localContext, List remoteContexts, else if (context instanceof String) { String uri = null; // @base is ignored when processing remote contexts, https://github.com/jsonld-java/jsonld-java/issues/304 - if (!context.toString().matches("^[hH][tT][tT][pP][sS]?://.*")) { + if (!URL_PATTERN.matcher(context.toString()).matches()) { uri = (String) result.get(JsonLdConsts.BASE); } uri = JsonLdUrl.resolve(uri, (String) context); From 0ebe491206fc4165a21a551288f8bd8857118e0e Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 28 Jan 2021 16:11:48 +0100 Subject: [PATCH 05/23] Remove superflous @SuppressWarnings --- core/src/main/java/com/github/jsonldjava/core/Context.java | 1 - 1 file changed, 1 deletion(-) 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 069aaf2f..0fad5e63 100644 --- a/core/src/main/java/com/github/jsonldjava/core/Context.java +++ b/core/src/main/java/com/github/jsonldjava/core/Context.java @@ -143,7 +143,6 @@ && 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 { return parse(localContext, remoteContexts, false); } From 95cbd49e901760e608247292417973cdb7060d76 Mon Sep 17 00:00:00 2001 From: Didac Montero Date: Mon, 1 Feb 2021 11:50:14 +0100 Subject: [PATCH 06/23] rdfToJson edge case when object = subject and predicate = rdf:type --- .../com/github/jsonldjava/core/JsonLdApi.java | 3 +- .../jsonldjava/core/JsonLdToRdfTest.java | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 core/src/test/java/com/github/jsonldjava/core/JsonLdToRdfTest.java 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 fromRDF(final RDFDataset dataset, boolean noDuplicatesInData // 3.5.4) if (RDF_TYPE.equals(predicate) && (object.isIRI() || object.isBlankNode()) - && !opts.getUseRdfType() && !nodes.containsKey(object.getValue())) { + && !opts.getUseRdfType() && + (!nodes.containsKey(object.getValue()) || subject.equals(object.getValue()))) { JsonLdUtils.mergeValue(node, JsonLdConsts.TYPE, object.getValue()); continue; } diff --git a/core/src/test/java/com/github/jsonldjava/core/JsonLdToRdfTest.java b/core/src/test/java/com/github/jsonldjava/core/JsonLdToRdfTest.java new file mode 100644 index 00000000..7586c1c6 --- /dev/null +++ b/core/src/test/java/com/github/jsonldjava/core/JsonLdToRdfTest.java @@ -0,0 +1,31 @@ +package com.github.jsonldjava.core; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class JsonLdToRdfTest { + + @Test + public void testIssue301() throws JsonLdError { + final RDFDataset rdf = new RDFDataset(); + rdf.addTriple( + "http://www.w3.org/2002/07/owl#Class", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", + "http://www.w3.org/2002/07/owl#Class"); + final JsonLdOptions opts = new JsonLdOptions(); + opts.setUseRdfType(Boolean.FALSE); + opts.setProcessingMode(JsonLdOptions.JSON_LD_1_0); + + final Object out = new JsonLdApi(opts).fromRDF(rdf, true); + assertEquals("[{@id=http://www.w3.org/2002/07/owl#Class, @type=[http://www.w3.org/2002/07/owl#Class]}]", + out.toString()); + + opts.setUseRdfType(Boolean.TRUE); + + final Object out2 = new JsonLdApi(opts).fromRDF(rdf, true); + assertEquals("[{@id=http://www.w3.org/2002/07/owl#Class, http://www.w3.org/1999/02/22-rdf-syntax-ns#type=[{@id=http://www.w3.org/2002/07/owl#Class}]}]", + out2.toString()); + } + +} From b2a8ac68ae85b5f304ce930d161e8d686780996c Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Sat, 6 Mar 2021 16:23:37 +0100 Subject: [PATCH 07/23] Prepare for release Signed-off-by: Pascal Christoph --- README.md | 11 ++++++++--- pom.xml | 14 +++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d1f5a5cc..c2b90600 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ From Maven com.github.jsonld-java jsonld-java - 0.13.2 + 0.13.3 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.3 4.0.0 jsonld-java-{your module} - 0.13.2-SNAPSHOT + 0.13.3-SNAPSHOT JSONLD Java :: {your module name} JSON-LD Java integration module for {RDF Library your module integrates} jar @@ -449,6 +449,11 @@ Alternatively, we can also host your repository in the jsonld-java organisation CHANGELOG ========= +### 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/pom.xml b/pom.xml index 5bddbf03..5f701d70 100755 --- a/pom.xml +++ b/pom.xml @@ -39,10 +39,10 @@ UTF-8 UTF-8 - 4.5.12 - 4.4.13 - 2.11.2 - 4.13 + 4.5.13 + 4.4.14 + 2.11.4 + 4.13.2 1.7.30 0.11.0 @@ -351,7 +351,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.2.1 attach-source @@ -401,7 +401,7 @@ com.github.siom79.japicmp japicmp-maven-plugin - 0.14.2 + 0.14.4 @@ -448,7 +448,7 @@ org.jacoco jacoco-maven-plugin - 0.8.5 + 0.8.6 prepare-agent From 2c54b02de3a8c8fb9717a8befa3318bc6e895bc6 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 5 Apr 2021 17:58:43 +0200 Subject: [PATCH 08/23] Release 0.13.3 Signed-off-by: Pascal Christoph --- core/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index b771cbee..3e57a58c 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.3 4.0.0 jsonld-java diff --git a/pom.xml b/pom.xml index 5f701d70..db9fd7fa 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.github.jsonld-java jsonld-java-parent - 0.13.3-SNAPSHOT + 0.13.3 JSONLD Java :: Parent Json-LD Java Parent POM pom From 5edb2463c3361e28a9a80d78689bc428887a1ec7 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Sun, 18 Apr 2021 15:43:39 +0200 Subject: [PATCH 09/23] Bump to next development version Signed-off-by: Pascal Christoph --- core/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 3e57a58c..9a9e32cc 100755 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ jsonld-java-parent com.github.jsonld-java - 0.13.3 + 0.13.4-SNAPSHOT 4.0.0 jsonld-java diff --git a/pom.xml b/pom.xml index db9fd7fa..a6c49e1f 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.github.jsonld-java jsonld-java-parent - 0.13.3 + 0.13.4-SNAPSHOT JSONLD Java :: Parent Json-LD Java Parent POM pom From 8b970246b2702f234d2527dd756aec7279b373ba Mon Sep 17 00:00:00 2001 From: Chen Zhang <340355960@qq.com> Date: Wed, 18 Aug 2021 21:57:25 +0800 Subject: [PATCH 10/23] Improve Travis CI build Performance --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) 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 From 2473693e3f64d17cbdcab6b36510f89d21689477 Mon Sep 17 00:00:00 2001 From: Peter Ansell Date: Sat, 11 Dec 2021 11:34:32 +1100 Subject: [PATCH 11/23] issue #322 : Switch test logging from log4j to logback Signed-off-by: Peter Ansell --- core/pom.xml | 4 ++-- core/src/test/resources/log4j.properties | 5 ----- pom.xml | 9 +++++---- 3 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 core/src/test/resources/log4j.properties diff --git a/core/pom.xml b/core/pom.xml index 9a9e32cc..880e341f 100755 --- a/core/pom.xml +++ b/core/pom.xml @@ -53,8 +53,8 @@ test - org.slf4j - slf4j-log4j12 + ch.qos.logback + logback-classic test diff --git a/core/src/test/resources/log4j.properties b/core/src/test/resources/log4j.properties deleted file mode 100644 index 6cebabb1..00000000 --- a/core/src/test/resources/log4j.properties +++ /dev/null @@ -1,5 +0,0 @@ -log4j.rootLogger=INFO, R - -log4j.appender.R=org.apache.log4j.ConsoleAppender -log4j.appender.R.layout=org.apache.log4j.PatternLayout -log4j.appender.R.layout.ConversionPattern=[%d] %-5p (%c:%L) %m%n diff --git a/pom.xml b/pom.xml index a6c49e1f..37d130c8 100755 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,8 @@ 4.4.14 2.11.4 4.13.2 - 1.7.30 + 1.7.32 + 1.2.7 0.11.0 @@ -96,9 +97,9 @@ runtime - org.slf4j - slf4j-log4j12 - ${slf4j.version} + ch.qos.logback + logback-classic + ${logback.version} test From 0c3bac9e61cb51e1784bfe11e15767429d33453c Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 13 Dec 2021 14:38:17 +0100 Subject: [PATCH 12/23] Prepare for release Signed-off-by: christoph@hbz-nrw.de --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c2b90600..647097f8 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ From Maven com.github.jsonld-java jsonld-java - 0.13.3 + 0.13.4 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.3 + 0.13.4 4.0.0 jsonld-java-{your module} - 0.13.3-SNAPSHOT + 0.13.4-SNAPSHOT JSONLD Java :: {your module name} JSON-LD Java integration module for {RDF Library your module integrates} jar @@ -449,6 +449,11 @@ Alternatively, we can also host your repository in the jsonld-java organisation CHANGELOG ========= +### 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) From 4a6458a684f3126c3579b8b703b5b574f60b41c1 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 13 Dec 2021 15:21:21 +0100 Subject: [PATCH 13/23] Release 0.13.4 Signed-off-by: christoph@hbz-nrw.de --- core/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 880e341f..faac5b82 100755 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ jsonld-java-parent com.github.jsonld-java - 0.13.4-SNAPSHOT + 0.13.4 4.0.0 jsonld-java diff --git a/pom.xml b/pom.xml index 37d130c8..4222a722 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.github.jsonld-java jsonld-java-parent - 0.13.4-SNAPSHOT + 0.13.4 JSONLD Java :: Parent Json-LD Java Parent POM pom From f2f1cf22dc8a9c30c47ab570c7aaa8243101ad02 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 13 Dec 2021 16:23:57 +0100 Subject: [PATCH 14/23] Bump to next development version Signed-off-by: Pascal Christoph --- core/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index faac5b82..04547275 100755 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ jsonld-java-parent com.github.jsonld-java - 0.13.4 + 0.13.5-SNAPSHOT 4.0.0 jsonld-java diff --git a/pom.xml b/pom.xml index 4222a722..48f6c851 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.github.jsonld-java jsonld-java-parent - 0.13.4 + 0.13.5-SNAPSHOT JSONLD Java :: Parent Json-LD Java Parent POM pom From 00f0ca5269ba5754479fcb4969034c6cb7782201 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 3 Nov 2023 11:11:22 +0100 Subject: [PATCH 15/23] Ignore test because context does no more resolve (#175) --- .../test/java/com/github/jsonldjava/core/LocalBaseTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/test/java/com/github/jsonldjava/core/LocalBaseTest.java b/core/src/test/java/com/github/jsonldjava/core/LocalBaseTest.java index 22093345..e12c9a02 100644 --- a/core/src/test/java/com/github/jsonldjava/core/LocalBaseTest.java +++ b/core/src/test/java/com/github/jsonldjava/core/LocalBaseTest.java @@ -10,11 +10,13 @@ import java.nio.charset.Charset; import java.util.List; +import org.junit.Ignore; import org.junit.Test; import com.github.jsonldjava.utils.JsonUtils; public class LocalBaseTest { + @Ignore("TODO: context does no more resolve - see https://github.com/jsonld-java/jsonld-java/issues/175") @Test public void testMixedLocalRemoteBaseRemoteContextFirst() throws Exception { @@ -36,6 +38,7 @@ public void testMixedLocalRemoteBaseRemoteContextFirst() throws Exception { assertEquals(expanded, output); } + @Ignore("TODO: context does no more resolve - see https://github.com/jsonld-java/jsonld-java/issues/175") @Test public void testMixedLocalRemoteBaseLocalContextFirst() throws Exception { From 83cc4710a9168c87889b98b4a6bfeaff922ae47f Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 3 Nov 2023 11:13:32 +0100 Subject: [PATCH 16/23] Update dependencies - bump Jackson version to 2.12.7 - bump Guava version to 32.1.3 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 48f6c851..8e59d036 100755 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ 4.5.13 4.4.14 - 2.11.4 + 2.12.7 4.13.2 1.7.32 1.2.7 @@ -211,7 +211,7 @@ com.google.guava guava - 29.0-jre + 32.1.3-jre From 25045d2aabd613a598ff09529789bd4e11e56a69 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 3 Nov 2023 11:29:31 +0100 Subject: [PATCH 17/23] Prepare for release Signed-off-by: christoph@hbz-nrw.de --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 647097f8..6e354ba5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ From Maven com.github.jsonld-java jsonld-java - 0.13.4 + 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.4 + 0.13.5 4.0.0 jsonld-java-{your module} - 0.13.4-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,10 @@ Alternatively, we can also host your repository in the jsonld-java organisation CHANGELOG ========= +### 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) From 3ebed87283a39d8d89a5c186a5ecdd314f23a238 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 3 Nov 2023 11:32:38 +0100 Subject: [PATCH 18/23] Release 0.13.5 Signed-off-by: christoph@hbz-nrw.de --- core/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 04547275..79d71594 100755 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ jsonld-java-parent com.github.jsonld-java - 0.13.5-SNAPSHOT + 0.13.5 4.0.0 jsonld-java diff --git a/pom.xml b/pom.xml index 8e59d036..7ae6629f 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.github.jsonld-java jsonld-java-parent - 0.13.5-SNAPSHOT + 0.13.5 JSONLD Java :: Parent Json-LD Java Parent POM pom From 2c5c4108229d4e58b146ec53505136422f8a6fee Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 3 Nov 2023 13:41:18 +0100 Subject: [PATCH 19/23] Bump to next development version Signed-off-by: Pascal Christoph --- core/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 79d71594..12a00243 100755 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ jsonld-java-parent com.github.jsonld-java - 0.13.5 + 0.13.6-SNAPSHOT 4.0.0 jsonld-java diff --git a/pom.xml b/pom.xml index 7ae6629f..f724db6b 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.github.jsonld-java jsonld-java-parent - 0.13.5 + 0.13.6-SNAPSHOT JSONLD Java :: Parent Json-LD Java Parent POM pom From 1c984b87cc8a8b8dcbafbbae7ae40337972369cd Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 6 Nov 2023 09:00:55 +0100 Subject: [PATCH 20/23] Reenable test by getting monarch-context (#175) Storing monarch-context into this repo will make the tests more stable. --- .../github/jsonldjava/core/LocalBaseTest.java | 3 - .../test/resources/custom/base-0001-in.jsonld | 7 +- .../test/resources/custom/base-0002-in.jsonld | 7 +- .../resources/custom/monarch-context.jsonld | 149 ++++++++++++++++++ 4 files changed, 157 insertions(+), 9 deletions(-) create mode 100644 core/src/test/resources/custom/monarch-context.jsonld diff --git a/core/src/test/java/com/github/jsonldjava/core/LocalBaseTest.java b/core/src/test/java/com/github/jsonldjava/core/LocalBaseTest.java index e12c9a02..22093345 100644 --- a/core/src/test/java/com/github/jsonldjava/core/LocalBaseTest.java +++ b/core/src/test/java/com/github/jsonldjava/core/LocalBaseTest.java @@ -10,13 +10,11 @@ import java.nio.charset.Charset; import java.util.List; -import org.junit.Ignore; import org.junit.Test; import com.github.jsonldjava.utils.JsonUtils; public class LocalBaseTest { - @Ignore("TODO: context does no more resolve - see https://github.com/jsonld-java/jsonld-java/issues/175") @Test public void testMixedLocalRemoteBaseRemoteContextFirst() throws Exception { @@ -38,7 +36,6 @@ public void testMixedLocalRemoteBaseRemoteContextFirst() throws Exception { assertEquals(expanded, output); } - @Ignore("TODO: context does no more resolve - see https://github.com/jsonld-java/jsonld-java/issues/175") @Test public void testMixedLocalRemoteBaseLocalContextFirst() throws Exception { diff --git a/core/src/test/resources/custom/base-0001-in.jsonld b/core/src/test/resources/custom/base-0001-in.jsonld index f9bd58fd..12a082af 100644 --- a/core/src/test/resources/custom/base-0001-in.jsonld +++ b/core/src/test/resources/custom/base-0001-in.jsonld @@ -1,6 +1,6 @@ { - "@context": [ -"https://raw.githubusercontent.com/monarch-initiative/monarch-app/master/conf/monarch-context.jsonld", + "@context": [ + "https://raw.githubusercontent.com/jsonld-java/jsonld-java/master/core/src/test/resources/custom/monarch-context.jsonld", { "@base": "http://example.org/base/", "ex": "http://example.org/", @@ -13,4 +13,5 @@ "ex:name": "Jim", "ex:friendOf": "1234", "@type": "Person" -} \ No newline at end of file +} + diff --git a/core/src/test/resources/custom/base-0002-in.jsonld b/core/src/test/resources/custom/base-0002-in.jsonld index 4b2e3848..d533f432 100644 --- a/core/src/test/resources/custom/base-0002-in.jsonld +++ b/core/src/test/resources/custom/base-0002-in.jsonld @@ -1,5 +1,5 @@ { - "@context": [ + "@context": [ { "@base": "http://example.org/base/", "ex": "http://example.org/", @@ -7,10 +7,11 @@ "@type": "@id" } }, - "https://raw.githubusercontent.com/monarch-initiative/monarch-app/master/conf/monarch-context.jsonld" + "https://raw.githubusercontent.com/jsonld-java/jsonld-java/master/core/src/test/resources/custom/monarch-context.jsonld" ], "@id": "3456", "ex:name": "Jim", "ex:friendOf": "1234", "@type": "Person" -} \ No newline at end of file +} + diff --git a/core/src/test/resources/custom/monarch-context.jsonld b/core/src/test/resources/custom/monarch-context.jsonld new file mode 100644 index 00000000..472f4153 --- /dev/null +++ b/core/src/test/resources/custom/monarch-context.jsonld @@ -0,0 +1,149 @@ +{ + "@context" : { + "EFO" : "http://purl.obolibrary.org/obo/EFO_", + "obo" : "http://purl.obolibrary.org/obo/", + "inheritance" : "monarch:mode_of_inheritance", + "@base" : "http://monarch-initiative.org/", + "email" : "foaf:mbox", + "BIND" : "http://identifiers.org/bind/bind:", + "morpholino" : "GENO:0000417", + "GENO" : "http://purl.obolibrary.org/obo/GENO_", + "UMLS" : "http://purl.obolibrary.org/obo/UMLS_", + "dcat" : "http://www.w3.org/ns/dcat#", + "PMID" : "http://www.ncbi.nlm.nih.gov/pubmed/", + "MP" : "http://purl.obolibrary.org/obo/MP_", + "ISBN-10" : "http://monarch-initiative.org/publications/ISBN:", + "rdf" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "title" : "dc:title", + "Class" : "owl:Class", + "FBbt" : "http://purl.obolibrary.org/obo/FBbt_", + "pathway_associations" : "rdfs:seeAlso", + "FBInternalGT" : "http://monarchinitiative.org/genotype/", + "has_genotype" : "GENO:0000222", + "genotype" : "GENO:0000000", + "void" : "http://rdfs.org/ns/void#", + "has_phenotype" : "RO:0002200", + "reference_locus" : "GENO:0000036", + "dbVar" : "http://identifiers.org/dbVar_", + "AQTLTrait" : "http://purl.obolibrary.org/obo/AQTLTrait_", + "phenotype_associations" : "rdfs:seeAlso", + "ECO" : "http://purl.obolibrary.org/obo/ECO_", + "WB" : "http://identifiers.org/WormBase:", + "rdfs" : "http://www.w3.org/2000/01/rdf-schema#", + "variant_loci" : "GENO:0000027", + "MedGen" : "http://purl.obolibrary.org/obo/MedGen_", + "creator" : { + "@id" : "dc:creator", + "@type" : "@id" + }, + "SIO" : "http://semanticscience.org/resource/SIO_", + "DOID" : "http://purl.obolibrary.org/obo/DOID_", + "Ensembl" : "http://identifiers.org/ensembl:", + "id" : "@id", + "publisher" : "dc:publisher", + "depiction" : { + "@id" : "foaf:depiction", + "@type" : "@id" + }, + "ENSEMBL" : "http://identifiers.org/ensembl:", + "monarch" : "http://monarchinitiative.org/", + "ORPHANET" : "http://purl.obolibrary.org/obo/ORPHANET_", + "owl" : "http://www.w3.org/2002/07/owl#", + "GeneReviews" : "http://www.ncbi.nlm.nih.gov/books/", + "SNOMED_CT" : "http://purl.obolibrary.org/obo/SNOMED_", + "chromosomal_region" : "GENO:0000390", + "EOM" : "http://purl.obolibrary.org/obo/EOM_", + "type" : { + "@id" : "rdf:type", + "@type" : "@id" + }, + "FlyBase" : "http://identifiers.org/flybase:", + "DECIPHER" : "http://purl.obolibrary.org/obo/DECIPHER_", + "faldo" : "http://biohackathon.org/resource/faldo#", + "prov" : "http://www.w3.org/ns/prov#", + "MIM" : "http://purl.obolibrary.org/obo/OMIM_", + "genomic_variation_complement" : "GENO:0000009", + "evidence" : "monarch:evidence", + "BioGRID" : "http://purl.obolibrary.org/BioGRID_", + "dcterms" : "http://purl.org/dc/terms/", + "sequence_alteration" : "SO:0001059", + "RO" : "http://purl.obolibrary.org/obo/RO_", + "created" : { + "@id" : "dc:created", + "@type" : "xsd:dateTime" + }, + "Orphanet" : "http://purl.obolibrary.org/obo/ORPHANET_", + "oa" : "http://www.w3.org/ns/oa#", + "SGD" : "http://identifiers.org/mgd/sgd:", + "Gene" : "http://purl.obolibrary.org/obo/NCBIGene_", + "PomBase" : "http://identifiers.org/PomBase:", + "genotype_associations" : "rdfs:seeAlso", + "xsd" : "http://www.w3.org/2001/XMLSchema#", + "OMIABreed" : "http://purl.obolibrary.org/obo/OMIA_", + "TAIR" : "http://identifiers.org/mgd/tair:", + "oboInOwl" : "http://www.geneontology.org/formats/oboInOwl#", + "description" : "dc:description", + "disease" : "monarch:disease", + "OMIAPub" : "http://purl.obolibrary.org/obo/OMIAPub_", + "foaf" : "http://xmlns.com/foaf/0.1/", + "idot" : "http://identifiers.org/", + "subClassOf" : "owl:subClassOf", + "source" : "dc:source", + "keyword" : "dcat:keyword", + "onset" : "monarch:age_of_onset", + "genomic_background" : "GENO:0000010", + "dictyBase" : "http://identifiers.org/dictyBase:", + "OMIA" : "http://purl.obolibrary.org/obo/OMIA_", + "has_part" : "BFO:0000051", + "ClinVarVariant" : "http://identifiers.org/ClinVarVariant_", + "gene_locus" : "GENO:0000014", + "effective_genotype" : "GENO:0000525", + "VT" : "http://purl.obolibrary.org/obo/VT_", + "Association" : "SIO:000897", + "resource" : "monarch:nif-resource", + "KEGG" : "http://identifiers.org/kegg:", + "Annotation" : "oa:Annotation", + "FBdv" : "http://purl.obolibrary.org/obo/FBdv_", + "GeneID" : "http://purl.obolibrary.org/obo/NCBIGene_", + "has_background" : "GENO:0000010", + "BFO" : "http://purl.obolibrary.org/obo/BFO_", + "FB" : "http://identifiers.org/flybase:", + "frequency" : "monarch:frequency", + "ZP" : "http://purl.obolibrary.org/obo/ZP_", + "OMIM" : "http://purl.obolibrary.org/obo/OMIM_", + "MGI" : "http://identifiers.org/mgd/MGI:", + "dc" : "http://purl.org/dc/terms/", + "MONARCH" : "http://monarchinitiative.org/MONARCH_", + "ClinVarHaplotype" : "http://identifiers.org/ClinVarHaplotype_", + "homepage" : { + "@id" : "foaf:homepage", + "@type" : "@id" + }, + "RGD" : "http://identifiers.org/mgd/rgd:", + "CORIELL" : "http://purl.obolibrary.org/obo/CORIELL_", + "label" : "rdfs:label", + "NCBIGene" : "http://purl.obolibrary.org/obo/NCBIGene_", + "intrinsic_genotype" : "GENO:0000000", + "FBcv" : "http://purl.obolibrary.org/obo/FBcv_", + "WBStrain" : "http://identifiers.org/WormBase:", + "sequence_alteration_collection" : "GENO:0000025", + "reference" : "dc:publication", + "zygosity" : "GENO:0000133", + "chromosome" : "GENO:0000323", + "WormBase" : "http://identifiers.org/WormBase:", + "HPRD" : "http://identifiers.org/hprd/hprd:", + "ClinVar" : "http://purl.obolibrary.org/obo/ClinVar_", + "ISBN-13" : "http://monarch-initiative.org/publications/ISBN:", + "extrinsic_genotype" : "GENO:0000524", + "NCBITaxon" : "http://purl.obolibrary.org/obo/NCBITaxon_", + "environment" : "GENO:0000099", + "variant_locus" : "GENO:0000481", + "comment" : "rdfs:comment", + "SO" : "http://purl.obolibrary.org/obo/SO_", + "phenotype" : "monarch:phenotype", + "ZFIN" : "http://identifiers.org/zfin:", + "HP" : "http://purl.obolibrary.org/obo/HP_", + "MESH" : "http://purl.obolibrary.org/obo/MESH_", + "dbSNP" : "http://identifiers.org/dbSNP_" + } +} From 156ec3e0f3325ed3abaa62e452d3d3610d7e7f53 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 6 Nov 2023 10:03:50 +0100 Subject: [PATCH 21/23] Update dependencies - bump Jackson version to 2.12.7.1 --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f724db6b..f7662a72 100755 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,7 @@ 4.5.13 4.4.14 2.12.7 + 2.12.7.1 4.13.2 1.7.32 1.2.7 @@ -66,7 +67,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson.version} + ${jackson-databind.version} com.fasterxml.jackson.core From 1cff4ce3093bce405c52b7b52737e0982119b4a0 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 6 Nov 2023 10:08:44 +0100 Subject: [PATCH 22/23] Prepare for release Signed-off-by: christoph@hbz-nrw.de --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6e354ba5..f1102e69 100644 --- a/README.md +++ b/README.md @@ -449,6 +449,10 @@ 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 From 01c3086a2bba620bf74ac6440797275cb41cbe86 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 6 Nov 2023 10:16:20 +0100 Subject: [PATCH 23/23] Release 0.13.6 Signed-off-by: christoph@hbz-nrw.de --- core/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 12a00243..f14fb287 100755 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ jsonld-java-parent com.github.jsonld-java - 0.13.6-SNAPSHOT + 0.13.6 4.0.0 jsonld-java diff --git a/pom.xml b/pom.xml index f7662a72..de5316fa 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.github.jsonld-java jsonld-java-parent - 0.13.6-SNAPSHOT + 0.13.6 JSONLD Java :: Parent Json-LD Java Parent POM pom