This is an automated email from the ASF dual-hosted git repository.

afs pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git


The following commit(s) were added to refs/heads/main by this push:
     new 8dd6c3cda1 GH-3647: Allow 'uploading all' when loading into the 
default graph through fuseki
8dd6c3cda1 is described below

commit 8dd6c3cda118ecfaf9369e441cf259cedb5160f8
Author: Thomas Thelen <[email protected]>
AuthorDate: Tue Jul 28 14:36:08 2026 -0700

    GH-3647: Allow 'uploading all' when loading into the default graph through 
fuseki
---
 .../jena-fuseki-ui/src/views/dataset/Upload.vue    | 10 +++++-
 .../jena-fuseki-ui/tests/e2e/specs/upload.cy.js    | 38 ++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Upload.vue 
b/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Upload.vue
index 052b348661..1edde4e01e 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Upload.vue
+++ b/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Upload.vue
@@ -419,10 +419,18 @@ export default {
       }
     },
     validateForm () {
-      return this.validateGraphName() && this.validateFiles()
+      // Both are evaluated, so that the user sees every invalid field at once.
+      const isValidGraphName = this.validateGraphName()
+      const isValidFiles = this.validateFiles()
+      return isValidGraphName && isValidFiles
     },
     validateGraphName () {
       const graphName = this.$refs['dataset-graph-name'].value
+      // A blank graph name means the data is loaded into the the default 
graph.
+      if (!graphName || graphName.trim() === '') {
+        this.graphNameClasses = ['form-control']
+        return true
+      }
       const isValidGraphName = validateGraphName(graphName)
       const formValidationClass = isValidGraphName ? 'is-valid' : 'is-invalid'
       this.graphNameClasses = ['form-control', formValidationClass]
diff --git a/jena-fuseki2/jena-fuseki-ui/tests/e2e/specs/upload.cy.js 
b/jena-fuseki2/jena-fuseki-ui/tests/e2e/specs/upload.cy.js
index eeafec66c5..c8f13b50dc 100644
--- a/jena-fuseki2/jena-fuseki-ui/tests/e2e/specs/upload.cy.js
+++ b/jena-fuseki2/jena-fuseki-ui/tests/e2e/specs/upload.cy.js
@@ -84,6 +84,44 @@ describe('upload', function () {
           .should('have.attr', 'aria-valuenow', 0)
       })
   })
+  it('accepts a blank graph name, and uploads to the dataset', function () {
+    cy.intercept('POST', '/skosmos/data', { statusCode: 200 }).as('upload')
+    cy
+      .get('input[type=file]')
+      .selectFile({
+          contents: Cypress.Buffer.from('@prefix ex: <http://example.org/> .\n 
 ex:ABC a ex:DEF .'),
+          fileName: 'blank-graph.ttl',
+          lastModified: Date.now()
+        },
+        {
+          force: true
+        })
+    // Typing and then clearing the graph name must not leave the field in an 
error state.
+    cy
+      .get('#dataset-graph-name')
+      .type('https://example.org/graph')
+      .clear()
+      .should('not.have.class', 'is-invalid')
+    cy
+      .get('button.upload-files')
+      .click({ force: true })
+    cy
+      .wait('@upload')
+      .its('request.url')
+      .should('not.contain', 'graph=')
+    cy
+      .get('.progress')
+      .eq(0)
+      .find('.progress-bar')
+      .eq(0)
+      .should('have.text', '1/1')
+  })
+  it('rejects an invalid graph name', function () {
+    cy
+      .get('#dataset-graph-name')
+      .type('not a uri')
+      .should('have.class', 'is-invalid')
+  })
   it('displays the progress for success and failure', function () {
     // Intercept upload calls.
     // Fails every other upload.

Reply via email to