Current state of 1.1 development by fsteeg · Pull Request #284 · jsonld-java/jsonld-java · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 0 additions & 94 deletions core/reports/json-ld-api-tests-skip

Large diffs are not rendered by default.

151 changes: 117 additions & 34 deletions core/src/main/java/com/github/jsonldjava/core/Context.java

Large diffs are not rendered by default.

66 changes: 59 additions & 7 deletions core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,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
Expand Down Expand Up @@ -58,6 +59,13 @@ public final class JsonLdConsts {
public static final String VOCAB = "@vocab";
public static final String BASE = "@base";
public static final String REQUIRE_ALL = "@requireAll";
public static final String VERSION = "@version";
public static final String PROTECTED = "@protected";
public static final String PROPAGATE = "@propagate";
public static final String IMPORT = "@import";
public static final String DIRECTION = "@direction";
public static final String JSON = "@json";
public static final String ANY = "@any";

public enum Embed {
ALWAYS, NEVER, LAST, LINK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,23 @@ public enum Error {

INVALID_EMBED_VALUE("invalid @embed value"),

INVALID_VERSION_VALUE("invalid @version value"),

PROCESSING_MODE_CONFLICT("processing mode conflict"),

// non spec related errors
SYNTAX_ERROR("syntax error"),

NOT_IMPLEMENTED("not implemnted"),
NOT_IMPLEMENTED("not implemented"),

UNKNOWN_FORMAT("unknown format"),

INVALID_INPUT("invalid input"),

PARSE_ERROR("parse error"),

INVALID_JSON_LITERAL("invalid JSON literal"),

UNKNOWN_ERROR("unknown error");

private final String error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public JsonLdOptions copy() {
* http://www.w3.org/TR/json-ld-api/#widl-JsonLdOptions-processingMode
* jsonld 1.1: https://www.w3.org/TR/json-ld11/#dfn-processing-mode
*/
private String processingMode = JSON_LD_1_0;
private String processingMode = JSON_LD_1_1;
/**
* http://www.w3.org/TR/json-ld-api/#widl-JsonLdOptions-documentLoader
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ static boolean isKeyword(Object key) {
if (!isString(key)) {
return false;
}
// GK: Note that this set is somewhat dependent on the processing mode.
return "@base".equals(key) || "@context".equals(key) || "@container".equals(key)
|| "@default".equals(key) || "@embed".equals(key) || "@explicit".equals(key)
|| "@graph".equals(key) || "@id".equals(key) || "@index".equals(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) || "@version".equals(key)|| "@protected".equals(key)
|| "@propagate".equals(key)|| "@import".equals(key)|| "@direction".equals(key)
|| "@json".equals(key) || "@none".equals(key) || "@included".equals(key)
|| "@nest".equals(key) || "@prefix".equals(key);
}

public static Boolean deepCompare(Object v1, Object v2, Boolean listOrderMatters) {
Expand Down
29 changes: 27 additions & 2 deletions core/src/main/java/com/github/jsonldjava/core/RDFDataset.java