PresentationSyntaxWriter.java revision 2
/*
* Created on Jun 1, 2004
*/
/**
* This is a experimental version of OWL-S presentation syntax writer.
*
* @author Evren Sirin
*/
public class PresentationSyntaxWriter implements ProcessWriter {
private PrintWriter out;
public PresentationSyntaxWriter() {
init();
}
public String getDefaultNS() {
return defaultNS;
}
else
}
public void init() {
}
}
else
}
try {
}
catch( Exception e ) {
return "<< Invalid URI >>";
}
}
if( left )
else
}
private void printIndented() {
}
}
}
char[] chars = new char[n];
}
if( start ) {
printlnIndented( "{" );
indent( true );
}
else {
indent( false );
printIndented( "}" );
}
}
}
}
}
}
}
indent( true );
}
indent( false );
writeHeader();
writeFooter();
}
public void writeHeader() {
}
if( i.hasNext() )
else
}
}
public void writeFooter() {
}
}
if(process instanceof AtomicProcess)
else if(process instanceof CompositeProcess)
else
throw new RuntimeException( "Only writing Atomic and Composite process implemented yet" );
}
printIndented("define composite process ");
if( !emptyProcess( process ) ) {
}
writeConstruct( cc, true );
}
indent( true );
{
printIndented("inputs: (" );
{
printIndented(" ");
}
else
}
}
{
printIndented("locals: (" );
{
printIndented(" ");
}
else
}
}
{
printIndented("outputs: (" );
{
printIndented(" ");
}
else
}
}
indent( false );
}
printIndented( str );
}
if(mappedParamValue instanceof ValueOf) {
}
else if(mappedParamValue instanceof ValueData) {
if( value.isDataValue() ) {
boolean quote =
datatypeURI == null || (
if( quote ) {
if( datatypeURI != null )
}
}
else
}
else
mappedValue = "<< Unknown Binding Type >>";
}
}
}
}
// private void writeConstruct(ControlConstruct cc) {
// writeConstruct(cc, false);
// }
{
if( block ) {
block( false );
}
}
{
}
{
}
{
}
{
}
{
}
else if(cc instanceof IfThenElse)
{
if( block ) {
block( false );
}
}
{
if( block ) {
block( false );
}
}
else
}
block( true );
writeConstruct( cc, false );
if( i.hasNext() )
else
}
block( false );
}
printIndented("if( ");
printlnIndented( "then" );
writeConstruct( thenP, true );
printlnIndented( "else" );
writeConstruct( elseP, true );
}
}
printIndented( str );
}
}
if( !emptyProcess( process ) ) {
}
}
indent( true );
printIndented("precondition: (");
}
indent( false );
}
indent( true );
printIndented( "result: (" );
if( !resultVars.isEmpty() ) {
{
printIndented(" ");
}
else
}
printIndented(" ");
}
printlnIndented( " |->" );
printIndented( " " );
}
}
printIndented( " " );
}
}
}
indent( false );
}
return writer;
}
public ExpressionWriter getExpressionWriter() {
return exprWriter;
}
}
}
public QNameProvider getQNames() {
return qnames;
}
}
OWLConfig.setStrictConversion( false );
// if( args.length == 0 ) {
// System.out.println( "No URI given!" );
// return;
// }
//
// uri = args[0];
// uri = "http://www.cs.umd.edu/~nwlin/haha/services.owl";
else
}
}