Integrate Qlue-ls SPARQL parser into QLever UI#155
Open
hannahbast wants to merge 1 commit intomasterfrom
Open
Conversation
For now, just show the parse result in the developer console when formatting the query via a click on the "Format" button.
There was a problem hiding this comment.
Pull Request Overview
This PR integrates the ll-sparql-parser into the QLever UI to display the parse result in the developer console when the "Format" button is clicked.
- Added a new dependency ("ll-sparql-parser") in package.json.
- Updated formatter/index.js to initialize and export the parse function from the new parser.
- Exposed the parse function in head.html and invoked it from the qleverUI.js script.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package.json | Added dependency for ll-sparql-parser |
| formatter/index.js | Integrated WASM initialization code for ll-sparql-parser alongside qlue-ls; updated export functions |
| backend/templates/partials/head.html | Exposed the new parse function to the global window object |
| backend/static/js/qleverUI.js | Invoked the parse function on query formatting |
Comments suppressed due to low confidence (2)
formatter/index.js:2
- [nitpick] Consider renaming 'init1' to a more descriptive identifier (e.g., 'initQlue') to improve code clarity.
import init1, { format_raw, determine_operation_type } from 'qlue-ls';
formatter/index.js:20
- [nitpick] Consider renaming 'init2' to a more descriptive identifier (e.g., 'initSparqlParser') to clearly distinguish it from other module initializations.
import init2, { get_parse_tree } from 'll-sparql-parser';
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For now, just show the parse result in the developer console when formatting the query via a click on the "Format" button.