You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by ki...@apache.org on 2022/02/19 19:17:08 UTC
[jena] branch main updated: JENA-2283: add back the SPARQL endpoint input field in the query page
This is an automated email from the ASF dual-hosted git repository.
kinow 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 2355cf8 JENA-2283: add back the SPARQL endpoint input field in the query page
2355cf8 is described below
commit 2355cf807d052401906b9380c3c8cff861bbc315
Author: Bruno P. Kinoshita <ki...@apache.org>
AuthorDate: Sat Feb 19 11:52:42 2022 +1300
JENA-2283: add back the SPARQL endpoint input field in the query page
---
.../jena-fuseki-ui/src/views/dataset/Query.vue | 35 ++++++++++++++++------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Query.vue b/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Query.vue
index 637ff95..8f3a779 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Query.vue
+++ b/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Query.vue
@@ -59,7 +59,18 @@
</b-col>
</b-row>
<b-row>
- <b-col sm="12" md="6">
+ <b-col sm="12" md="4">
+ <b-form-group
+ label="SPARQL Endpoint"
+ label-cols="6"
+ >
+ <b-form-input
+ :value="`${datasetName}/sparql`"
+ v-model="datasetUrl"
+ ></b-form-input>
+ </b-form-group>
+ </b-col>
+ <b-col sm="12" md="4">
<b-form-group
label="Content Type (SELECT)"
label-cols="6"
@@ -67,11 +78,10 @@
<b-form-select
:options="contentTypeSelectOptions"
v-model="contentTypeSelect"
- @change="onYasqeOptionsChange"
></b-form-select>
</b-form-group>
</b-col>
- <b-col sm="12" md="6">
+ <b-col sm="12" md="4">
<b-form-group
label="Content Type (GRAPH)"
label-cols="6"
@@ -79,7 +89,6 @@
<b-form-select
:options="contentTypeGraphOptions"
v-model="contentTypeGraph"
- @change="onYasqeOptionsChange"
></b-form-select>
</b-form-group>
</b-col>
@@ -146,6 +155,7 @@ export default {
loading: true,
yasqe: null,
yasr: null,
+ datasetUrl: `/${this.datasetName}/sparql`,
contentTypeSelect: 'application/sparql-results+json',
contentTypeSelectOptions: [
{ value: 'application/sparql-results+json', text: 'JSON' },
@@ -209,22 +219,29 @@ export default {
vm.yasqe.saveQuery()
vm.yasr.setResponse(response, duration)
})
- this.onYasqeOptionsChange()
this.syncYasqePrefixes()
this.loading = false
}, 300)
})
},
+ watch: {
+ datasetUrl: function (val, oldVal) {
+ this.yasqe.options.requestConfig.endpoint = this.$fusekiService.getFusekiUrl(this.datasetUrl)
+ },
+ contentTypeSelect: function (val, oldVal) {
+ this.yasqe.options.requestConfig.acceptHeaderSelect = this.contentTypeSelect
+ },
+ contentTypeGraph: function (val, oldVal) {
+ this.yasqe.options.requestConfig.acceptHeaderGraph = this.contentTypeGraph
+ }
+ },
+
beforeRouteLeave (to, from, next) {
next()
},
methods: {
- onYasqeOptionsChange () {
- this.yasqe.options.requestConfig.acceptHeaderSelect = this.contentTypeSelect
- this.yasqe.options.requestConfig.acceptHeaderGraph = this.contentTypeGraph
- },
setQuery (query) {
this.yasqe.setValue(query)
this.syncYasqePrefixes()