org.eaglei.repository.format
Class SPARQLHTMLWriter

java.lang.Object
  extended by org.eaglei.repository.format.SPARQLHTMLWriter
All Implemented Interfaces:
org.openrdf.query.resultio.TupleQueryResultWriter, org.openrdf.query.TupleQueryResultHandler

public class SPARQLHTMLWriter
extends java.lang.Object
implements org.openrdf.query.resultio.TupleQueryResultWriter

Very quick-n-dirty HTML query result output, helpful for interactive debugging XXX FIXME low priority, maybe later, add class tags, odd/even rows and columns, to facilitate better styling.

Version:
$Id: $
Author:
lcs

Field Summary
static java.lang.String Postlogue
          HTML trailer
static java.lang.String Prologue
          HTML header
static org.openrdf.query.resultio.TupleQueryResultFormat theFormat
          Constant theFormat
 
Constructor Summary
SPARQLHTMLWriter(java.io.OutputStream out)
          Constructor for SPARQLHTMLWriter.
 
Method Summary
 void endQueryResult()
          endQueryResult
 org.openrdf.query.resultio.TupleQueryResultFormat getTupleQueryResultFormat()
          getTupleQueryResultFormat
 void handleSolution(org.openrdf.query.BindingSet bs)
          
protected static java.lang.String renderLinkedURI(org.openrdf.model.URI uri)
          Produce HTML rendering of a URI that is possibly linked data.
 void startQueryResult(java.util.List<java.lang.String> bindingNames)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theFormat

public static final org.openrdf.query.resultio.TupleQueryResultFormat theFormat
Constant theFormat


Prologue

public static final java.lang.String Prologue
HTML header

See Also:
Constant Field Values

Postlogue

public static final java.lang.String Postlogue
HTML trailer

See Also:
Constant Field Values
Constructor Detail

SPARQLHTMLWriter

public SPARQLHTMLWriter(java.io.OutputStream out)

Constructor for SPARQLHTMLWriter.

Parameters:
out - a OutputStream object.
Method Detail

getTupleQueryResultFormat

public org.openrdf.query.resultio.TupleQueryResultFormat getTupleQueryResultFormat()

getTupleQueryResultFormat

Specified by:
getTupleQueryResultFormat in interface org.openrdf.query.resultio.TupleQueryResultWriter
Returns:
a TupleQueryResultFormat object.

startQueryResult

public void startQueryResult(java.util.List<java.lang.String> bindingNames)
                      throws org.openrdf.query.TupleQueryResultHandlerException

Specified by:
startQueryResult in interface org.openrdf.query.TupleQueryResultHandler
Throws:
org.openrdf.query.TupleQueryResultHandlerException

endQueryResult

public void endQueryResult()
                    throws org.openrdf.query.TupleQueryResultHandlerException

endQueryResult

Specified by:
endQueryResult in interface org.openrdf.query.TupleQueryResultHandler
Throws:
org.openrdf.query.TupleQueryResultHandlerException - if any.

handleSolution

public void handleSolution(org.openrdf.query.BindingSet bs)
                    throws org.openrdf.query.TupleQueryResultHandlerException

Specified by:
handleSolution in interface org.openrdf.query.TupleQueryResultHandler
Throws:
org.openrdf.query.TupleQueryResultHandlerException

renderLinkedURI

protected static java.lang.String renderLinkedURI(org.openrdf.model.URI uri)
Produce HTML rendering of a URI that is possibly linked data. This initial version just makes links for resources that this repository is obviously capable of resolving (if correctly configured). Eventually it ought to be extended to include resolution URLs for other links that we expect to be resolvable, e.g. ontology URLs, internal repository objects, etc..

Parameters:
uri - a URI object.
Returns:
a String object.


Copyright © 2009-2010 Eagle-I. All Rights Reserved.