Skip to content

Conversation

jjkoehorst
Copy link
Collaborator

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...

jjkoehorst and others added 3 commits August 15, 2025 17:32
- 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]>
Copy link
Member

@stuzart stuzart left a 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
@jjkoehorst
Copy link
Collaborator Author

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

      format.rdf { render template: 'rdf/show' }
      format.ttl { render template: 'rdf/show' }

in institution.rb
include Seek::Rdf::RdfGeneration

and the jerm_vocab

Institution => 'https://schema.org/Organization',

which should enable RDF for institutions. shall I push it to this branch as well?

jjkoehorst and others added 23 commits August 30, 2025 08:48
…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.
… support checking it is restricting the graph being queried
…. 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
@stuzart stuzart requested a review from Copilot September 24, 2025 16:17
Copy link
Contributor

@Copilot 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 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.

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.

2 participants