Skip to content
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

Conversation

michielrogissart-cognizone
Copy link
Contributor

@michielrogissart-cognizone michielrogissart-cognizone commented Sep 6, 2023

See issue #215

Copy link
Collaborator

@natan-cox-cognizone natan-cox-cognizone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no deprecation?

Comment on lines 257 to 260
if("jsonld".equals(extension)) {
// .jsonld is extension for application/ld+json
return "JSONLD";
}
Copy link
Contributor

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?


// any other extension falls back to RDF XML
return null;
return extensionToLanguageCode.getOrDefault(extension, null);
Copy link
Contributor

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

Comment on lines 245 to 254
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;
}
Copy link
Contributor

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;
}
Copy link
Contributor

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

@michielrogissart-cognizone michielrogissart-cognizone force-pushed the feat/T18011/jenautils-read-support-jsonld branch from cbb8466 to caf082c Compare September 8, 2023 06:10
// 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);
Copy link
Contributor

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)

@michielrogissart-cognizone michielrogissart-cognizone merged commit e7d9307 into develop Sep 8, 2023
2 checks passed
@michielrogissart-cognizone michielrogissart-cognizone deleted the feat/T18011/jenautils-read-support-jsonld branch September 8, 2023 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants