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 23:46:32 UTC

[GitHub] [jena] SimonBin opened a new pull request, #1679: edit not working on non root gsp-rw endpoint

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

   GitHub issue resolved #
   
   Pull request Description:
   
   I found that the "edit" tab of Fuseki-UI would not allow me to edit my dataset when there is only e.g.
   
   ```
   fuseki:endpoint [ fuseki:name "data" ; fuseki:operation fuseki:gsp-rw ; ]  ;
   ```
   
   this patch seems to fix it
   
   
   ----
   
    - [ ] 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] kinow commented on pull request #1679: edit not working on non root gsp-rw endpoint

Posted by GitBox <gi...@apache.org>.
kinow commented on PR #1679:
URL: https://github.com/apache/jena/pull/1679#issuecomment-1366581682

   Hi @SimonBin 
   
   ## This branch
   
   Here's what I did:
   
   - deleted the branch for this PR, fetched upstream again, checked out this branch (i.e. synced to make sure I'm not missing anything)
   ```
   commit 145ed896680bb9301283792866b0b59132589b3d (HEAD -> pr-1679, edit-data)
   Author: Simon Bin <sb...@informatik.uni-leipzig.de>
   Date:   Fri Dec 16 00:42:49 2022 +0100
   
       GH-1679: edit not working on non root g-sp
   ```
   
   - Started Eclipse and started `FusekiCmd`.
   - Deleted all my datasets.
   - Created a `ds` dataset TDB2 persisted to disk.
   - Using the UI, went to Edit, listed graphs, chose the default, edited the graph (on this branch) and loaded the `books.ttl` contents, then saved it.
   
   Then I stopped `FusekiCmd` in Eclipse, and opened the `ds.ttl` configuration, `/home/kinow/Development/java/jena/jena/jena-fuseki2/jena-fuseki-webapp/run/configuration/ds.ttl`.
   
   >line to remove
   
   After removing it, my service configuration is:
   
   ```turtle
   :service_tdb_all  rdf:type  fuseki:Service ;
           rdfs:label       "TDB2 ds" ;
           fuseki:dataset   :tdb_dataset_readwrite ;
           fuseki:endpoint  [ fuseki:name       "query" ;
                              fuseki:operation  fuseki:query
                            ] ;
           fuseki:endpoint  [ fuseki:operation  fuseki:update ] ;
           fuseki:endpoint  [ fuseki:name       "sparql" ;
                              fuseki:operation  fuseki:query
                            ] ;
           fuseki:endpoint  [ fuseki:name       "get" ;
                              fuseki:operation  fuseki:gsp-r
                            ] ;
           fuseki:endpoint  [ fuseki:name       "update" ;
                              fuseki:operation  fuseki:update
                            ] ;
           fuseki:endpoint  [ fuseki:operation  fuseki:query ] ;
           fuseki:endpoint  [ fuseki:name       "data" ;
                              fuseki:operation  fuseki:gsp-rw
                            ] ;
           fuseki:name      "ds" .
   ```
   
   Restarting `FusekiCmd` it prints the available services/endpoints:
   
   ```
   [2022-12-28 12:00:18] Server     INFO  Configuration file: /home/kinow/Development/java/jena/jena/jena-fuseki2/jena-fuseki-webapp/run/config.ttl
   [2022-12-28 12:00:18] Server     INFO  Path = /ds
   [2022-12-28 12:00:18] Server     INFO    Operation = query   Endpoints = [ "", "query", "sparql" ]
   [2022-12-28 12:00:18] Server     INFO    Operation = update  Endpoints = [ "", "update" ]
   [2022-12-28 12:00:18] Server     INFO    Operation = gsp-rw  Endpoints = [ "data" ]
   [2022-12-28 12:00:18] Server     INFO    Operation = gsp-r   Endpoints = [ "get" ]
   [2022-12-28 12:00:18] Server     INFO  System
   [2022-12-28 12:00:18] Server     INFO    Memory: 3.8 GiB
   [2022-12-28 12:00:18] Server     INFO    Java:   15
   [2022-12-28 12:00:18] Server     INFO    OS:     Linux 5.15.0-56-generic amd64
   [2022-12-28 12:00:18] Server     INFO    PID:    24552
   ```
   
   I think this is expected, as I have now only the "data" named endpint, `Operation = gsp-rw  Endpoints = [ "data" ]`.
   
   I re-did the same steps, listing the graphs, loading the contents, and then editing. Everything works fine.
   
   ## main branch
   
   With the `main` branch, after removing the line you suggested I get an error when I click on the graph name. So I believe I reproduced the issue :slightly_smiling_face: 
   
   I will try now to understand the fix and see if/how we can write a test for it (over next days, which should be fine as this is for after 4.7.0 - in progress).
   
   Thanks!!
   
   ![image](https://user-images.githubusercontent.com/304786/209805050-d843804d-8168-4767-84a0-a2ac27c5111e.png)
   


-- 
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 #1679: edit not working on non root gsp-rw endpoint

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

   > this patch seems to fix it
   
   Could you explain what the cause is please?
   


-- 
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] SimonBin commented on pull request #1679: edit not working on non root gsp-rw endpoint

Posted by GitBox <gi...@apache.org>.
SimonBin commented on PR #1679:
URL: https://github.com/apache/jena/pull/1679#issuecomment-1366454103

   hi @kinow thanks for trying to make this test and verify the issue!
   
   Please change the following about your assembler:
   
   **line to remove**
   
   -->
   
   ```
           fuseki:endpoint  [ fuseki:operation  fuseki:gsp-rw ] ;
   ```
   
   
   I think that should trigger the issue.
   


-- 
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] kinow commented on a diff in pull request #1679: edit not working on non root gsp-rw endpoint

