You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2022/12/15 21:45:34 UTC

[GitHub] [jena] namedgraph opened a new pull request, #1677: GH-1676: Helper methods for registered language retrieval

namedgraph opened a new pull request, #1677:
URL: https://github.com/apache/jena/pull/1677

   GitHub issue resolved #1676
   
   New registry methods that return registered triple/quad/result set languages.
   
   ----
   
    - [ ] Tests are included.
    - [ ] Documentation change and updates are provided for the [Apache Jena website](https://github.com/apache/jena-site/)
    - [ ] Commits have been squashed to remove intermediate development commit messages.
    - [ ] Key commit messages start with the issue number (GH-xxxx or JENA-xxxx)
   
   By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the [Contributor's Agreement](https://www.apache.org/licenses/contributor-agreements.html).
   
   ----
   
   See the [Apache Jena "Contributing" guide](https://github.com/apache/jena/blob/main/CONTRIBUTING.md).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs commented on a diff in pull request #1677: GH-1676: Helper methods for registered language retrieval

Posted by GitBox <gi...@apache.org>.
afs commented on code in PR #1677:
URL: https://github.com/apache/jena/pull/1677#discussion_r1050559559


##########
jena-arq/src/main/java/org/apache/jena/riot/RDFParserRegistry.java:
##########
@@ -171,6 +172,16 @@ public static ReaderRIOTFactory getFactory(Lang language) {
     /** return true if the language is registered with the quads parser factories */
     public static boolean isQuads(Lang lang)   { return langQuads.contains(lang); }
 
+    /** Return registered triple languages. */
+    public static Set<Lang> registeredLangTriples() {
+        return Collections.unmodifiableCollection(langTriples);
+    }
+
+    /** Return registered quad languages. */
+    public static Set<Lang> registeredLangQuads() {
+        return Collections.unmodifiableCollection(langQuads);
+    }
+

Review Comment:
   `Set.copyOf`



##########
jena-arq/src/main/java/org/apache/jena/riot/RDFParserRegistry.java:
##########
@@ -171,6 +172,16 @@ public static ReaderRIOTFactory getFactory(Lang language) {
     /** return true if the language is registered with the quads parser factories */
     public static boolean isQuads(Lang lang)   { return langQuads.contains(lang); }
 
+    /** Return registered triple languages. */
+    public static Set<Lang> registeredLangTriples() {
+        return Collections.unmodifiableCollection(langTriples);
+    }

Review Comment:
   Better is `Set.copyOf(langTriples)` because it is thread safe.
   
   Bonus for changing `RDFWriterRegistry.registered*Formats` to use `copyOf`.



##########
jena-arq/src/main/java/org/apache/jena/riot/resultset/ResultSetReaderRegistry.java:
##########
@@ -77,6 +78,11 @@ public static void init() {
         register(RS_Thrift,   factory) ;
         register(RS_Protobuf, factory) ;
     }
+    
+    /** Return registered result set languages. */
+    public static Set<Lang> registered() {
+        return Collections.unmodifiableCollection(registry.keySet());

Review Comment:
   `Set.copyOf`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] rvesse merged pull request #1677: GH-1676: Helper methods for registered language retrieval

Posted by GitBox <gi...@apache.org>.
rvesse merged PR #1677:
URL: https://github.com/apache/jena/pull/1677


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] namedgraph commented on a diff in pull request #1677: GH-1676: Helper methods for registered language retrieval

Posted by GitBox <gi...@apache.org>.
namedgraph commented on code in PR #1677:
URL: https://github.com/apache/jena/pull/1677#discussion_r1050620020


##########
jena-arq/src/main/java/org/apache/jena/riot/RDFParserRegistry.java:
##########
@@ -171,6 +172,16 @@ public static ReaderRIOTFactory getFactory(Lang language) {
     /** return true if the language is registered with the quads parser factories */
     public static boolean isQuads(Lang lang)   { return langQuads.contains(lang); }
 
+    /** Return registered triple languages. */
+    public static Set<Lang> registeredLangTriples() {
+        return Collections.unmodifiableCollection(langTriples);
+    }

Review Comment:
   @afs see #1682



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs commented on a diff in pull request #1677: GH-1676: Helper methods for registered language retrieval

Posted by GitBox <gi...@apache.org>.
afs commented on code in PR #1677:
URL: https://github.com/apache/jena/pull/1677#discussion_r1050559606


##########
jena-arq/src/main/java/org/apache/jena/riot/RDFParserRegistry.java:
##########
@@ -171,6 +172,16 @@ public static ReaderRIOTFactory getFactory(Lang language) {
     /** return true if the language is registered with the quads parser factories */
     public static boolean isQuads(Lang lang)   { return langQuads.contains(lang); }
 
+    /** Return registered triple languages. */
+    public static Set<Lang> registeredLangTriples() {
+        return Collections.unmodifiableCollection(langTriples);
+    }

Review Comment:
   Better is `Set.copyOf(langTriples)` because it is isolated and thread safe.
   
   Bonus for changing `RDFWriterRegistry.registered*Formats` to use `copyOf`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org