-
Notifications
You must be signed in to change notification settings - Fork 55
Sparql interface #2303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Sparql interface #2303
Conversation
- Add SPARQL controller with public endpoint support (no authentication) - Create responsive web interface with query textarea and result display - Implement horizontal scrolling tables for wide result sets - Add example query library with dropdown selection - Enable click-to-DESCRIBE functionality for URIs in results - Include auto-resizing textarea and smooth UX interactions - Add conditional menu visibility based on endpoint configuration - Support multiple output formats (table, JSON, XML) - Integrate with existing RDF repository configuration system 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some refactoring needed, and tests.
Bit confused about the help_documents/index.html, which looks like a cleaner and updated version of what is in sparql/index.html but in the wrong place ??
Occurred to me whilst reviewing, that shoudl probably avoid using virtuoso specifically, as there is the ability implement other subclasses of RdfRepository to support other triple stores
- Remove non-functional validate button and associated JavaScript code as it was only testing bare minimum (should find a js library) - Move inline styles to stylesheet on suggestions from stuart - Improve SPARQL controller error handling and query execution, for example ASK did not return a list - Add SPARQL link to navbar when RDF repository is configured, moved the button to the main menu bar if thats ok? - Make output format dropdown more compact as it was ridiculously wide - Clean up form styling and button positioning
Some new changes based on feedback from @stuzart , working on "tests". I also have another change in the pipeline that has to do with RDF. basically for institutions there is no RDF yet institutions_controller.rb
in institution.rb and the jerm_vocab
which should enable RDF for institutions. shall I push it to this branch as well? |
…red due to blank. What happens now is if you run a sparql query and click on any of the URLS's it will execute a DESCRIBE such as `DESCRIBE <http://localhost:3000/projects/1>` Why? This allows users to more easily browse through the graph. TODO, a graphical map to be added once the "test data" has been added and is covering all RDF aspects.
… not needed so removed and cleaned up.
…ch i am aiming for ...
… support checking it is restricting the graph being queried
…ery (currently you can)
…. This way users might be more able to understand the schema structure. The image can / should obviously replaced in the future when the schema changes.
… the most suitable when there is a query error
…ML and JSON responses if a query. Ultimately, will be much cleaner if split into 2 actions
…st for when using accept headers
There was a problem hiding this 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 introduces a SPARQL query interface for SEEK to provide a user-friendly web interface for querying the RDF knowledge graph. The interface replaces the default Virtuoso SPARQL interface with a custom Rails-based solution that supports multiple output formats and includes example queries.
- Adds a complete SPARQL controller with query execution and error handling
- Implements responsive web interface with example queries and filtering
- Includes comprehensive test coverage for both functional and integration scenarios
Reviewed Changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
app/controllers/sparql_controller.rb | Main controller handling SPARQL query execution and responses |
app/views/sparql/*.html.erb | View templates for the SPARQL interface and results display |
app/assets/stylesheets/sparql.scss | Styling for the SPARQL interface components |
app/assets/javascripts/sparql.js | Client-side functionality for query interaction and filtering |
test/integration/sparql_controller_test.rb | Integration tests for SPARQL functionality |
test/functional/sparql_controller_test.rb | Functional tests for controller behavior |
lib/seek/rdf/rdf_repository.rb | Added availability check method for RDF repository |
config/sparql_queries.yml | Example SPARQL queries configuration |
config/routes.rb | Added SPARQL routes |
app/views/layouts/navbar/_navbar.html.erb | Added SPARQL link to navigation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This is a mock-up example mostly helped with Claude as it is something I think is important for SEEK but found it easier to explain by showing what I mean with it I am in no means a seek / ruby backend expert so don't blindly accept this commit ;).
It's "just" another button that brings you to the SEEK sparql endpoint interface that connects with the virtuoso public endpoint (if I did it correctly) as the virtuoso sparql interface is simply horrible.
There are some dummy example queries ( I am now working on the population script to see what ends up in the endpoint but have not got that part working yet....)
It would be great if the query field has some SPARQL syntax knowledge. it currently supports table, json and xml output formats.
Also the links point directly to where they are pointing to. It would be nice if on click it could fire a describe query and a special click (maybe link button) brings them to the link destination. This way people can more easily "browse" the endpoint.
Once populated it would also need a endpoint map UML like to show the structure but that's for later...