Skip to content

Integrate Qlue-ls SPARQL parser into QLever UI#155

Open
hannahbast wants to merge 1 commit intomasterfrom
add-qlue-ls-parser
Open

Integrate Qlue-ls SPARQL parser into QLever UI#155
hannahbast wants to merge 1 commit intomasterfrom
add-qlue-ls-parser

Conversation

@hannahbast
Copy link
Contributor

For now, just show the parse result in the developer console when formatting the query via a click on the "Format" button.

For now, just show the parse result in the developer console when
formatting the query via a click on the "Format" button.
@hannahbast hannahbast requested a review from Copilot May 23, 2025 03:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant