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 2021/09/30 15:41:52 UTC

[GitHub] [jena] jmkeil opened a new pull request #1080: JENA-2169: Dataset interface should support blank node labels for graphs

jmkeil opened a new pull request #1080:
URL: https://github.com/apache/jena/pull/1080


   Draft for blank node name support, but not tested yet, as I did not manage to find the tests for `DatasetImpl` to add some.
   
   As I didn't wanted to go the way over a IRI String in `DatasetImpl::listModelNames`, I decided to directly use the `ResourceImpl(Node, ModelCom)` constructor with second parameter `null`. In the end, that should have the same result as `ResourceImpl(String)`. But I was not sure, if it would make sense to add the default graph (or the named graph) as second parameter.


-- 
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 change in pull request #1080: JENA-2169: Dataset interface should support blank node labels for graphs

Posted by GitBox <gi...@apache.org>.
afs commented on a change in pull request #1080:
URL: https://github.com/apache/jena/pull/1080#discussion_r720711537



##########
File path: jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetImpl.java
##########
@@ -213,11 +248,30 @@ public boolean containsNamedModel(String uri) {
         return dsg.containsGraph(n) ;
     }
 
+    @Override
+    public boolean containsNamedModel(Resource uri) {
+        // Does not touch the cache.
+        checkGraphName(uri) ;
+        return dsg.containsGraph(uri.asNode()) ;
+    }
+
     @Override
     public Iterator<String> listNames() {

Review comment:
       NodeUtils.nodesToURIs does not meet its contract to skip non-URIs.
   
   Here is an impl that does.
   ```
       public static Iterator<String> nodesToURIs(Iterator<Node> iter) {
           ExtendedIterator<Node> eIter = WrappedIterator.create(iter) ;
           Iterator<String> conv = eIter.filterKeep(Node::isURI).mapWith(Node::getURI);
           return conv ;
       }
   ```

##########
File path: jena-arq/src/main/java/org/apache/jena/query/Dataset.java
##########
@@ -51,9 +52,15 @@
     /** Get a graph by name as a Jena Model */
     public Model getNamedModel(String uri) ;
 
+    /** Get a graph by name as a Jena Model */
+    public Model getNamedModel(Resource uri) ;
+
     /** Does the dataset contain a model with the name supplied? */
     public boolean containsNamedModel(String uri) ;
 
+    /** Does the dataset contain a model with the name supplied? */

Review comment:
       s/name/resource/

##########
File path: jena-arq/src/main/java/org/apache/jena/query/Dataset.java
##########
@@ -51,9 +52,15 @@
     /** Get a graph by name as a Jena Model */
     public Model getNamedModel(String uri) ;
 
+    /** Get a graph by name as a Jena Model */

Review comment:
       s/by name/by resource/




-- 
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 pull request #1080: JENA-2169: Dataset interface should support blank node labels for graphs

Posted by GitBox <gi...@apache.org>.
afs commented on pull request #1080:
URL: https://github.com/apache/jena/pull/1080#issuecomment-943106355


   This PR is included in the follow-up PR #1086.


-- 
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 closed pull request #1080: JENA-2169: Dataset interface should support blank node labels for graphs

Posted by GitBox <gi...@apache.org>.
afs closed pull request #1080:
URL: https://github.com/apache/jena/pull/1080


   


-- 
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] jmkeil commented on pull request #1080: JENA-2169: Dataset interface should support blank node labels for graphs

Posted by GitBox <gi...@apache.org>.
jmkeil commented on pull request #1080:
URL: https://github.com/apache/jena/pull/1080#issuecomment-931445665


   Having the default graph as referenced `Model` in the returned `Resource`s would allow to add statements about the named graphs using the Resources methods, which feels right. But I don't have an overview about possible side effects, e.g. in case if there is no statement about the resource in the default graph yet.


-- 
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