-
Notifications
You must be signed in to change notification settings - Fork 44
A plugin system #20
Comments
Plugin API would definitely be a step forward. Also the split
Here are some remarks regarding the Plugin API:
This is also "compliant" with the last point above (A specific JavaScript function ... on page load), as the whole rendering stuff is given to the plugin at the same time as to the core pubby web page. Nevertheless, speaking about the GEO extension you reference, this functionality is NOT needed. However, these remarks might be applicable to other plugins. Are there any such plugins with these demands ?
|
@psiotwo: Regarding your point about deciding whether a plugin activates: I think this decision needs to be made without asking additional queries to the endpoint. Otherwise, if we install a bunch of plugins, each one will increase the number of queries that are run on every single page, even if the page is about something that is entirely unrelated to the plugin's function. So the activation decision has to be made on something simple that we already know, like the presence of a certain class or property in the resource description. Based on this, a plugin may decide to be activated, so its additional SPARQL queries will be run, and then the plugin JS code may find out that these queries didn't match any interesting data, and therefore the plugin JS code will decide not to render anything on the page. So even if a plugin is activated, it may decide not to generate visible output. I've added a comment to the notes above on the placement and ordering of script tags. |
On the question of deploying plugins and bundling their resources, in version 1 of the plugin system, a plugin could simply be a directory that is copied to a location like |
I have started work on a |
@pietercolpaert: It could certainly be relevant. I find it difficult to work out what exactly |
It's a javascript library that runs in the browser which injects HTML in particular Very early demo: The idea behind writing it this way is that everyone can write their own plugin which generates HTML from an array of triples - https://github.com/tdt/rdf2html/tree/master/plugins |
So, the plugin decides which triples (if any) it wants to render, and how to render them; and the HTML skeleton basically just marks the spot where the generated HTML should be injected? So, the |
Correct! |
I see, @pietercolpaert. So yeah, |
@cygri, are there any news regarding the plugin system ? I tried to find its "version 1" mentioned above in the sources, but without success. |
We have been working on RDF2HTML which is now in use in The DataTank. Cfr. http://demo.thedatatank.com/wikipedia/nmbs/stations?&offset=2000&limit=500 The plug-ins should now be extended: https://github.com/tdt/rdf2html/tree/master/plugins @cygri are there plans to release a new version of pubby soon with this functionality? Is someone working on that or should it be set up? |
@psiotwo, the “version 1” mentioned was hypothetical—if someone were to develop a version 1 of the plugin system, it could be done in such-and-such a way. |
Ah, I see :-) Thx for explanation. Petr |
@pietercolpaert No one is actively working on a plug-in system, although @psiotwo seems interested. I expect to be able to spend some cycles on Pubby in June and July, so there might be a new release in that timeframe. I don't expect to get around to working on this particular issue. |
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
andgeo:long
properties, a map could be shown. Or if a page is avoid:Dataset
with avoid:sparqlEndpoint
property, then a query form could be shown.A plugin could consist of:
ASK
SPARQL query to be run against the fetched resource description. If the query matches, then the plugin will be active on the page.?__this__
variable to refer to the current resource. Results are included as JSON in a<script>
block in the generated page.<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.<link rel="style">
tags.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 inWEB-INF
. At startup, Pubby could check that directory for plugins.The text was updated successfully, but these errors were encountered: