[an error occurred while processing this directive] SPARQL List Formatting XSLT [an error occurred while processing this directive]

List XSLT for SPARQL

Using list.xslt, you can transform query results into a list. The first query variable is the list key. This must list the individuals you want to display in the order you want them. The first occurance of an individual is the only one displayed. The rest of the variables are organized as a nested list under each individual.

Example Usage

Generate your query results using some resource like the pellet servlet. The example used here is a list of all projects (past and present) in the lab and their description, members, homepage, download page, and demo page:

PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX project: <http://www.mindswap.org/2003/owl/project#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?key ?project ?Name ?Description ?Members ?Homepage ?Download ?Demo
FROM <http://www.mindswap.org/2003/submit-rdf/projects.rdf>
WHERE 
{ ?project a foaf:Project .
  {?project rdfs:label ?Name } UNION
  {?project dc:description ?Description } UNION
  {?project project:member ?Members } UNION
  {?project foaf:homepage ?Homepage } UNION
  {?project project:downloadPage ?Download } UNION
  {?project project:demoPage ?Demo }
}
ORDER BY ?key

Then include it in your page via xhtml:

<!--#exec cmd="xsltproc list.xslt [query-url]"-->

The result is this:

Author: Ron Alford

[an error occurred while processing this directive]