Markc:RDF Inspector

From MozillaWiki
Jump to: navigation, search

Introduction

When progressing through XUL development the introduction of RDF and templates can be a tricky aspect to understand. This is made especially difficult because the templates tend to either work or not - there's no middle ground, and little clue as to what the problem could be.

A means to view the RDF datasources in Firefox would help. Additional functionality to allow them to be "navigated" or modified would be even more beneficial.

Proposal

I am proposing the creation of an "RDF Inspector". This would perform a similar task for Firefox's internal datasource content as the DOM Inspector does for its internal DOM content.

The interface should easily allow the novice developer to confirm that their RDF has (or hasn't) been loaded. It is likely that the first generation of such a tool would show the RDF as a tree structure for simplicity.

It should be possible to enter the "ref" from a template as well as a template rule and clearly see what nodes match. This highlighting should be "live" so that the developer can change the ref or rule to see how it affects the selection.

A later development could render the RDF nodes graphically, perhaps using SVG, to make the relationship between nodes clearer to visualise.


Although there are third party tools which will render an RDF/XML file as a graph of nodes, they do not integrate with Firefox to show the data as it is loaded. They also can't deal with datasources that are created or modified via script. Finally they have no concept of Mozilla's template facilities, so don't have a means to easily identify which nodes will match a template rule.

Use Case

John is a novice developer with some background in HTML. Initially he finds XUL relatively straightforward, until he hits the tutorials about RDF. He thinks he understands what's going on, but finds himself frustrated when his efforts to create an RDF file and a XUL template yield no output. He should be able to launch the RDF Inspector to verify that his RDF has been loaded as expected; he can then copy and paste his ref and rule to identify why no matches have occured.

James is in a similar situation, but his RDF is being generated on the server via a PHP script which is querying a database. In this case there is a lot of content in the RDF/XML file which makes it hard to see the relationships between the nodes when viewing the file directly. A graph of the RDF would make things much clearer for him, but presently he has to install a third-party application for this, and does not know where to find one, or which is a good one to use.