Skip to content
Snippets Groups Projects
Commit efcb94af authored by Andrius Merkys's avatar Andrius Merkys
Browse files

New upstream version 0.13.0

parent 333709b1
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ From Maven
<dependency>
<groupId>com.github.jsonld-java</groupId>
<artifactId>jsonld-java</artifactId>
<version>0.12.5</version>
<version>0.13.0</version>
</dependency>
Code example
......@@ -323,11 +323,11 @@ Here is the basic outline for what your module's pom.xml should look like
<parent>
<groupId>com.github.jsonld-java</groupId>
<artifactId>jsonld-java-parent</artifactId>
<version>0.12.5</version>
<version>0.13.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jsonld-java-{your module}</artifactId>
<version>0.12.5-SNAPSHOT</version>
<version>0.13.0-SNAPSHOT</version>
<name>JSONLD Java :: {your module name}</name>
<description>JSON-LD Java integration module for {RDF Library your module integrates}</description>
<packaging>jar</packaging>
......@@ -450,9 +450,15 @@ Alternatively, we can also host your repository in the jsonld-java organisation
CHANGELOG
=========
### 2019-11-28
* Release 0.13.0
* Bump Jackson versions to latest for security updates (Patch by @afs)
* Do not canonicalise XSD Decimal typed values (Patch by @jhg023)
* Bump dependency and plugin versions
### 2019-08-03
* Release 0.12.5
* Bump Jackson versions to latest for securiy updates (Patches by @afs)
* Bump Jackson versions to latest for security updates (Patches by @afs)
* IRI resolution fixes (Patch by @fsteeg)
### 2019-04-20
......
......@@ -4,7 +4,7 @@
<parent>
<artifactId>jsonld-java-parent</artifactId>
<groupId>com.github.jsonld-java</groupId>
<version>0.12.5</version>
<version>0.13.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jsonld-java</artifactId>
......
......@@ -6,6 +6,7 @@ import static com.github.jsonldjava.core.JsonLdConsts.RDF_NIL;
import static com.github.jsonldjava.core.JsonLdConsts.RDF_REST;
import static com.github.jsonldjava.core.JsonLdConsts.RDF_TYPE;
import static com.github.jsonldjava.core.JsonLdConsts.XSD_BOOLEAN;
import static com.github.jsonldjava.core.JsonLdConsts.XSD_DECIMAL;
import static com.github.jsonldjava.core.JsonLdConsts.XSD_DOUBLE;
import static com.github.jsonldjava.core.JsonLdConsts.XSD_INTEGER;
import static com.github.jsonldjava.core.JsonLdConsts.XSD_STRING;
......@@ -665,7 +666,10 @@ public class RDFDataset extends LinkedHashMap<String, Object> {
return new Literal(Float.toString((float) value),
datatype == null ? XSD_DOUBLE : (String) datatype, null);
} else {
// canonical double representation
// Only canonicalize representation if datatype is not XSD_DECIMAL
if (XSD_DECIMAL.equals(datatype)) {
return new Literal(value.toString(), XSD_DECIMAL, null);
}
final DecimalFormat df = new DecimalFormat("0.0###############E0");
df.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.US));
return new Literal(df.format(value),
......
package com.github.jsonldjava.core;
import org.junit.Test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertEquals;
public class DecimalLiteralCanonicalTest {
@Test
public void testDecimalIsNotCanonicalized() {
double value = 6.5;
Map<String, Object> innerMap = new HashMap<>();
innerMap.put("@value", value);
innerMap.put("@type", "http://www.w3.org/2001/XMLSchema#decimal");
Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("ex:id", innerMap);
JsonLdApi api = new JsonLdApi(jsonMap, new JsonLdOptions(""));
RDFDataset dataset = api.toRDF();
List<Object> defaultList = (List<Object>) dataset.get("@default");
Map<String, Object> tripleMap = (Map<String, Object>) defaultList.get(0);
Map<String, String> objectMap = (Map<String, String>) tripleMap.get("object");
assertEquals("http://www.w3.org/2001/XMLSchema#decimal", objectMap.get("datatype"));
assertEquals(Double.toString(value), objectMap.get("value"));
}
}
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.jsonld-java</groupId>
<artifactId>jsonld-java-parent</artifactId>
<version>0.12.5</version>
<version>0.13.0</version>
<name>JSONLD Java :: Parent</name>
<description>Json-LD Java Parent POM</description>
<packaging>pom</packaging>
......@@ -39,13 +39,11 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<httpclient.version>4.5.8</httpclient.version>
<httpcore.version>4.4.11</httpcore.version>
<jackson.version>2.9.9</jackson.version>
<!-- Point release fix for jackson-databind only -->
<jackson-databind.version>2.9.9.2</jackson-databind.version>
<httpclient.version>4.5.10</httpclient.version>
<httpcore.version>4.4.12</httpcore.version>
<jackson.version>2.10.1</jackson.version>
<junit.version>4.12</junit.version>
<slf4j.version>1.7.26</slf4j.version>
<slf4j.version>1.7.29</slf4j.version>
<last-compare-version>0.11.0</last-compare-version>
</properties>
......@@ -67,7 +65,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind.version}</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
......@@ -194,12 +192,12 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.12</version>
<version>1.13</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.27.0</version>
<version>2.28.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
......@@ -211,7 +209,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.1-jre</version>
<version>28.1-jre</version>
</dependency>
</dependencies>
</dependencyManagement>
......@@ -232,7 +230,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>enforce-maven-3</id>
......@@ -276,7 +274,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
......@@ -285,12 +283,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<version>3.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......@@ -305,7 +303,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<version>3.1.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......@@ -340,7 +338,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
<executions>
<execution>
<goals>
......@@ -352,7 +350,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-source</id>
......@@ -371,17 +369,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>2.22.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
<version>3.8.2</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.17</version>
<version>1.18</version>
<executions>
<execution>
<id>check-jdk-compliance</id>
......@@ -402,7 +400,7 @@
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<version>0.13.0</version>
<version>0.14.2</version>
<configuration>
<oldVersion>
<dependency>
......@@ -433,7 +431,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
......@@ -449,7 +447,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.5</version>
<executions>
<execution>
<id>prepare-agent</id>
......@@ -462,7 +460,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.5</version>
<version>2.7</version>
</plugin>
</plugins>
</pluginManagement>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment