@logilab/sparqlexplorer
v0.8.1
Published
A tool to explore sparql endpoints
Readme
SparqlExplorer
SparqlExplorer is a web application you can use to explore the content of any SPARQL endpoint without writing SPARQL queries.
The stable version is available at sparqlexplorer.app. The CI deploys there the latest version with a tag.
The unstable version (public head of this repository) is automatically deployed on open-source.pages.logilab.fr/SemWeb/sparqlexplorer/ by the CI.
Interface walkthrough
In this example we use data from data.culture hosted at data.idref.fr/sparql.
The first step is to enter the sparql endpoint:
When clicking on "explore" SparqlExplorer will display a list of all the classes available on the SPARQL endpoint with their number of instances. This list can be filtered thanks to the filter bar.
If we click on a Class, we obtain the triples in which the URL is the subject or the object. This tabular view is the default view. Every URL is clickable and you can navigate from URL to URL keeping the same view.
Using custom views
While the default view will work on any vocabulary it may not be the most user friendly. Sparql explorer comes with a set of custom views for specific vocabularies such as SKOS, FOAF and others.
When viewing a URL description, the left burger menu lists the available views. The current view is highlighted in blue and views not applicable to the current URI description are faded out.
An automatic mode is available (check the "Automatic" checkbox) to select an applicable custom view automatically. Each custom view will send a SPARQL query to check if it is compatible with the current URI. The selected view will be displayed in the burger menu.
If no view is suited for the URL description, a pop up will appear and the view will fallback to default.
Running SparqlExplorer locally
To run Sparql Explorer, clone with Mercurial and install the npm project.
# Clone the repository (Mercurial)
hg clone https://forge.extranet.logilab.fr/open-source/SemWeb/sparqlexplorer
# Install dependencies
npm installDevelopment
npm run dev # Starts Vite dev server (http://localhost:3000)Production build (root deployment)
npm run build # Builds the app for production at ./buildProduction build for GitLab/GitHub Pages (sub‑path /SemWeb/sparqlexplorer)
npm run build:pages # Uses BASE_PATH to generate correct URLsLibrary build (UMD bundle)
npm run build:lib # Generates `static/js/lib.js` (UMD) in ./buildMiscellaneous
npm run clean # Remove the build directory
npm run format # Format code (Biom)
npm run lint # Lint code (Biom)| Script | Description |
|--------|-------------|
| npm run dev | Starts Vite development server (http://localhost:3000). |
| npm run build | Production build for root deployment. |
| npm run build:pages | Production build for sub‑path /SemWeb/sparqlexplorer. |
| npm run build:lib | Build the UMD library (static/js/lib.js). |
| npm run clean | Remove build/ directory. |
| npm run format | Format code with Biome. |
| npm run lint | Lint code with Biome. |
| npm run check | Run Biome checks. |
To edit custom views, please refer to the readme in the generic-views repo.
Deployment
Test the unstable version then increment version number and publish a tag to have it deployed at sparqlexplorer.app.
Contributing
SparqlExplorer is licensed under AGPLv3, all contributions are welcome!
As the project is on the Logilab code hosting platform, you will need an account to create pull requests and open issues.
Please reach us on our public matrix channel or via email at [email protected] if you want to contribute.
