XUL Talk:Templates Plan: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 22: Line 22:
A big shortcoming of rdf templates now is that they seem to load data sources synchronously (Neil pointed out to me that this is just an impression - they actually load asynchronously but so fast that they block the browser anyway). A large file certainly blocks the browser. They seem to load the datasource as part of template parsing which doesn't allow a page to register as a builder listener and so catch when the first build of an element completes. As part of version 2, I think loading shouldn't block the browser (some timer stuff or what?) and there should be an event like "datasourceLoaded" to mark its end.
A big shortcoming of rdf templates now is that they seem to load data sources synchronously (Neil pointed out to me that this is just an impression - they actually load asynchronously but so fast that they block the browser anyway). A large file certainly blocks the browser. They seem to load the datasource as part of template parsing which doesn't allow a page to register as a builder listener and so catch when the first build of an element completes. As part of version 2, I think loading shouldn't block the browser (some timer stuff or what?) and there should be an event like "datasourceLoaded" to mark its end.


==== Problems with RDF query ====
==== Problems/bugs current template mechanism ====
* can't extract a literal predicate's value directly from a scoped resource (must use blank nodes)
===== literal display =====
the current template mechanism doesn't display a literal predicate's value if  you are quering a particular resource (you must embed literals in blank nodes). [http://www.w3.org/TR/2005/WD-rdf-sparql-query-20050419 SPARQL] for one let's you grab such a literal. For example,
              SELECT ?name WHERE { :people/p1 foaf:name ?name }
gets the name (literal) of a particular resource (the person ":people/p1"). If the problem in the current system is in the builder then it needs to be fixed.

Revision as of 03:54, 6 May 2005

Comments User:Conor325

Enhanced builder to support Fresnel and other Query Processors

Fresnel is SIMILE's RDF query mechanism. It builds on SPARQL or XPath and provides query modularization. To allow for a fully functional Fresnel Query Processor, the builder and result interfaces would have to be enhanced.

Fresnel supports "get-all" where you can get the values of all of the predicates of an object or all but a particular group. I imagine that most query mechanisms have this facility. Problem is that the XUL Builder doesn't support this. It needs explicit names for all the predicate values it receives. It can't just walk a result object using value="?*" or some such wildcard. I know this one could be troublesome because it breaks the notion that variables are bound in the query and used in the builder.

Fresnel supports label attachment for values so for example, if you get a value for the predicate "http:.../wife" of say "Mary", you can also attach the label "Wife" to Mary for the builder to use. By default that label can come from OWL. The result object (http://wiki.mozilla.org/XULTemplatesAPI#Result_Objects) passed from Query processor to Builder doesn't have a slot for "label". Unless it's added you would loose one of the nicest features of a Fresnel processor.

Scope: must a Query Processor sort or ensure uniqueness?

A Query Processor may sort or it may not. It may ensure that there are no duplicates in its results or it may not. Or is it allowed to be this flexible?

RDF-Independent Query Processor to Builder interface

The Template result interface (http://wiki.mozilla.org/XULTemplatesAPI#Result_Objects) should not mention "resources" or other RDF specifics. If a dataSource can be SQL or plain XML then it must be RDF-independent.

Builder: takes a sort function

You will never be able to build in support for all the sort criteria people have. Can sort be enhanced to take a sort function, say a simple comparison function that would tell you if one row were less than another. This way, a developer can insert custom sorting for elements.

RDF caching and refresh

Neil pointed out that RDF refresh was implemented last year and it can be called from remote code. However, RDF caching is still an issue. Refresh and caching is a general issue for all "file based" data sources i.e. where they is a load at startup and subsequent queries run off a local cache.

RDF templates and RDF loading

A big shortcoming of rdf templates now is that they seem to load data sources synchronously (Neil pointed out to me that this is just an impression - they actually load asynchronously but so fast that they block the browser anyway). A large file certainly blocks the browser. They seem to load the datasource as part of template parsing which doesn't allow a page to register as a builder listener and so catch when the first build of an element completes. As part of version 2, I think loading shouldn't block the browser (some timer stuff or what?) and there should be an event like "datasourceLoaded" to mark its end.

Problems/bugs current template mechanism

literal display

the current template mechanism doesn't display a literal predicate's value if you are quering a particular resource (you must embed literals in blank nodes). SPARQL for one let's you grab such a literal. For example,

              SELECT ?name WHERE { :people/p1 foaf:name ?name } 

gets the name (literal) of a particular resource (the person ":people/p1"). If the problem in the current system is in the builder then it needs to be fixed.