You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parsing breaks on JSON-LD 1.1 @version keyword. #263
The graphToRdf function in RDFDataset.java checks whether any of the keys in the JSON document are reserved JSON-LD keywords. As JsonLdUtils.isKeyword() doesn't know of @version (introduced in 1.1), it then tries to interpret its value, which fails.
Solution: add || "@version".equals(key) to the isKeyword function in JsonLdUtils.java:
/**
* Returns whether or not the given value is a keyword (or a keyword alias).
*
* @param v
* the value to check.
* @param [ctx]
* the active context to check against.
*
* @return true if the value is a keyword, false if not.
*/
static boolean isKeyword(Object key) {
if (!isString(key)) {
return false;
}
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) || "@version".equals(key);
}
Is the error that comes up with this issue the com.github.jsonldjava.core.JsonLdError: invalid term definition: 1.1? I am running into this problem when the @Version is in the context.
Activity
ChandlerTodd commentedon Jan 14, 2020
Is the error that comes up with this issue the
com.github.jsonldjava.core.JsonLdError: invalid term definition: 1.1? I am running into this problem when the @Version is in the context.antohaby commentedon Apr 15, 2020
As a workaround, it is possible to substitute a document via
DocumentLoader.