Package Exports
- @sib-swiss/sparql-editor
- @sib-swiss/sparql-editor/dist/sparql-editor.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@sib-swiss/sparql-editor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
A standard web component to easily deploy a SPARQL query editor for a specific SPARQL endpoint using the popular YASGUI editor.
- Prefixes are automatically pulled from the endpoint using their definition defined with the SHACL ontology (
sh:prefix
/sh:namespace
). - Example SPARQL queries defined using the SHACL ontology are automatically pulled from the endpoint (queries are defined with
sh:select|sh:ask|sh:construct|sh:describe
, and their human readable description withrdfs:label|rdfs:comment
). Checkout thesparql-examples
project for more details. - Autocomplete possibilities for properties and classes are automatically pulled from the endpoint based on VoID description present in the triplestore (
void:linkPredicate|void:property
andvoid:class
). Checkout thevoid-generator
project to automatically generate VoID description for your endpoint.
🚀 Use
Import from CDN
<script type="module" src="https://unpkg.com/@sib-swiss/sparql-editor"></script>
Or install with a package manager in your project:
npm install --save @sib-swiss/sparql-editor # or pnpm add @sib-swiss/sparql-editor
Use the custom element in your HTML/JSX/TSX code:
<sparql-editor endpoint="https://sparql.uniprot.org/sparql/"></sparql-editor>
You can customize the number of examples displayed on the main page and buttons color:
<sparql-editor endpoint="https://www.bgee.org/sparql/" examples-on-main-page="10" style="--btn-color: white; --btn-bg-color: #00709b;" ></sparql-editor>
🛠️ Development
Requirement: NodeJS installed.
Clone the repository obviously, and get into the repository root folder.
Install:
npm install
Run in development:
npm run dev
Auto format code with prettier:
npm run fmt
Lint with eslint (we recommend to install the ESLint
extension on VSCode):
npm run lint
Build for production in the dist
folder:
npm run build
Update dependencies to the latest available versions:
npx npm-check-updates -u
🏷️ Release
To create a new release:
Login with
npm adduser
if not already doneUpgrade version in
package.json
Run release script:
npm run release
Create release on GitHub
🤝 Credits
Thanks to: