This repository was archived by the owner on Jan 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
A plugin system #20
Copy link
Copy link
Open
Description
This might be premature, but here are some ideas.
The goal of a plugin system would be to do vocabulary-specific stuff in the generated HTML pages. For example, if a page has geo:lat and geo:long properties, a map could be shown. Or if a page is a void:Dataset with a void:sparqlEndpoint property, then a query form could be shown.
A plugin could consist of:
- An
ASKSPARQL query to be run against the fetched resource description. If the query matches, then the plugin will be active on the page. - One or more additional SPARQL queries that the plugin asks to run. The plugin can choose whether they are run against the fetched resource description (fast) or against the original data source (i.e. endpoint). The queries can include the
?__this__variable to refer to the current resource. Results are included as JSON in a<script>block in the generated page. - One or more Javascript files to be included via
<script>tags. Plugin scripts to be added at the end of the<script>sections of the core Pubby page; order of the resulting<script>tags needs to be maintained. - Zero or more CSS files that are included via
<link rel="style">tags. - A specific Javascript function that is called on page load, and that will modify the page's DOM structure, perhaps using the provided JSON objects.
This would mean no Java code in the plugin, making them much easier to deploy and share. The whole thing could be bundled as a .zip or .jar, with a Turtle file as manifest that describes the whole thing, and dropped somewhere in WEB-INF. At startup, Pubby could check that directory for plugins.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels