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 4e563d78..a34aad3b 100644 --- a/core/src/main/java/com/github/jsonldjava/core/Context.java +++ b/core/src/main/java/com/github/jsonldjava/core/Context.java @@ -374,7 +374,8 @@ private void createTermDefinition(Map context, String term, // least not here!) if (JsonLdConsts.ID.equals(type) || JsonLdConsts.VOCAB.equals(type) || (!type.startsWith(JsonLdConsts.BLANK_NODE_PREFIX) - && JsonLdUtils.isAbsoluteIri(type))) { + && JsonLdUtils.isAbsoluteIri(type)) || + options.isProcessingMode11() && JsonLdConsts.JSON.equals(type)) { definition.put(JsonLdConsts.TYPE, type); } else { throw new JsonLdError(Error.INVALID_TYPE_MAPPING, type); 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 2195d09a..faff10d4 100644 --- a/core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java +++ b/core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java @@ -8,6 +8,7 @@ import static com.github.jsonldjava.core.JsonLdUtils.isKeyword; import static com.github.jsonldjava.utils.Obj.newMap; +import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -20,6 +21,7 @@ import java.util.Set; import java.util.TreeMap; +import com.github.jsonldjava.utils.JsonUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -188,7 +190,9 @@ public Object compact(Context activeCtx, String activeProperty, Object element, // 4 if (elem.containsKey(JsonLdConsts.VALUE) || elem.containsKey(JsonLdConsts.ID)) { final Object compactedValue = activeCtx.compactValue(activeProperty, elem); - if (!(compactedValue instanceof Map || compactedValue instanceof List)) { + if (!(compactedValue instanceof Map || compactedValue instanceof List) || + opts.isProcessingMode11() && + JsonLdConsts.JSON.equals(activeCtx.getTypeMapping(activeProperty))) { return compactedValue; } } @@ -645,7 +649,8 @@ else if (JsonLdConsts.GRAPH.equals(expandedProperty)) { } // 7.4.6) else if (JsonLdConsts.VALUE.equals(expandedProperty)) { - if (value != null && (value instanceof Map || value instanceof List)) { + if (value != null && (value instanceof Map || value instanceof List) && + !opts.isProcessingMode11()) { throw new JsonLdError(Error.INVALID_VALUE_OBJECT_VALUE, "value of " + expandedProperty + " must be a scalar or null"); } @@ -785,6 +790,12 @@ else if (frameExpansion && (JsonLdConsts.EXPLICIT.equals(expandedProperty) // 7.4.13) continue; } + // 13.6 (from the Json-LD 1.1 spec) + else if (opts.isProcessingMode11() && JsonLdConsts.JSON.equals(activeCtx.getTypeMapping(key))) { + Map temp = newMap(JsonLdConsts.TYPE, JsonLdConsts.JSON); + temp.put(JsonLdConsts.VALUE, value); + expandedValue = temp; + } // 7.5 else if (JsonLdConsts.LANGUAGE.equals(activeCtx.getContainer(key)) && value instanceof Map) { @@ -926,17 +937,23 @@ else if (JsonLdConsts.INDEX.equals(activeCtx.getContainer(key)) keySet.remove(JsonLdConsts.INDEX); final boolean langremoved = keySet.remove(JsonLdConsts.LANGUAGE); final boolean typeremoved = keySet.remove(JsonLdConsts.TYPE); + final boolean isJsonType = JsonLdConsts.JSON.equals(result.get(JsonLdConsts.TYPE)); if ((langremoved && typeremoved) || !keySet.isEmpty()) { throw new JsonLdError(Error.INVALID_VALUE_OBJECT, "value object has unknown keys"); } // 8.2) final Object rval = result.get(JsonLdConsts.VALUE); - if (rval == null) { + if (rval == null && !opts.isProcessingMode11()) { // nothing else is possible with result if we set it to // null, so simply return it return null; } + // 13.4.7.1 (from the Json-LD 1.1. spec) + if(opts.isProcessingMode11() && (rval instanceof Map || rval instanceof List) && !isJsonType) { + throw new JsonLdError(Error.INVALID_VALUE_OBJECT_VALUE, + "value of " + activeProperty + " must be a scalar or null"); + } // 8.3) if (!(rval instanceof String) && result.containsKey(JsonLdConsts.LANGUAGE)) { throw new JsonLdError(Error.INVALID_LANGUAGE_TAGGED_VALUE, @@ -947,7 +964,9 @@ else if (result.containsKey(JsonLdConsts.TYPE)) { // TODO: is this enough for "is an IRI" if (!(result.get(JsonLdConsts.TYPE) instanceof String) || ((String) result.get(JsonLdConsts.TYPE)).startsWith("_:") - || !((String) result.get(JsonLdConsts.TYPE)).contains(":")) { + || (!((String) result.get(JsonLdConsts.TYPE)).contains(":") && + JsonLdConsts.JSON.equals(result.get(JsonLdConsts.TYPE)) && + !opts.isProcessingMode11())) { throw new JsonLdError(Error.INVALID_TYPED_VALUE, "value of @type must be an IRI"); } @@ -1999,6 +2018,18 @@ public List fromRDF(final RDFDataset dataset, boolean noDuplicatesInData nodeMap.computeIfAbsent(object.getValue(), k -> new NodeMapNode(k)); } + if (opts.isProcessingMode11() && JsonLdConsts.RDF_JSON.equals(object.getDatatype())) { + try { + final Object json = JsonUtils.fromString(object.getValue()); + Map entries = newMap(JsonLdConsts.TYPE, JsonLdConsts.JSON); + entries.put(JsonLdConsts.VALUE, json); + JsonLdUtils.mergeValue(node, predicate, entries); + } catch (IOException e) { + throw new JsonLdError(JsonLdError.Error.INVALID_JSON_LITERAL); + } + continue; + } + // 3.5.4) if (RDF_TYPE.equals(predicate) && (object.isIRI() || object.isBlankNode()) && !opts.getUseRdfType() && diff --git a/core/src/main/java/com/github/jsonldjava/core/JsonLdConsts.java b/core/src/main/java/com/github/jsonldjava/core/JsonLdConsts.java index 9de5b76b..c46be9be 100644 --- a/core/src/main/java/com/github/jsonldjava/core/JsonLdConsts.java +++ b/core/src/main/java/com/github/jsonldjava/core/JsonLdConsts.java @@ -1,5 +1,9 @@ package com.github.jsonldjava.core; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; + /** * URI Constants used in the JSON-LD parser. */ @@ -27,6 +31,7 @@ public final class JsonLdConsts { public static final String RDF_OBJECT = RDF_SYNTAX_NS + "object"; public static final String RDF_LANGSTRING = RDF_SYNTAX_NS + "langString"; public static final String RDF_LIST = RDF_SYNTAX_NS + "List"; + public static final String RDF_JSON = RDF_SYNTAX_NS + "JSON"; public static final String TEXT_TURTLE = "text/turtle"; public static final String APPLICATION_NQUADS = "application/n-quads"; // https://www.w3.org/TR/n-quads/#sec-mediatype @@ -57,8 +62,15 @@ public final class JsonLdConsts { public static final String BLANK_NODE_PREFIX = "_:"; public static final String VOCAB = "@vocab"; public static final String BASE = "@base"; + public static final String JSON = "@json"; public static final String REQUIRE_ALL = "@requireAll"; + public final static DecimalFormat DOUBLE_DECIMAL_FORMAT = new DecimalFormat("0.0###############E0", + DecimalFormatSymbols.getInstance(Locale.US)); + + public final static DecimalFormat INT_DECIMAL_FORMAT = new DecimalFormat("0", + DecimalFormatSymbols.getInstance(Locale.US)); + public enum Embed { ALWAYS, NEVER, LAST, LINK; } diff --git a/core/src/main/java/com/github/jsonldjava/core/JsonLdError.java b/core/src/main/java/com/github/jsonldjava/core/JsonLdError.java index 21ab5772..10a937af 100644 --- a/core/src/main/java/com/github/jsonldjava/core/JsonLdError.java +++ b/core/src/main/java/com/github/jsonldjava/core/JsonLdError.java @@ -113,7 +113,9 @@ public enum Error { PARSE_ERROR("parse error"), - UNKNOWN_ERROR("unknown error"); + UNKNOWN_ERROR("unknown error"), + + INVALID_JSON_LITERAL("invalid JSON literal"); private final String error; diff --git a/core/src/main/java/com/github/jsonldjava/core/JsonLdOptions.java b/core/src/main/java/com/github/jsonldjava/core/JsonLdOptions.java index ff0038ee..d852fd65 100644 --- a/core/src/main/java/com/github/jsonldjava/core/JsonLdOptions.java +++ b/core/src/main/java/com/github/jsonldjava/core/JsonLdOptions.java @@ -245,6 +245,10 @@ public String getProcessingMode() { return processingMode; } + public boolean isProcessingMode11() { + return JSON_LD_1_1.equals(getProcessingMode()); + } + public void setProcessingMode(String processingMode) { this.processingMode = processingMode; if (processingMode.equals(JSON_LD_1_1)) { diff --git a/core/src/main/java/com/github/jsonldjava/core/JsonLdUtils.java b/core/src/main/java/com/github/jsonldjava/core/JsonLdUtils.java index e0accff7..e2f894ff 100644 --- a/core/src/main/java/com/github/jsonldjava/core/JsonLdUtils.java +++ b/core/src/main/java/com/github/jsonldjava/core/JsonLdUtils.java @@ -32,7 +32,7 @@ static boolean isKeyword(Object key) { || "@language".equals(key) || "@list".equals(key) || "@omitDefault".equals(key) || "@reverse".equals(key) || "@preserve".equals(key) || "@set".equals(key) || "@type".equals(key) || "@value".equals(key) || "@vocab".equals(key) - || "@requireAll".equals(key); + || "@requireAll".equals(key) || "@json".equals(key); } public static Boolean deepCompare(Object v1, Object v2, Boolean listOrderMatters) { diff --git a/core/src/main/java/com/github/jsonldjava/core/RDFDataset.java b/core/src/main/java/com/github/jsonldjava/core/RDFDataset.java index 8f8e18c2..b9a4876b 100644 --- a/core/src/main/java/com/github/jsonldjava/core/RDFDataset.java +++ b/core/src/main/java/com/github/jsonldjava/core/RDFDataset.java @@ -1,5 +1,7 @@ package com.github.jsonldjava.core; +import com.github.jsonldjava.utils.JsonUtils; + import static com.github.jsonldjava.core.JsonLdConsts.RDF_FIRST; import static com.github.jsonldjava.core.JsonLdConsts.RDF_LANGSTRING; import static com.github.jsonldjava.core.JsonLdConsts.RDF_NIL; @@ -10,6 +12,7 @@ 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; +import static com.github.jsonldjava.core.JsonLdConsts.RDF_JSON; import static com.github.jsonldjava.core.JsonLdUtils.isKeyword; import static com.github.jsonldjava.core.JsonLdUtils.isList; import static com.github.jsonldjava.core.JsonLdUtils.isObject; @@ -17,13 +20,11 @@ import static com.github.jsonldjava.core.JsonLdUtils.isValue; import static com.github.jsonldjava.utils.Obj.newMap; -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; +import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.regex.Pattern; @@ -645,14 +646,21 @@ else if (JsonLdUtils.isRelativeIri(property)) { * the JSON-LD value or node object. * @return the RDF literal or RDF resource. */ - private Node objectToRDF(Object item) { + private Node objectToRDF(Object item) throws JsonLdError { // convert value object to RDF if (isValue(item)) { final Object value = ((Map) item).get("@value"); final Object datatype = ((Map) item).get("@type"); // convert to XSD datatypes as appropriate - if (value instanceof Boolean || value instanceof Number) { + if(api.opts.isProcessingMode11() && "@json".equals(datatype)) { + try { + return new Literal(JsonUtils.toJcsString(value), RDF_JSON, null); + } catch (IOException e) { + throw new JsonLdError(JsonLdError.Error.INVALID_JSON_LITERAL); + } + } + else if (value instanceof Boolean || value instanceof Number) { // convert to XSD datatype if (value instanceof Boolean) { return new Literal(value.toString(), @@ -670,14 +678,11 @@ private Node objectToRDF(Object item) { 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), + return new Literal(JsonLdConsts.DOUBLE_DECIMAL_FORMAT.format(value), datatype == null ? XSD_DOUBLE : (String) datatype, null); } } else { - final DecimalFormat df = new DecimalFormat("0"); - return new Literal(df.format(value), + return new Literal(JsonLdConsts.INT_DECIMAL_FORMAT.format(value), datatype == null ? XSD_INTEGER : (String) datatype, null); } } else if (((Map) item).containsKey("@language")) { diff --git a/core/src/main/java/com/github/jsonldjava/core/RDFDatasetUtils.java b/core/src/main/java/com/github/jsonldjava/core/RDFDatasetUtils.java index a2739e64..99c0ca2c 100644 --- a/core/src/main/java/com/github/jsonldjava/core/RDFDatasetUtils.java +++ b/core/src/main/java/com/github/jsonldjava/core/RDFDatasetUtils.java @@ -91,7 +91,11 @@ else if (bnode != null) { } } else { output.append("\""); - escape(o.getValue(), output); + if(JsonLdConsts.RDF_JSON.equals(o.getDatatype())) { + escapeJcs(o.getValue(), output); + }else { + escape(o.getValue(), output); + } output.append("\""); if (RDF_LANGSTRING.equals(o.getDatatype())) { output.append("@").append(o.getLanguage()); @@ -192,6 +196,51 @@ public static String unescape(String str) { return rval; } + private static void specialCharactersEscaped(char c, StringBuilder rval) { + switch (c) { + case '\b': + rval.append("\\b"); + break; + case '\n': + rval.append("\\n"); + break; + case '\t': + rval.append("\\t"); + break; + case '\f': + rval.append("\\f"); + break; + case '\r': + rval.append("\\r"); + break; + case '\"': + rval.append("\\\""); + break; + case '\\': + rval.append("\\\\"); + break; + default: + rval.append(c); + break; + } + } + + + /** + * Escapes the given JSON Canonicalization Scheme string + * + * @param str + * The string to escape + * @param rval + * The {@link StringBuilder} to append to. + */ + public static void escapeJcs(String str, StringBuilder rval) { + for (int i = 0; i < str.length(); i++) { + final char hi = str.charAt(i); + specialCharactersEscaped(hi, rval); + } + } + /** * Escapes the given string according to the N-Quads escape rules * @@ -221,37 +270,7 @@ public static void escape(String str, StringBuilder rval) { final int c = (hi << 10) + lo + (0x10000 - (0xD800 << 10) - 0xDC00); rval.append(String.format("\\U%08x", c)); } else { - switch (hi) { - case '\b': - rval.append("\\b"); - break; - case '\n': - rval.append("\\n"); - break; - case '\t': - rval.append("\\t"); - break; - case '\f': - rval.append("\\f"); - break; - case '\r': - rval.append("\\r"); - break; - // case '\'': - // rval += "\\'"; - // break; - case '\"': - rval.append("\\\""); - // rval += "\\u0022"; - break; - case '\\': - rval.append("\\\\"); - break; - default: - // just put the char as is - rval.append(hi); - break; - } + specialCharactersEscaped(hi, rval); } } // return rval; diff --git a/core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java b/core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java index c24c8467..f437ce6b 100644 --- a/core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java +++ b/core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java @@ -13,18 +13,19 @@ import java.net.URL; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import java.util.List; +import java.util.Locale; import java.util.Map; -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.databind.module.SimpleModule; import com.github.jsonldjava.core.DocumentLoader; import com.github.jsonldjava.core.JsonLdApi; +import com.github.jsonldjava.core.JsonLdConsts; import com.github.jsonldjava.core.JsonLdProcessor; import org.apache.commons.io.ByteOrderMark; @@ -42,8 +43,6 @@ import org.apache.http.impl.client.cache.BasicHttpCacheStorage; import org.apache.http.impl.client.cache.CacheConfig; import org.apache.http.impl.client.cache.CachingHttpClientBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Functions used to make loading, parsing, and serializing JSON easy using @@ -69,6 +68,34 @@ public class JsonUtils { private static final ObjectMapper JSON_MAPPER = new ObjectMapper(); private static final JsonFactory JSON_FACTORY = new JsonFactory(JSON_MAPPER); + private static final ObjectMapper JCS_MAPPER = JsonMapper.builder().configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true).build(); + private static final SimpleModule module = new SimpleModule(); + private static final JsonFactory jcs_FACTORY = new JsonFactory(JCS_MAPPER); + + private static final JsonSerializer doubleSerializer = new JsonSerializer() { + + private DecimalFormat bigDecimalFor(String exponentSeparator) { + DecimalFormatSymbols symbol = DecimalFormatSymbols.getInstance(Locale.US); + symbol.setExponentSeparator(exponentSeparator); + return new DecimalFormat("0E00", symbol); + } + + private final DecimalFormat DOUBLE_JCS = new DecimalFormat("0.#######", + DecimalFormatSymbols.getInstance(Locale.US)); + private final DecimalFormat BIG_POSITIVE_DOUBLE_JCS = bigDecimalFor("e+"); + private final DecimalFormat BIG_NEGATIVE_DOUBLE_JCS = bigDecimalFor("e"); + + @Override + public void serialize(Double value, JsonGenerator jgen, SerializerProvider serializerProvider) throws IOException { + if(value >= 1.0E21) + jgen.writeNumber(BIG_POSITIVE_DOUBLE_JCS.format(value).toLowerCase()); + else if (value != 0 && value <= 1.0E-21) + jgen.writeNumber(BIG_NEGATIVE_DOUBLE_JCS.format(value).toLowerCase()); + else + jgen.writeNumber(DOUBLE_JCS.format(value)); + + } + }; private static volatile CloseableHttpClient DEFAULT_HTTP_CLIENT; // Avoid possible endless loop when following alternate locations @@ -83,6 +110,10 @@ public class JsonUtils { // where a wide range of URIs are used for subjects and predicates JSON_FACTORY.disable(JsonFactory.Feature.INTERN_FIELD_NAMES); JSON_FACTORY.disable(JsonFactory.Feature.CANONICALIZE_FIELD_NAMES); + //adding our custom serializer + module.addSerializer(Double.class ,doubleSerializer); + //registering the module with ObjectMapper + JCS_MAPPER.registerModule(module); } /** @@ -259,13 +290,10 @@ public static Object fromString(String jsonString) throws JsonParseException, IO * @param jsonObject * The JSON-LD Object to serialize. * @return A JSON document serialised to a String. - * @throws JsonGenerationException - * If there is a JSON error during serialization. * @throws IOException * If there is an IO error during serialization. */ - public static String toPrettyString(Object jsonObject) - throws JsonGenerationException, IOException { + public static String toPrettyString(Object jsonObject) throws IOException { final StringWriter sw = new StringWriter(); writePrettyPrint(sw, jsonObject); return sw.toString(); @@ -277,17 +305,36 @@ public static String toPrettyString(Object jsonObject) * @param jsonObject * The JSON-LD Object to serialize. * @return A JSON document serialised to a String. - * @throws JsonGenerationException - * If there is a JSON error during serialization. * @throws IOException * If there is an IO error during serialization. */ - public static String toString(Object jsonObject) throws JsonGenerationException, IOException { + public static String toString(Object jsonObject) throws IOException { final StringWriter sw = new StringWriter(); write(sw, jsonObject); return sw.toString(); } + /** + * Writes the given JSON-LD Object out to a String as JSON Canonicalization Scheme (JCS). + * + * @param jsonObject + * The JSON-LD Object to serialize. + * @return A JSON document serialised to a String. + * @throws IOException + * If there is an IO error during serialization. + */ + public static String toJcsString(Object jsonObject) throws IOException { + if(jsonObject == null) { + return "null"; + } + + final StringWriter sw = new StringWriter(); + + final JsonGenerator jw = jcs_FACTORY.createGenerator(sw); + jw.writeObject(jsonObject); + return sw.toString(); + } + /** * Writes the given JSON-LD Object out to the given Writer. * @@ -295,13 +342,10 @@ public static String toString(Object jsonObject) throws JsonGenerationException, * The writer that is to receive the serialized JSON-LD object. * @param jsonObject * The JSON-LD Object to serialize. - * @throws JsonGenerationException - * If there is a JSON error during serialization. * @throws IOException * If there is an IO error during serialization. */ - public static void write(Writer writer, Object jsonObject) - throws JsonGenerationException, IOException { + public static void write(Writer writer, Object jsonObject) throws IOException { final JsonGenerator jw = JSON_FACTORY.createGenerator(writer); jw.writeObject(jsonObject); } @@ -314,13 +358,11 @@ public static void write(Writer writer, Object jsonObject) * The writer that is to receive the serialized JSON-LD object. * @param jsonObject * The JSON-LD Object to serialize. - * @throws JsonGenerationException - * If there is a JSON error during serialization. * @throws IOException * If there is an IO error during serialization. */ public static void writePrettyPrint(Writer writer, Object jsonObject) - throws JsonGenerationException, IOException { + throws IOException { final JsonGenerator jw = JSON_FACTORY.createGenerator(writer); jw.useDefaultPrettyPrinter(); jw.writeObject(jsonObject); diff --git a/core/src/test/resources/json-ld.org/compact-js01-context.jsonld b/core/src/test/resources/json-ld.org/compact-js01-context.jsonld new file mode 100644 index 00000000..e9a4e9e3 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js01-context.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#bool", "@type": "@json"} + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js01-in.jsonld b/core/src/test/resources/json-ld.org/compact-js01-in.jsonld new file mode 100644 index 00000000..642709fd --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js01-in.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#bool": [{"@value": true, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js01-out.jsonld b/core/src/test/resources/json-ld.org/compact-js01-out.jsonld new file mode 100644 index 00000000..01f43eb9 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js01-out.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#bool", "@type": "@json"} + }, + "e": true +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js02-context.jsonld b/core/src/test/resources/json-ld.org/compact-js02-context.jsonld new file mode 100644 index 00000000..e9a4e9e3 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js02-context.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#bool", "@type": "@json"} + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js02-in.jsonld b/core/src/test/resources/json-ld.org/compact-js02-in.jsonld new file mode 100644 index 00000000..640d3d29 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js02-in.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#bool": [{"@value": false, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js02-out.jsonld b/core/src/test/resources/json-ld.org/compact-js02-out.jsonld new file mode 100644 index 00000000..d367df76 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js02-out.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#bool", "@type": "@json"} + }, + "e": false +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js03-context.jsonld b/core/src/test/resources/json-ld.org/compact-js03-context.jsonld new file mode 100644 index 00000000..139553a6 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js03-context.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#double", "@type": "@json"} + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js03-in.jsonld b/core/src/test/resources/json-ld.org/compact-js03-in.jsonld new file mode 100644 index 00000000..060691ac --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js03-in.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#double": [{"@value": 1.23, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js03-out.jsonld b/core/src/test/resources/json-ld.org/compact-js03-out.jsonld new file mode 100644 index 00000000..ca27fd8d --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js03-out.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#double", "@type": "@json"} + }, + "e": 1.23 +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js04-context.jsonld b/core/src/test/resources/json-ld.org/compact-js04-context.jsonld new file mode 100644 index 00000000..139553a6 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js04-context.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#double", "@type": "@json"} + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js04-in.jsonld b/core/src/test/resources/json-ld.org/compact-js04-in.jsonld new file mode 100644 index 00000000..278b08f0 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js04-in.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#double": [{"@value": 0.0e0, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js04-out.jsonld b/core/src/test/resources/json-ld.org/compact-js04-out.jsonld new file mode 100644 index 00000000..624c7382 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js04-out.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#double", "@type": "@json"} + }, + "e": 0.0e0 +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js05-context.jsonld b/core/src/test/resources/json-ld.org/compact-js05-context.jsonld new file mode 100644 index 00000000..c633a37f --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js05-context.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#integer", "@type": "@json"} + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js05-in.jsonld b/core/src/test/resources/json-ld.org/compact-js05-in.jsonld new file mode 100644 index 00000000..364fc8ff --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js05-in.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#integer": [{"@value": 123, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js05-out.jsonld b/core/src/test/resources/json-ld.org/compact-js05-out.jsonld new file mode 100644 index 00000000..d9356725 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js05-out.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#integer", "@type": "@json"} + }, + "e": 123 +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js06-context.jsonld b/core/src/test/resources/json-ld.org/compact-js06-context.jsonld new file mode 100644 index 00000000..96dd10cc --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js06-context.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#object", "@type": "@json"} + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js06-in.jsonld b/core/src/test/resources/json-ld.org/compact-js06-in.jsonld new file mode 100644 index 00000000..c9df2866 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js06-in.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#object": [{"@value": {"foo": "bar"}, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js06-out.jsonld b/core/src/test/resources/json-ld.org/compact-js06-out.jsonld new file mode 100644 index 00000000..ad312e8f --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js06-out.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#object", "@type": "@json"} + }, + "e": {"foo": "bar"} +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js07-context.jsonld b/core/src/test/resources/json-ld.org/compact-js07-context.jsonld new file mode 100644 index 00000000..09a17bfc --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js07-context.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#array", "@type": "@json", "@container": "@set"} + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js07-in.jsonld b/core/src/test/resources/json-ld.org/compact-js07-in.jsonld new file mode 100644 index 00000000..d0b1b28e --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js07-in.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#array": [{"@value": [{"foo": "bar"}], "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js07-out.jsonld b/core/src/test/resources/json-ld.org/compact-js07-out.jsonld new file mode 100644 index 00000000..b08ed7c3 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js07-out.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#array", "@type": "@json", "@container": "@set"} + }, + "e": [{"foo": "bar"}] +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js08-context.jsonld b/core/src/test/resources/json-ld.org/compact-js08-context.jsonld new file mode 100644 index 00000000..7a73a41b --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js08-context.jsonld @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js08-in.jsonld b/core/src/test/resources/json-ld.org/compact-js08-in.jsonld new file mode 100644 index 00000000..c9df2866 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js08-in.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#object": [{"@value": {"foo": "bar"}, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js08-out.jsonld b/core/src/test/resources/json-ld.org/compact-js08-out.jsonld new file mode 100644 index 00000000..73f4ece7 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js08-out.jsonld @@ -0,0 +1,3 @@ +{ + "http://example.org/vocab#object": {"@value": {"foo": "bar"}, "@type": "@json"} +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js09-context.jsonld b/core/src/test/resources/json-ld.org/compact-js09-context.jsonld new file mode 100644 index 00000000..dc428706 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js09-context.jsonld @@ -0,0 +1,3 @@ +{ + "@context": {"value": "@value", "type": "@type", "json": "@json"} +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js09-in.jsonld b/core/src/test/resources/json-ld.org/compact-js09-in.jsonld new file mode 100644 index 00000000..c9df2866 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js09-in.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#object": [{"@value": {"foo": "bar"}, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js09-out.jsonld b/core/src/test/resources/json-ld.org/compact-js09-out.jsonld new file mode 100644 index 00000000..fad9e455 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js09-out.jsonld @@ -0,0 +1,4 @@ +{ + "@context": {"value": "@value", "type": "@type", "json": "@json"}, + "http://example.org/vocab#object": {"value": {"foo": "bar"}, "type": "json"} +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js10-context.jsonld b/core/src/test/resources/json-ld.org/compact-js10-context.jsonld new file mode 100644 index 00000000..de7f300b --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js10-context.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#string", "@type": "@json"} + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js10-in.jsonld b/core/src/test/resources/json-ld.org/compact-js10-in.jsonld new file mode 100644 index 00000000..56ae74fc --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js10-in.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example.org/vocab#string": [{ + "@value": "string", + "@type": "@json" + }] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js10-out.jsonld b/core/src/test/resources/json-ld.org/compact-js10-out.jsonld new file mode 100644 index 00000000..bc5a698c --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js10-out.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#string", "@type": "@json"} + }, + "e": "string" +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js11-context.jsonld b/core/src/test/resources/json-ld.org/compact-js11-context.jsonld new file mode 100644 index 00000000..5aa24c41 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js11-context.jsonld @@ -0,0 +1,5 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#null", "@type": "@json"} + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js11-in.jsonld b/core/src/test/resources/json-ld.org/compact-js11-in.jsonld new file mode 100644 index 00000000..5efe8b14 --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js11-in.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example.org/vocab#null": [{ + "@value": null, + "@type": "@json" + }] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-js11-out.jsonld b/core/src/test/resources/json-ld.org/compact-js11-out.jsonld new file mode 100644 index 00000000..41f74edc --- /dev/null +++ b/core/src/test/resources/json-ld.org/compact-js11-out.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#null", "@type": "@json"} + }, + "e": null +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/compact-manifest.jsonld b/core/src/test/resources/json-ld.org/compact-manifest.jsonld index 14e06675..eb3b249a 100644 --- a/core/src/test/resources/json-ld.org/compact-manifest.jsonld +++ b/core/src/test/resources/json-ld.org/compact-manifest.jsonld @@ -615,6 +615,171 @@ "context": "compact-0106-context.jsonld", "expect": "compact-0106-out.jsonld", "option": {"processingMode": "json-ld-1.0", "specVersion": "json-ld-1.1"} + }, + { + "@id": "#tjs01", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:CompactTest" + ], + "name": "Compact JSON literal (boolean true)", + "purpose": "Tests compacting property with @type @json to a JSON literal (boolean true).", + "input": "compact-js01-in.jsonld", + "context": "compact-js01-context.jsonld", + "expect": "compact-js01-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs02", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:CompactTest" + ], + "name": "Compact JSON literal (boolean false)", + "purpose": "Tests compacting property with @type @json to a JSON literal (boolean false).", + "input": "compact-js02-in.jsonld", + "context": "compact-js02-context.jsonld", + "expect": "compact-js02-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs03", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:CompactTest" + ], + "name": "Compact JSON literal (double)", + "purpose": "Tests compacting property with @type @json to a JSON literal (double).", + "input": "compact-js03-in.jsonld", + "context": "compact-js03-context.jsonld", + "expect": "compact-js03-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs04", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:CompactTest" + ], + "name": "Compact JSON literal (double-zero)", + "purpose": "Tests compacting property with @type @json to a JSON literal (double-zero).", + "input": "compact-js04-in.jsonld", + "context": "compact-js04-context.jsonld", + "expect": "compact-js04-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs05", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:CompactTest" + ], + "name": "Compact JSON literal (integer)", + "purpose": "Tests compacting property with @type @json to a JSON literal (integer).", + "input": "compact-js05-in.jsonld", + "context": "compact-js05-context.jsonld", + "expect": "compact-js05-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs06", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:CompactTest" + ], + "name": "Compact JSON literal (object)", + "purpose": "Tests compacting property with @type @json to a JSON literal (object).", + "input": "compact-js06-in.jsonld", + "context": "compact-js06-context.jsonld", + "expect": "compact-js06-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs07", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:CompactTest" + ], + "name": "Compact JSON literal (array)", + "purpose": "Tests compacting property with @type @json to a JSON literal (array).", + "input": "compact-js07-in.jsonld", + "context": "compact-js07-context.jsonld", + "expect": "compact-js07-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs08", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:CompactTest" + ], + "name": "Compact already expanded JSON literal", + "purpose": "Tests compacting JSON literal does not expand terms inside json.", + "input": "compact-js08-in.jsonld", + "context": "compact-js08-context.jsonld", + "expect": "compact-js08-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs09", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:CompactTest" + ], + "name": "Compact already expanded JSON literal with aliased keys", + "purpose": "Tests compacting JSON literal in expanded form.", + "input": "compact-js09-in.jsonld", + "context": "compact-js09-context.jsonld", + "expect": "compact-js09-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs10", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:CompactTest" + ], + "name": "Compact JSON literal (string)", + "purpose": "Tests compacting property with @type @json to a JSON literal (string).", + "input": "compact-js10-in.jsonld", + "context": "compact-js10-context.jsonld", + "expect": "compact-js10-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs11", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:CompactTest" + ], + "name": "Compact JSON literal (null)", + "purpose": "Tests compacting property with @type @json to a JSON literal (null).", + "input": "compact-js11-in.jsonld", + "context": "compact-js11-context.jsonld", + "expect": "compact-js11-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } } ] } diff --git a/core/src/test/resources/json-ld.org/error-manifest.jsonld b/core/src/test/resources/json-ld.org/error-manifest.jsonld index 4b9b5c56..5c8817fb 100644 --- a/core/src/test/resources/json-ld.org/error-manifest.jsonld +++ b/core/src/test/resources/json-ld.org/error-manifest.jsonld @@ -316,6 +316,34 @@ "purpose": "Verifies that an exception is raised on expansion when processing an invalid context attempting to define @container on a keyword", "input": "expand-e042-in.jsonld", "expect": "keyword redefinition" + }, + { + "@id": "#tjs08", + "@type": [ + "jld:NegativeEvaluationTest", + "jld:FromRDFTest" + ], + "name": "Invalid JSON literal (bare-word)", + "purpose": "Processors must generate an error when deserializing an invalid JSON literal.", + "input": "fromRdf-js08-in.nq", + "expect": "invalid JSON literal", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs09", + "@type": [ + "jld:NegativeEvaluationTest", + "jld:FromRDFTest" + ], + "name": "Invalid JSON literal (invalid structure)", + "purpose": "Processors must generate an error when deserializing an invalid JSON literal.", + "input": "fromRdf-js09-in.nq", + "expect": "invalid JSON literal", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } } ] } diff --git a/core/src/test/resources/json-ld.org/expand-js01-in.jsonld b/core/src/test/resources/json-ld.org/expand-js01-in.jsonld new file mode 100644 index 00000000..01f43eb9 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js01-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#bool", "@type": "@json"} + }, + "e": true +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js01-out.jsonld b/core/src/test/resources/json-ld.org/expand-js01-out.jsonld new file mode 100644 index 00000000..642709fd --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js01-out.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#bool": [{"@value": true, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js02-in.jsonld b/core/src/test/resources/json-ld.org/expand-js02-in.jsonld new file mode 100644 index 00000000..d367df76 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js02-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#bool", "@type": "@json"} + }, + "e": false +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js02-out.jsonld b/core/src/test/resources/json-ld.org/expand-js02-out.jsonld new file mode 100644 index 00000000..640d3d29 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js02-out.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#bool": [{"@value": false, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js03-in.jsonld b/core/src/test/resources/json-ld.org/expand-js03-in.jsonld new file mode 100644 index 00000000..ca27fd8d --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js03-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#double", "@type": "@json"} + }, + "e": 1.23 +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js03-out.jsonld b/core/src/test/resources/json-ld.org/expand-js03-out.jsonld new file mode 100644 index 00000000..060691ac --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js03-out.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#double": [{"@value": 1.23, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js04-in.jsonld b/core/src/test/resources/json-ld.org/expand-js04-in.jsonld new file mode 100644 index 00000000..624c7382 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js04-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#double", "@type": "@json"} + }, + "e": 0.0e0 +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js04-out.jsonld b/core/src/test/resources/json-ld.org/expand-js04-out.jsonld new file mode 100644 index 00000000..278b08f0 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js04-out.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#double": [{"@value": 0.0e0, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js05-in.jsonld b/core/src/test/resources/json-ld.org/expand-js05-in.jsonld new file mode 100644 index 00000000..d9356725 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js05-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#integer", "@type": "@json"} + }, + "e": 123 +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js05-out.jsonld b/core/src/test/resources/json-ld.org/expand-js05-out.jsonld new file mode 100644 index 00000000..364fc8ff --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js05-out.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#integer": [{"@value": 123, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js06-in.jsonld b/core/src/test/resources/json-ld.org/expand-js06-in.jsonld new file mode 100644 index 00000000..ad312e8f --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js06-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#object", "@type": "@json"} + }, + "e": {"foo": "bar"} +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js06-out.jsonld b/core/src/test/resources/json-ld.org/expand-js06-out.jsonld new file mode 100644 index 00000000..c9df2866 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js06-out.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#object": [{"@value": {"foo": "bar"}, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js07-in.jsonld b/core/src/test/resources/json-ld.org/expand-js07-in.jsonld new file mode 100644 index 00000000..30601f4a --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js07-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#array", "@type": "@json"} + }, + "e": [{"foo": "bar"}] +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js07-out.jsonld b/core/src/test/resources/json-ld.org/expand-js07-out.jsonld new file mode 100644 index 00000000..d0b1b28e --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js07-out.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#array": [{"@value": [{"foo": "bar"}], "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js08-in.jsonld b/core/src/test/resources/json-ld.org/expand-js08-in.jsonld new file mode 100644 index 00000000..0c49e08a --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js08-in.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": [ + 56, + { + "d": true, + "10": null, + "1": [ ] + } + ] +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js08-out.jsonld b/core/src/test/resources/json-ld.org/expand-js08-out.jsonld new file mode 100644 index 00000000..98ecfbd4 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js08-out.jsonld @@ -0,0 +1,17 @@ +[ + { + "http://example.org/vocab#c14n": [ + { + "@type": "@json", + "@value": [ + 56, + { + "d": true, + "10": null, + "1": [] + } + ] + } + ] + } +] diff --git a/core/src/test/resources/json-ld.org/expand-js09-in.jsonld b/core/src/test/resources/json-ld.org/expand-js09-in.jsonld new file mode 100644 index 00000000..ed143019 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js09-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": { + "peach": "This sorting order", + "péché": "is wrong according to French", + "pêche": "but canonicalization MUST", + "sin": "ignore locale" + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js09-out.jsonld b/core/src/test/resources/json-ld.org/expand-js09-out.jsonld new file mode 100644 index 00000000..374c3d39 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js09-out.jsonld @@ -0,0 +1,15 @@ +[ + { + "http://example.org/vocab#c14n": [ + { + "@type": "@json", + "@value": { + "peach": "This sorting order", + "péché": "is wrong according to French", + "pêche": "but canonicalization MUST", + "sin": "ignore locale" + } + } + ] + } +] diff --git a/core/src/test/resources/json-ld.org/expand-js10-in.jsonld b/core/src/test/resources/json-ld.org/expand-js10-in.jsonld new file mode 100644 index 00000000..554341ea --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js10-in.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": { + "1": {"f": {"f": "hi","F": 5} ," ": 56.0}, + "10": { }, + "": "empty", + "a": { }, + "111": [ {"e": "yes","E": "no" } ], + "A": { } + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js10-out.jsonld b/core/src/test/resources/json-ld.org/expand-js10-out.jsonld new file mode 100644 index 00000000..0e0b9554 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js10-out.jsonld @@ -0,0 +1,17 @@ +[ + { + "http://example.org/vocab#c14n": [ + { + "@type": "@json", + "@value": { + "1": {"f": {"f": "hi","F": 5} ," ": 56.0}, + "10": { }, + "": "empty", + "a": { }, + "111": [ {"e": "yes","E": "no" } ], + "A": { } + } + } + ] + } +] diff --git a/core/src/test/resources/json-ld.org/expand-js11-in.jsonld b/core/src/test/resources/json-ld.org/expand-js11-in.jsonld new file mode 100644 index 00000000..4f3e8d15 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js11-in.jsonld @@ -0,0 +1,8 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": { + "Unnormalized Unicode":"A\u030a" + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js11-out.jsonld b/core/src/test/resources/json-ld.org/expand-js11-out.jsonld new file mode 100644 index 00000000..00207665 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js11-out.jsonld @@ -0,0 +1,12 @@ +[ + { + "http://example.org/vocab#c14n": [ + { + "@type": "@json", + "@value": { + "Unnormalized Unicode":"A\u030a" + } + } + ] + } +] diff --git a/core/src/test/resources/json-ld.org/expand-js12-in.jsonld b/core/src/test/resources/json-ld.org/expand-js12-in.jsonld new file mode 100644 index 00000000..f91d11ca --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js12-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": { + "numbers": [333333333.33333329, 1E30, 4.50, 2e-3, 0.000000000000000000000000001], + "string": "\u20ac$\u000F\u000aA'\u0042\u0022\u005c\\\"\/", + "literals": [null, true, false] + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js12-out.jsonld b/core/src/test/resources/json-ld.org/expand-js12-out.jsonld new file mode 100644 index 00000000..a0170d5b --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js12-out.jsonld @@ -0,0 +1,14 @@ +[ + { + "http://example.org/vocab#c14n": [ + { + "@type": "@json", + "@value": { + "numbers": [333333333.33333329, 1E30, 4.50, 2e-3, 0.000000000000000000000000001], + "string": "\u20ac$\u000F\u000aA'\u0042\u0022\u005c\\\"\/", + "literals": [null, true, false] + } + } + ] + } +] diff --git a/core/src/test/resources/json-ld.org/expand-js13-in.jsonld b/core/src/test/resources/json-ld.org/expand-js13-in.jsonld new file mode 100644 index 00000000..f39f22b7 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js13-in.jsonld @@ -0,0 +1,15 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": { + "\u20ac": "Euro Sign", + "\r": "Carriage Return", + "\u000a": "Newline", + "1": "One", + "\u0080": "Control\u007f", + "\ud83d\ude02": "Smiley", + "\u00f6": "Latin Small Letter O With Diaeresis", + "": "Browser Challenge" + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js13-out.jsonld b/core/src/test/resources/json-ld.org/expand-js13-out.jsonld new file mode 100644 index 00000000..39c27375 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js13-out.jsonld @@ -0,0 +1,19 @@ +[ + { + "http://example.org/vocab#c14n": [ + { + "@type": "@json", + "@value": { + "\u20ac": "Euro Sign", + "\r": "Carriage Return", + "\u000a": "Newline", + "1": "One", + "\u0080": "Control\u007f", + "\ud83d\ude02": "Smiley", + "\u00f6": "Latin Small Letter O With Diaeresis", + "": "Browser Challenge" + } + } + ] + } +] diff --git a/core/src/test/resources/json-ld.org/expand-js14-in.jsonld b/core/src/test/resources/json-ld.org/expand-js14-in.jsonld new file mode 100644 index 00000000..252e9ecb --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js14-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#array", "@type": "@json"} + }, + "e": [{"e": "bar"}] +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js14-out.jsonld b/core/src/test/resources/json-ld.org/expand-js14-out.jsonld new file mode 100644 index 00000000..a20f5d8e --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js14-out.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#array": [{"@value": [{"e": "bar"}], "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js15-in.jsonld b/core/src/test/resources/json-ld.org/expand-js15-in.jsonld new file mode 100644 index 00000000..cc9820a5 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js15-in.jsonld @@ -0,0 +1,3 @@ +{ + "http://example.org/vocab#object": [{"@value": {"foo": "bar"}, "@type": "@json"}] +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js15-out.jsonld b/core/src/test/resources/json-ld.org/expand-js15-out.jsonld new file mode 100644 index 00000000..c9df2866 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js15-out.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#object": [{"@value": {"foo": "bar"}, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js16-in.jsonld b/core/src/test/resources/json-ld.org/expand-js16-in.jsonld new file mode 100644 index 00000000..36a26f70 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js16-in.jsonld @@ -0,0 +1,4 @@ +{ + "@context": { "value": "@value", "type": "@type", "json": "@json"}, + "http://example.org/vocab#object": [{"value": {"foo": "bar"}, "type": "json"}] +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js16-out.jsonld b/core/src/test/resources/json-ld.org/expand-js16-out.jsonld new file mode 100644 index 00000000..c9df2866 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js16-out.jsonld @@ -0,0 +1,3 @@ +[{ + "http://example.org/vocab#object": [{"@value": {"foo": "bar"}, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js17-in.jsonld b/core/src/test/resources/json-ld.org/expand-js17-in.jsonld new file mode 100644 index 00000000..bc5a698c --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js17-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#string", "@type": "@json"} + }, + "e": "string" +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js17-out.jsonld b/core/src/test/resources/json-ld.org/expand-js17-out.jsonld new file mode 100644 index 00000000..56ae74fc --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js17-out.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example.org/vocab#string": [{ + "@value": "string", + "@type": "@json" + }] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js18-in.jsonld b/core/src/test/resources/json-ld.org/expand-js18-in.jsonld new file mode 100644 index 00000000..41f74edc --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js18-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#null", "@type": "@json"} + }, + "e": null +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js18-out.jsonld b/core/src/test/resources/json-ld.org/expand-js18-out.jsonld new file mode 100644 index 00000000..5efe8b14 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js18-out.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example.org/vocab#null": [{ + "@value": null, + "@type": "@json" + }] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js19-in.jsonld b/core/src/test/resources/json-ld.org/expand-js19-in.jsonld new file mode 100644 index 00000000..2de7c95e --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js19-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "type": "@type" + }, + "ex:foo": { + "type": "@json", + "@value": { + "test": 1 + } + } +} diff --git a/core/src/test/resources/json-ld.org/expand-js19-out.jsonld b/core/src/test/resources/json-ld.org/expand-js19-out.jsonld new file mode 100644 index 00000000..da4939cc --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js19-out.jsonld @@ -0,0 +1,8 @@ +[{ + "ex:foo": [{ + "@type": "@json", + "@value": { + "test": 1 + } + }] +}] diff --git a/core/src/test/resources/json-ld.org/expand-js20-in.jsonld b/core/src/test/resources/json-ld.org/expand-js20-in.jsonld new file mode 100644 index 00000000..d87ac017 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js20-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "value": "@value" + }, + "ex:foo": { + "@type": "@json", + "value": { + "test": 1 + } + } +} diff --git a/core/src/test/resources/json-ld.org/expand-js20-out.jsonld b/core/src/test/resources/json-ld.org/expand-js20-out.jsonld new file mode 100644 index 00000000..da4939cc --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js20-out.jsonld @@ -0,0 +1,8 @@ +[{ + "ex:foo": [{ + "@type": "@json", + "@value": { + "test": 1 + } + }] +}] diff --git a/core/src/test/resources/json-ld.org/expand-js21-in.jsonld b/core/src/test/resources/json-ld.org/expand-js21-in.jsonld new file mode 100644 index 00000000..ec42d67f --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js21-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "ex:foo": { + "@type": "@json" + } + }, + "ex:foo": { + "@context": "ex:not:a:context", + "test": 1 + } +} diff --git a/core/src/test/resources/json-ld.org/expand-js21-out.jsonld b/core/src/test/resources/json-ld.org/expand-js21-out.jsonld new file mode 100644 index 00000000..8509c9cf --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js21-out.jsonld @@ -0,0 +1,9 @@ +[{ + "ex:foo": [{ + "@type": "@json", + "@value": { + "@context": "ex:not:a:context", + "test": 1 + } + }] +}] diff --git a/core/src/test/resources/json-ld.org/expand-js22-in.jsonld b/core/src/test/resources/json-ld.org/expand-js22-in.jsonld new file mode 100644 index 00000000..7d2d4320 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js22-in.jsonld @@ -0,0 +1,3 @@ +{ + "http://example.org/vocab#null": {"@value": null, "@type": "@json"} +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js22-out.jsonld b/core/src/test/resources/json-ld.org/expand-js22-out.jsonld new file mode 100644 index 00000000..5efe8b14 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js22-out.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example.org/vocab#null": [{ + "@value": null, + "@type": "@json" + }] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js23-in.jsonld b/core/src/test/resources/json-ld.org/expand-js23-in.jsonld new file mode 100644 index 00000000..d45cd202 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js23-in.jsonld @@ -0,0 +1,3 @@ +{ + "http://example.org/vocab#null": {"@value": [], "@type": "@json"} +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-js23-out.jsonld b/core/src/test/resources/json-ld.org/expand-js23-out.jsonld new file mode 100644 index 00000000..d08dd980 --- /dev/null +++ b/core/src/test/resources/json-ld.org/expand-js23-out.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example.org/vocab#null": [{ + "@value": [], + "@type": "@json" + }] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/expand-manifest.jsonld b/core/src/test/resources/json-ld.org/expand-manifest.jsonld index 49a200c9..a17b274d 100644 --- a/core/src/test/resources/json-ld.org/expand-manifest.jsonld +++ b/core/src/test/resources/json-ld.org/expand-manifest.jsonld @@ -551,6 +551,338 @@ }, "input": "expand-0077-in.jsonld", "expect": "expand-0077-out.jsonld" + }, { + "@id": "#t0077", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "expandContext option", + "purpose": "Use of the expandContext option to expand the input document", + "option": { + "expandContext": "expand-0077-context.jsonld" + }, + "input": "expand-0077-in.jsonld", + "expect": "expand-0077-out.jsonld" + }, + { + "@id": "#tjs01", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal (boolean true)", + "purpose": "Tests expanding property with @type @json to a JSON literal (boolean true).", + "input": "expand-js01-in.jsonld", + "expect": "expand-js01-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs02", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal (boolean false)", + "purpose": "Tests expanding property with @type @json to a JSON literal (boolean false).", + "input": "expand-js02-in.jsonld", + "expect": "expand-js02-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs03", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal (double)", + "purpose": "Tests expanding property with @type @json to a JSON literal (double).", + "input": "expand-js03-in.jsonld", + "expect": "expand-js03-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs04", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal (double-zero)", + "purpose": "Tests expanding property with @type @json to a JSON literal (double-zero).", + "input": "expand-js04-in.jsonld", + "expect": "expand-js04-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs05", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal (integer)", + "purpose": "Tests expanding property with @type @json to a JSON literal (integer).", + "input": "expand-js05-in.jsonld", + "expect": "expand-js05-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs06", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal (object)", + "purpose": "Tests expanding property with @type @json to a JSON literal (object).", + "input": "expand-js06-in.jsonld", + "expect": "expand-js06-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs07", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal (array)", + "purpose": "Tests expanding property with @type @json to a JSON literal (array).", + "input": "expand-js07-in.jsonld", + "expect": "expand-js07-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs08", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal with array canonicalization", + "purpose": "Tests expanding JSON literal with array canonicalization.", + "input": "expand-js08-in.jsonld", + "expect": "expand-js08-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs09", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Transform JSON literal with string canonicalization", + "purpose": "Tests expanding JSON literal with string canonicalization.", + "input": "expand-js09-in.jsonld", + "expect": "expand-js09-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs10", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal with structural canonicalization", + "purpose": "Tests expanding JSON literal with structural canonicalization.", + "input": "expand-js10-in.jsonld", + "expect": "expand-js10-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs11", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal with unicode canonicalization", + "purpose": "Tests expanding JSON literal with unicode canonicalization.", + "input": "expand-js11-in.jsonld", + "expect": "expand-js11-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs12", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal with value canonicalization", + "purpose": "Tests expanding JSON literal with value canonicalization.", + "input": "expand-js12-in.jsonld", + "expect": "expand-js12-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs13", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal with wierd canonicalization", + "purpose": "Tests expanding JSON literal with wierd canonicalization.", + "input": "expand-js13-in.jsonld", + "expect": "expand-js13-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs14", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal without expanding contents", + "purpose": "Tests expanding JSON literal does not expand terms inside json.", + "input": "expand-js14-in.jsonld", + "expect": "expand-js14-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs15", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal aleady in expanded form", + "purpose": "Tests expanding JSON literal in expanded form.", + "input": "expand-js15-in.jsonld", + "expect": "expand-js15-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs16", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal aleady in expanded form with aliased keys", + "purpose": "Tests expanding JSON literal in expanded form with aliased keys in value object.", + "input": "expand-js16-in.jsonld", + "expect": "expand-js16-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs17", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal (string)", + "purpose": "Tests expanding property with @type @json to a JSON literal (string).", + "input": "expand-js17-in.jsonld", + "expect": "expand-js17-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs18", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal (null)", + "purpose": "Tests expanding property with @type @json to a JSON literal (null).", + "input": "expand-js18-in.jsonld", + "expect": "expand-js18-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs19", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal with aliased @type", + "purpose": "Tests expanding JSON literal with aliased @type.", + "input": "expand-js19-in.jsonld", + "expect": "expand-js19-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs20", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal with aliased @value", + "purpose": "Tests expanding JSON literal with aliased @value.", + "input": "expand-js20-in.jsonld", + "expect": "expand-js20-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs21", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal with @context", + "purpose": "Tests expanding JSON literal with a @context.", + "input": "expand-js21-in.jsonld", + "expect": "expand-js21-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs22", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal (null) aleady in expanded form.", + "purpose": "Tests expanding property with @type @json to a JSON literal (null).", + "input": "expand-js22-in.jsonld", + "expect": "expand-js22-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs23", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ExpandTest" + ], + "name": "Expand JSON literal (empty array).", + "purpose": "Tests expanding property with @type @json to a JSON literal (empty array).", + "input": "expand-js23-in.jsonld", + "expect": "expand-js23-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } } ] } diff --git a/core/src/test/resources/json-ld.org/fromRdf-js01-in.nq b/core/src/test/resources/json-ld.org/fromRdf-js01-in.nq new file mode 100644 index 00000000..49b72920 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js01-in.nq @@ -0,0 +1 @@ + "true"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js01-out.jsonld b/core/src/test/resources/json-ld.org/fromRdf-js01-out.jsonld new file mode 100644 index 00000000..e5d59442 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js01-out.jsonld @@ -0,0 +1,4 @@ +[{ + "@id": "http://example.org/vocab#id", + "http://example.org/vocab#bool": [{"@value": true, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js02-in.nq b/core/src/test/resources/json-ld.org/fromRdf-js02-in.nq new file mode 100644 index 00000000..f88e0fa6 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js02-in.nq @@ -0,0 +1 @@ + "false"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js02-out.jsonld b/core/src/test/resources/json-ld.org/fromRdf-js02-out.jsonld new file mode 100644 index 00000000..5e831a6c --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js02-out.jsonld @@ -0,0 +1,4 @@ +[{ + "@id": "http://example.org/vocab#id", + "http://example.org/vocab#bool": [{"@value": false, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js03-in.nq b/core/src/test/resources/json-ld.org/fromRdf-js03-in.nq new file mode 100644 index 00000000..83f070a5 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js03-in.nq @@ -0,0 +1 @@ + "1.23"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js03-out.jsonld b/core/src/test/resources/json-ld.org/fromRdf-js03-out.jsonld new file mode 100644 index 00000000..19e3e095 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js03-out.jsonld @@ -0,0 +1,4 @@ +[{ + "@id": "http://example.org/vocab#id", + "http://example.org/vocab#double": [{"@value": 1.23E0, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js04-in.nq b/core/src/test/resources/json-ld.org/fromRdf-js04-in.nq new file mode 100644 index 00000000..cd8145ef --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js04-in.nq @@ -0,0 +1 @@ + "0"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js04-out.jsonld b/core/src/test/resources/json-ld.org/fromRdf-js04-out.jsonld new file mode 100644 index 00000000..d0171d50 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js04-out.jsonld @@ -0,0 +1,4 @@ +[{ + "@id": "http://example.org/vocab#id", + "http://example.org/vocab#double": [{"@value": 0, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js05-in.nq b/core/src/test/resources/json-ld.org/fromRdf-js05-in.nq new file mode 100644 index 00000000..063dda24 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js05-in.nq @@ -0,0 +1 @@ + "123"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js05-out.jsonld b/core/src/test/resources/json-ld.org/fromRdf-js05-out.jsonld new file mode 100644 index 00000000..438a44e1 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js05-out.jsonld @@ -0,0 +1,4 @@ +[{ + "@id": "http://example.org/vocab#id", + "http://example.org/vocab#integer": [{"@value": 123, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js06-in.nq b/core/src/test/resources/json-ld.org/fromRdf-js06-in.nq new file mode 100644 index 00000000..498c22b0 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js06-in.nq @@ -0,0 +1 @@ + "{\"foo\":\"bar\"}"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js06-out.jsonld b/core/src/test/resources/json-ld.org/fromRdf-js06-out.jsonld new file mode 100644 index 00000000..89844df5 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js06-out.jsonld @@ -0,0 +1,4 @@ +[{ + "@id": "http://example.org/vocab#id", + "http://example.org/vocab#object": [{"@value": {"foo": "bar"}, "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js07-in.nq b/core/src/test/resources/json-ld.org/fromRdf-js07-in.nq new file mode 100644 index 00000000..257f4b0a --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js07-in.nq @@ -0,0 +1 @@ + "[{\"foo\":\"bar\"}]"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js07-out.jsonld b/core/src/test/resources/json-ld.org/fromRdf-js07-out.jsonld new file mode 100644 index 00000000..3233b0b9 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js07-out.jsonld @@ -0,0 +1,4 @@ +[{ + "@id": "http://example.org/vocab#id", + "http://example.org/vocab#array": [{"@value": [{"foo": "bar"}], "@type": "@json"}] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js08-in.nq b/core/src/test/resources/json-ld.org/fromRdf-js08-in.nq new file mode 100644 index 00000000..81a90a65 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js08-in.nq @@ -0,0 +1 @@ + "bareword"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js09-in.nq b/core/src/test/resources/json-ld.org/fromRdf-js09-in.nq new file mode 100644 index 00000000..55d4020f --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js09-in.nq @@ -0,0 +1 @@ + "[{]"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js10-in.nq b/core/src/test/resources/json-ld.org/fromRdf-js10-in.nq new file mode 100644 index 00000000..836a0d04 --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js10-in.nq @@ -0,0 +1 @@ + "\"string\""^^ . diff --git a/core/src/test/resources/json-ld.org/fromRdf-js10-out.jsonld b/core/src/test/resources/json-ld.org/fromRdf-js10-out.jsonld new file mode 100644 index 00000000..62c5e0ae --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js10-out.jsonld @@ -0,0 +1,7 @@ +[{ + "@id": "http://example.org/vocab#id", + "http://example.org/vocab#string": [{ + "@value": "string", + "@type": "@json" + }] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-js11-in.nq b/core/src/test/resources/json-ld.org/fromRdf-js11-in.nq new file mode 100644 index 00000000..6ae11cce --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js11-in.nq @@ -0,0 +1 @@ + "null"^^ . diff --git a/core/src/test/resources/json-ld.org/fromRdf-js11-out.jsonld b/core/src/test/resources/json-ld.org/fromRdf-js11-out.jsonld new file mode 100644 index 00000000..b450bece --- /dev/null +++ b/core/src/test/resources/json-ld.org/fromRdf-js11-out.jsonld @@ -0,0 +1,7 @@ +[{ + "@id": "http://example.org/vocab#id", + "http://example.org/vocab#null": [{ + "@value": null, + "@type": "@json" + }] +}] \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/fromRdf-manifest.jsonld b/core/src/test/resources/json-ld.org/fromRdf-manifest.jsonld index 6d9451bb..c8b9381d 100644 --- a/core/src/test/resources/json-ld.org/fromRdf-manifest.jsonld +++ b/core/src/test/resources/json-ld.org/fromRdf-manifest.jsonld @@ -152,6 +152,132 @@ "purpose": "Tests the proper formatting of @type (even with useRdfType to false) into rdf:type when the object contains more triples.", "input": "fromRdf-0020-in.nq", "expect": "fromRdf-0020-out.jsonld" + }, + { + "@id": "#tjs01", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:FromRDFTest" + ], + "name": "JSON literal (boolean true)", + "purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (boolean true).", + "input": "fromRdf-js01-in.nq", + "expect": "fromRdf-js01-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs02", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:FromRDFTest" + ], + "name": "JSON literal (boolean false)", + "purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (boolean false).", + "input": "fromRdf-js02-in.nq", + "expect": "fromRdf-js02-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs03", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:FromRDFTest" + ], + "name": "JSON literal (double)", + "purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (double).", + "input": "fromRdf-js03-in.nq", + "expect": "fromRdf-js03-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs04", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:FromRDFTest" + ], + "name": "JSON literal (double-zero)", + "purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (double-zero).", + "input": "fromRdf-js04-in.nq", + "expect": "fromRdf-js04-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs05", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:FromRDFTest" + ], + "name": "JSON literal (integer)", + "purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (integer).", + "input": "fromRdf-js05-in.nq", + "expect": "fromRdf-js05-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs06", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:FromRDFTest" + ], + "name": "JSON literal (object)", + "purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (object).", + "input": "fromRdf-js06-in.nq", + "expect": "fromRdf-js06-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs07", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:FromRDFTest" + ], + "name": "JSON literal (array)", + "purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (array).", + "input": "fromRdf-js07-in.nq", + "expect": "fromRdf-js07-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs10", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:FromRDFTest" + ], + "name": "JSON literal (string)", + "purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (string).", + "input": "fromRdf-js10-in.nq", + "expect": "fromRdf-js10-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs11", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:FromRDFTest" + ], + "name": "JSON literal (null)", + "purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (null).", + "input": "fromRdf-js11-in.nq", + "expect": "fromRdf-js11-out.jsonld", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } } ] } diff --git a/core/src/test/resources/json-ld.org/toRdf-js01-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js01-in.jsonld new file mode 100644 index 00000000..43021e19 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js01-in.jsonld @@ -0,0 +1,9 @@ +{ + "@context": { + "e": { + "@id": "http://example.org/vocab#bool", + "@type": "@json" + } + }, + "e": true +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js01-out.nq b/core/src/test/resources/json-ld.org/toRdf-js01-out.nq new file mode 100644 index 00000000..bac18733 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js01-out.nq @@ -0,0 +1 @@ +_:b0 "true"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js02-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js02-in.jsonld new file mode 100644 index 00000000..d367df76 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js02-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#bool", "@type": "@json"} + }, + "e": false +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js02-out.nq b/core/src/test/resources/json-ld.org/toRdf-js02-out.nq new file mode 100644 index 00000000..7bb8fd1f --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js02-out.nq @@ -0,0 +1 @@ +_:b0 "false"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js03-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js03-in.jsonld new file mode 100644 index 00000000..ca27fd8d --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js03-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#double", "@type": "@json"} + }, + "e": 1.23 +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js03-out.nq b/core/src/test/resources/json-ld.org/toRdf-js03-out.nq new file mode 100644 index 00000000..1fbd15a4 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js03-out.nq @@ -0,0 +1 @@ +_:b0 "1.23"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js04-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js04-in.jsonld new file mode 100644 index 00000000..624c7382 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js04-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#double", "@type": "@json"} + }, + "e": 0.0e0 +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js04-out.nq b/core/src/test/resources/json-ld.org/toRdf-js04-out.nq new file mode 100644 index 00000000..1172726d --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js04-out.nq @@ -0,0 +1 @@ +_:b0 "0"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js05-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js05-in.jsonld new file mode 100644 index 00000000..d9356725 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js05-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#integer", "@type": "@json"} + }, + "e": 123 +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js05-out.nq b/core/src/test/resources/json-ld.org/toRdf-js05-out.nq new file mode 100644 index 00000000..d8c47b46 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js05-out.nq @@ -0,0 +1 @@ +_:b0 "123"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js06-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js06-in.jsonld new file mode 100644 index 00000000..ad312e8f --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js06-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#object", "@type": "@json"} + }, + "e": {"foo": "bar"} +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js06-out.nq b/core/src/test/resources/json-ld.org/toRdf-js06-out.nq new file mode 100644 index 00000000..4909a3d6 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js06-out.nq @@ -0,0 +1 @@ +_:b0 "{\"foo\":\"bar\"}"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js07-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js07-in.jsonld new file mode 100644 index 00000000..30601f4a --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js07-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#array", "@type": "@json"} + }, + "e": [{"foo": "bar"}] +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js07-out.nq b/core/src/test/resources/json-ld.org/toRdf-js07-out.nq new file mode 100644 index 00000000..f2ef8961 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js07-out.nq @@ -0,0 +1 @@ +_:b0 "[{\"foo\":\"bar\"}]"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js08-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js08-in.jsonld new file mode 100644 index 00000000..0c49e08a --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js08-in.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": [ + 56, + { + "d": true, + "10": null, + "1": [ ] + } + ] +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js08-out.nq b/core/src/test/resources/json-ld.org/toRdf-js08-out.nq new file mode 100644 index 00000000..b27b6b7d --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js08-out.nq @@ -0,0 +1 @@ +_:b0 "[56,{\"1\":[],\"10\":null,\"d\":true}]"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js09-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js09-in.jsonld new file mode 100644 index 00000000..ed143019 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js09-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": { + "peach": "This sorting order", + "péché": "is wrong according to French", + "pêche": "but canonicalization MUST", + "sin": "ignore locale" + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js09-out.nq b/core/src/test/resources/json-ld.org/toRdf-js09-out.nq new file mode 100644 index 00000000..aedbd732 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js09-out.nq @@ -0,0 +1 @@ +_:b0 "{\"peach\":\"This sorting order\",\"péché\":\"is wrong according to French\",\"pêche\":\"but canonicalization MUST\",\"sin\":\"ignore locale\"}"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js10-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js10-in.jsonld new file mode 100644 index 00000000..554341ea --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js10-in.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": { + "1": {"f": {"f": "hi","F": 5} ," ": 56.0}, + "10": { }, + "": "empty", + "a": { }, + "111": [ {"e": "yes","E": "no" } ], + "A": { } + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js10-out.nq b/core/src/test/resources/json-ld.org/toRdf-js10-out.nq new file mode 100644 index 00000000..055426c8 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js10-out.nq @@ -0,0 +1 @@ +_:b0 "{\"\":\"empty\",\"1\":{\" \":56,\"f\":{\"F\":5,\"f\":\"hi\"}},\"10\":{},\"111\":[{\"E\":\"no\",\"e\":\"yes\"}],\"A\":{},\"a\":{}}"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js11-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js11-in.jsonld new file mode 100644 index 00000000..4f3e8d15 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js11-in.jsonld @@ -0,0 +1,8 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": { + "Unnormalized Unicode":"A\u030a" + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js11-out.nq b/core/src/test/resources/json-ld.org/toRdf-js11-out.nq new file mode 100644 index 00000000..0d41a89d --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js11-out.nq @@ -0,0 +1 @@ +_:b0 "{\"Unnormalized Unicode\":\"Å\"}"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js12-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js12-in.jsonld new file mode 100644 index 00000000..f91d11ca --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js12-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": { + "numbers": [333333333.33333329, 1E30, 4.50, 2e-3, 0.000000000000000000000000001], + "string": "\u20ac$\u000F\u000aA'\u0042\u0022\u005c\\\"\/", + "literals": [null, true, false] + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js12-out.nq b/core/src/test/resources/json-ld.org/toRdf-js12-out.nq new file mode 100644 index 00000000..1c5d73f9 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js12-out.nq @@ -0,0 +1 @@ +_:b0 "{\"literals\":[null,true,false],\"numbers\":[333333333.3333333,1e+30,4.5,0.002,1e-27],\"string\":\"€$\\u000f\\nA'B\\\"\\\\\\\\\\\"/\"}"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js13-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js13-in.jsonld new file mode 100644 index 00000000..f39f22b7 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js13-in.jsonld @@ -0,0 +1,15 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"} + }, + "e": { + "\u20ac": "Euro Sign", + "\r": "Carriage Return", + "\u000a": "Newline", + "1": "One", + "\u0080": "Control\u007f", + "\ud83d\ude02": "Smiley", + "\u00f6": "Latin Small Letter O With Diaeresis", + "": "Browser Challenge" + } +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js13-out.nq b/core/src/test/resources/json-ld.org/toRdf-js13-out.nq new file mode 100644 index 00000000..f0fc6770 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js13-out.nq @@ -0,0 +1 @@ +_:b0 "{\"\\n\":\"Newline\",\"\\r\":\"Carriage Return\",\"1\":\"One\",\"\":\"Browser Challenge\",\"€\":\"Control\",\"ö\":\"Latin Small Letter O With Diaeresis\",\"€\":\"Euro Sign\",\"😂\":\"Smiley\"}"^^ . \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js14-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js14-in.jsonld new file mode 100644 index 00000000..252e9ecb --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js14-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#array", "@type": "@json"} + }, + "e": [{"e": "bar"}] +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js14-out.nq b/core/src/test/resources/json-ld.org/toRdf-js14-out.nq new file mode 100644 index 00000000..8ee96b49 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js14-out.nq @@ -0,0 +1 @@ +_:b0 "[{\"e\":\"bar\"}]"^^ . diff --git a/core/src/test/resources/json-ld.org/toRdf-js15-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js15-in.jsonld new file mode 100644 index 00000000..cc9820a5 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js15-in.jsonld @@ -0,0 +1,3 @@ +{ + "http://example.org/vocab#object": [{"@value": {"foo": "bar"}, "@type": "@json"}] +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js15-out.nq b/core/src/test/resources/json-ld.org/toRdf-js15-out.nq new file mode 100644 index 00000000..3448b29b --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js15-out.nq @@ -0,0 +1 @@ +_:b0 "{\"foo\":\"bar\"}"^^ . diff --git a/core/src/test/resources/json-ld.org/toRdf-js16-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js16-in.jsonld new file mode 100644 index 00000000..a303d0ea --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js16-in.jsonld @@ -0,0 +1,4 @@ +{ + "@context": {"value": "@value", "type": "@type", "json": "@json"}, + "http://example.org/vocab#object": [{"value": {"foo": "bar"}, "type": "json"}] +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js16-out.nq b/core/src/test/resources/json-ld.org/toRdf-js16-out.nq new file mode 100644 index 00000000..3448b29b --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js16-out.nq @@ -0,0 +1 @@ +_:b0 "{\"foo\":\"bar\"}"^^ . diff --git a/core/src/test/resources/json-ld.org/toRdf-js17-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js17-in.jsonld new file mode 100644 index 00000000..bc5a698c --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js17-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#string", "@type": "@json"} + }, + "e": "string" +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js17-out.nq b/core/src/test/resources/json-ld.org/toRdf-js17-out.nq new file mode 100644 index 00000000..f60136c6 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js17-out.nq @@ -0,0 +1 @@ +_:b0 "\"string\""^^ . diff --git a/core/src/test/resources/json-ld.org/toRdf-js18-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js18-in.jsonld new file mode 100644 index 00000000..41f74edc --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js18-in.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "e": {"@id": "http://example.org/vocab#null", "@type": "@json"} + }, + "e": null +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js18-out.nq b/core/src/test/resources/json-ld.org/toRdf-js18-out.nq new file mode 100644 index 00000000..de3cac89 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js18-out.nq @@ -0,0 +1 @@ +_:b0 "null"^^ . diff --git a/core/src/test/resources/json-ld.org/toRdf-js19-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js19-in.jsonld new file mode 100644 index 00000000..2de7c95e --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js19-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "type": "@type" + }, + "ex:foo": { + "type": "@json", + "@value": { + "test": 1 + } + } +} diff --git a/core/src/test/resources/json-ld.org/toRdf-js19-out.nq b/core/src/test/resources/json-ld.org/toRdf-js19-out.nq new file mode 100644 index 00000000..e1018ffa --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js19-out.nq @@ -0,0 +1 @@ +_:b0 "{\"test\":1}"^^ . diff --git a/core/src/test/resources/json-ld.org/toRdf-js20-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js20-in.jsonld new file mode 100644 index 00000000..d87ac017 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js20-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "value": "@value" + }, + "ex:foo": { + "@type": "@json", + "value": { + "test": 1 + } + } +} diff --git a/core/src/test/resources/json-ld.org/toRdf-js20-out.nq b/core/src/test/resources/json-ld.org/toRdf-js20-out.nq new file mode 100644 index 00000000..e1018ffa --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js20-out.nq @@ -0,0 +1 @@ +_:b0 "{\"test\":1}"^^ . diff --git a/core/src/test/resources/json-ld.org/toRdf-js21-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js21-in.jsonld new file mode 100644 index 00000000..ec42d67f --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js21-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "ex:foo": { + "@type": "@json" + } + }, + "ex:foo": { + "@context": "ex:not:a:context", + "test": 1 + } +} diff --git a/core/src/test/resources/json-ld.org/toRdf-js21-out.nq b/core/src/test/resources/json-ld.org/toRdf-js21-out.nq new file mode 100644 index 00000000..6de7324a --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js21-out.nq @@ -0,0 +1 @@ +_:b0 "{\"@context\":\"ex:not:a:context\",\"test\":1}"^^ . diff --git a/core/src/test/resources/json-ld.org/toRdf-js22-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js22-in.jsonld new file mode 100644 index 00000000..7d2d4320 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js22-in.jsonld @@ -0,0 +1,3 @@ +{ + "http://example.org/vocab#null": {"@value": null, "@type": "@json"} +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js22-out.nq b/core/src/test/resources/json-ld.org/toRdf-js22-out.nq new file mode 100644 index 00000000..de3cac89 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js22-out.nq @@ -0,0 +1 @@ +_:b0 "null"^^ . diff --git a/core/src/test/resources/json-ld.org/toRdf-js23-in.jsonld b/core/src/test/resources/json-ld.org/toRdf-js23-in.jsonld new file mode 100644 index 00000000..d45cd202 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js23-in.jsonld @@ -0,0 +1,3 @@ +{ + "http://example.org/vocab#null": {"@value": [], "@type": "@json"} +} \ No newline at end of file diff --git a/core/src/test/resources/json-ld.org/toRdf-js23-out.nq b/core/src/test/resources/json-ld.org/toRdf-js23-out.nq new file mode 100644 index 00000000..e30de539 --- /dev/null +++ b/core/src/test/resources/json-ld.org/toRdf-js23-out.nq @@ -0,0 +1 @@ +_:b0 "[]"^^ . diff --git a/core/src/test/resources/json-ld.org/toRdf-manifest.jsonld b/core/src/test/resources/json-ld.org/toRdf-manifest.jsonld index a8d2fdf2..c30bf48b 100644 --- a/core/src/test/resources/json-ld.org/toRdf-manifest.jsonld +++ b/core/src/test/resources/json-ld.org/toRdf-manifest.jsonld @@ -884,6 +884,314 @@ "purpose": "IRI resolution according to RFC3986.", "input": "toRdf-0132-in.jsonld", "expect": "toRdf-0132-out.nq" + }, + { + "@id": "#tjs01", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal (boolean true)", + "purpose": "Tests transforming property with @type @json to a JSON literal (boolean true).", + "input": "toRdf-js01-in.jsonld", + "expect": "toRdf-js01-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs02", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal (boolean false)", + "purpose": "Tests transforming property with @type @json to a JSON literal (boolean false).", + "input": "toRdf-js02-in.jsonld", + "expect": "toRdf-js02-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs03", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal (double)", + "purpose": "Tests transforming property with @type @json to a JSON literal (double).", + "input": "toRdf-js03-in.jsonld", + "expect": "toRdf-js03-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs04", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal (double-zero)", + "purpose": "Tests transforming property with @type @json to a JSON literal (double-zero).", + "input": "toRdf-js04-in.jsonld", + "expect": "toRdf-js04-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs05", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal (integer)", + "purpose": "Tests transforming property with @type @json to a JSON literal (integer).", + "input": "toRdf-js05-in.jsonld", + "expect": "toRdf-js05-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs06", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal (object)", + "purpose": "Tests transforming property with @type @json to a JSON literal (object).", + "input": "toRdf-js06-in.jsonld", + "expect": "toRdf-js06-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs07", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal (array)", + "purpose": "Tests transforming property with @type @json to a JSON literal (array).", + "input": "toRdf-js07-in.jsonld", + "expect": "toRdf-js07-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs08", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal with array canonicalization", + "purpose": "Tests transforming JSON literal with array canonicalization.", + "input": "toRdf-js08-in.jsonld", + "expect": "toRdf-js08-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs09", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal with string canonicalization", + "purpose": "Tests transforming JSON literal with string canonicalization.", + "input": "toRdf-js09-in.jsonld", + "expect": "toRdf-js09-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs10", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal with structural canonicalization", + "purpose": "Tests transforming JSON literal with structural canonicalization.", + "input": "toRdf-js10-in.jsonld", + "expect": "toRdf-js10-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs11", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal with unicode canonicalization", + "purpose": "Tests transforming JSON literal with unicode canonicalization.", + "input": "toRdf-js11-in.jsonld", + "expect": "toRdf-js11-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs13", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal with wierd canonicalization", + "purpose": "Tests transforming JSON literal with wierd canonicalization.", + "input": "toRdf-js13-in.jsonld", + "expect": "toRdf-js13-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs14", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal without expanding contents", + "purpose": "Tests transforming JSON literal does not expand terms inside json.", + "input": "toRdf-js14-in.jsonld", + "expect": "toRdf-js14-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs15", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal aleady in expanded form", + "purpose": "Tests transforming JSON literal in expanded form.", + "input": "toRdf-js15-in.jsonld", + "expect": "toRdf-js15-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs16", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal aleady in expanded form with aliased keys", + "purpose": "Tests transforming JSON literal in expanded form with aliased keys in value object.", + "input": "toRdf-js16-in.jsonld", + "expect": "toRdf-js16-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs17", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal (string)", + "purpose": "Tests transforming property with @type @json to a JSON literal (string).", + "input": "toRdf-js17-in.jsonld", + "expect": "toRdf-js17-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs18", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal (null)", + "purpose": "Tests transforming property with @type @json to a JSON literal (null).", + "input": "toRdf-js18-in.jsonld", + "expect": "toRdf-js18-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs19", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal with aliased @type", + "purpose": "Tests transforming JSON literal with aliased @type.", + "input": "toRdf-js19-in.jsonld", + "expect": "toRdf-js19-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs20", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal with aliased @value", + "purpose": "Tests transforming JSON literal with aliased @value.", + "input": "toRdf-js20-in.jsonld", + "expect": "toRdf-js20-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs21", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal with @context", + "purpose": "Tests transforming JSON literal with a @context.", + "input": "toRdf-js21-in.jsonld", + "expect": "toRdf-js21-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs22", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal (null) aleady in expanded form.", + "purpose": "Tests transforming property with @type @json to a JSON literal (null).", + "input": "toRdf-js22-in.jsonld", + "expect": "toRdf-js22-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } + }, + { + "@id": "#tjs23", + "@type": [ + "jld:PositiveEvaluationTest", + "jld:ToRDFTest" + ], + "name": "Transform JSON literal (empty array).", + "purpose": "Tests transforming property with @type @json to a JSON literal (empty array).", + "input": "toRdf-js23-in.jsonld", + "expect": "toRdf-js23-out.nq", + "option": { + "processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1" + } } ] }