-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
T18011 JenaUtils.read support jsonld #214
T18011 JenaUtils.read support jsonld #214
Conversation
34f61f5
to
cd0509f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no deprecation?
if("jsonld".equals(extension)) { | ||
// .jsonld is extension for application/ld+json | ||
return "JSONLD"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we put this in a map?
cd0509f
to
cbb8466
Compare
|
||
// any other extension falls back to RDF XML | ||
return null; | ||
return extensionToLanguageCode.getOrDefault(extension, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just get is ok, if key is not present, null is returned - add a comment that fallback (and null) is RDF/XML
private static Map<String, String> getExtensionToLanguageMap() { | ||
Map<String, String> result = new HashMap<>(); | ||
|
||
result.put("nt", "N-TRIPLE"); | ||
result.put("n3", "N3"); | ||
result.put("ttl", "TURTLE"); | ||
result.put("jsonld", "JSONLD"); | ||
|
||
return result; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final Map<> in class and init in static initializer (make map synchronized)
result.put("jsonld", "JSONLD"); | ||
|
||
return result; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing empty line after method
cbb8466
to
caf082c
Compare
caf082c
to
d12796c
Compare
// any other extension falls back to RDF XML | ||
return null; | ||
// when return value is null, fall back to RDF/XML | ||
return extensionToLanguageMap.getOrDefault(extension, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's ok to do this as here the default return value is null
extensionToLanguageMap.get(extension)
See issue #215