Posted by "kinow (via GitHub)" <gi...@apache.org>.
kinow commented on code in PR #1679:
URL: https://github.com/apache/jena/pull/1679#discussion_r1148525692


##########
jena-fuseki2/jena-fuseki-ui/src/views/dataset/Edit.vue:
##########
@@ -277,7 +278,8 @@ export default {
       if (!this.saveGraphDisabled) {
         this.loadingGraph = true
         try {
-          await this.$fusekiService.saveGraph(this.datasetName, this.selectedGraph, this.content)
+          const dataEndpoint = this.services['gsp-rw']['srv.endpoints'].find(endpoint => endpoint !== '') || ''
+          await this.$fusekiService.saveGraph(`${this.datasetName}/${dataEndpoint}`, this.selectedGraph, this.content)
           displayNotification(this, `Graph updated for dataset "${this.datasetName}"`)

Review Comment:
   Note, the rest of the changes were added later to fix/add Cypress tests. This file is the only change to fix the issue mentioned in this pull request.



##########
jena-fuseki2/jena-fuseki-ui/src/views/dataset/Edit.vue:
##########


Review Comment:
   Note, the rest of the changes were added later to fix/add Cypress tests. This file is the only change to fix the issue mentioned in this pull request.



-- 
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] kinow commented on pull request #1679: edit not working on non root gsp-rw endpoint

Posted by "kinow (via GitHub)" <gi...@apache.org>.
kinow commented on PR #1679:
URL: https://github.com/apache/jena/pull/1679#issuecomment-1484039919

   PR rebased (thanks @SimonBin ! :wave: )


-- 
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] kinow commented on pull request #1679: edit not working on non root gsp-rw endpoint

Posted by "kinow (via GitHub)" <gi...@apache.org>.
kinow commented on PR #1679:
URL: https://github.com/apache/jena/pull/1679#issuecomment-1484192886

   If @SimonBin approves this PR, this is good to go with the next release @afs, and it will be one down, another five to go :grimacing: 


-- 
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] SimonBin commented on pull request #1679: edit not working on non root gsp-rw endpoint

Posted by "SimonBin (via GitHub)" <gi...@apache.org>.
SimonBin commented on PR #1679:
URL: https://github.com/apache/jena/pull/1679#issuecomment-1486478418

   approved from me, thanks @kinow 


-- 
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] kinow merged pull request #1679: edit not working on non root gsp-rw endpoint

Posted by "kinow (via GitHub)" <gi...@apache.org>.
kinow merged PR #1679:
URL: https://github.com/apache/jena/pull/1679


-- 
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] kinow commented on a diff in pull request #1679: edit not working on non root gsp-rw endpoint

Posted by "kinow (via GitHub)" <gi...@apache.org>.
kinow commented on code in PR #1679:
URL: https://github.com/apache/jena/pull/1679#discussion_r1148620740


##########
jena-fuseki2/jena-fuseki-ui/src/views/dataset/Edit.vue:
##########


Review Comment:
   @SimonBin I had a look at the e2e tests, and was going to write a test for this change, when I realized it would be easier to move the change to the `FusekiService` class, wrapping the logic there in case we need to further modify how these URL's are built. Also reduced a bit the complexity, and moved this logic away from the view.
   
   That way I just modified one test and got that covered :+1: 
   
   Could you please test this branch and check if it works?
   
   Thank you!



##########
jena-fuseki2/jena-fuseki-ui/src/views/dataset/Edit.vue:
##########


Review Comment:
   The rest of changes keep being for Cypress. The change for this pull request is in this file, and in `jena-fuseki2/jena-fuseki-ui/src/services/fuseki.service.js`.



##########
jena-fuseki2/jena-fuseki-ui/tests/unit/services/fuseki.service.spec.js:
##########
@@ -283,8 +283,11 @@ describe('FusekiService', () => {
     stub.resolves(Promise.resolve({
       data: 42
     }))
-    const graph = await fusekiService.fetchGraph('jena', 'default')
+    const graph = await fusekiService.fetchGraph('jena', ['dataEndpoint'], 'default')
     expect(stub.called).to.equal(true)
+    const getArgs = stub.getCall(0).args
+    // See https://github.com/apache/jena/pull/1679
+    expect(getArgs[0]).to.equal('/jena/dataEndpoint')

Review Comment:
   Changed this test to go through the branch where there is an endpoint when building the Jena Fuseki URIl



-- 
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] kinow commented on pull request #1679: edit not working on non root gsp-rw endpoint

Posted by "kinow (via GitHub)" <gi...@apache.org>.
kinow commented on PR #1679:
URL: https://github.com/apache/jena/pull/1679#issuecomment-1484035163

   Can't push to the pull request branch, 
   
   ```bash
   kinow@ranma:~/Development/java/jena/jena$ git rebase upstream/main 
   Successfully rebased and updated refs/heads/edit-data.
   kinow@ranma:~/Development/java/jena/jena$ git status
   On branch edit-data
   nothing to commit, working tree clean
   kinow@ranma:~/Development/java/jena/jena$ git push aksw edit-data 
   ERROR: Permission to AKSW/jena.git denied to kinow.
   fatal: Could not read from remote repository.
   
   Please make sure you have the correct access rights
   and the repository exists.
   ```
   
   >I will try now to understand the fix and see if/how we can write a test for it (over next days, which should be fine as this is for after 4.7.0 - in progress).
   
   Going to try to write the test and paste the diff here and tag OP asking to review/rebase/apply patch :+1: 


-- 
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] kinow commented on pull request #1679: edit not working on non root gsp-rw endpoint

Posted by GitBox <gi...@apache.org>.
kinow commented on PR #1679:
URL: https://github.com/apache/jena/pull/1679#issuecomment-1364574758

   Ran out of time to write a test for this one, but next on my list for as soon as I have some spare time. Sorry the delay!


-- 
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] kinow commented on a diff in pull request #1679: edit not working on non root gsp-rw endpoint

Posted by "kinow (via GitHub)" <gi...@apache.org>.
kinow commented on code in PR #1679:
URL: https://github.com/apache/jena/pull/1679#discussion_r1148525715


##########
jena-fuseki2/jena-fuseki-ui/src/views/dataset/Edit.vue:
##########


Review Comment:
   Note, the rest of the changes were added later to fix/add Cypress tests. ~This file is the only change to fix the issue mentioned in this pull request~ :point_down: 



-- 
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] SimonBin commented on pull request #1679: edit not working on non root gsp-rw endpoint

Posted by GitBox <gi...@apache.org>.
SimonBin commented on PR #1679:
URL: https://github.com/apache/jena/pull/1679#issuecomment-1355081828

   hi @kinow , that would be great! 
   
   @afs
   the issue is that the editor only expects such a service:
   ```
   fuseki:endpoint [ fuseki:operation fuseki:gsp-rw ; ]  ;
   ```
   
   i.e. without name


-- 
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] kinow commented on pull request #1679: edit not working on non root gsp-rw endpoint

Posted by "kinow (via GitHub)" <gi...@apache.org>.
kinow commented on PR #1679:
URL: https://github.com/apache/jena/pull/1679#issuecomment-1484056046

   Cypress tests were not running. There was one change in some URL (instead of just `/a`, now it was `a/data?sparql...`), confirmed looking at Fuseki running from Java instead of the mocked JS server, and then updated the JS mock server.
   
   Now that I can run the e2e tests will see if we need a new test, and add one if needed :+1: (later, now :beach_umbrella: :sun_with_face:)


-- 
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] kinow commented on a diff in pull request #1679: edit not working on non root gsp-rw endpoint

Posted by "kinow (via GitHub)" <gi...@apache.org>.
kinow commented on code in PR #1679:
URL: https://github.com/apache/jena/pull/1679#discussion_r1148525715


##########
jena-fuseki2/jena-fuseki-ui/src/views/dataset/Edit.vue:
##########


Review Comment:
   Note, the rest of the changes were added later to fix/add Cypress tests. This file is the only change to fix the issue mentioned in this pull request :point_down: 



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