Index: src/nongnu/cashews/owls/expression/Condition.java =================================================================== RCS file: src/nongnu/cashews/owls/expression/Condition.java diff -N src/nongnu/cashews/owls/expression/Condition.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/nongnu/cashews/owls/expression/Condition.java 31 Mar 2005 16:47:52 -0000 @@ -0,0 +1,32 @@ +/* Condition.java -- Representation of a condition. + Copyright (C) 2005 The University of Sheffield. + +This file is part of the CASheW-s editor. + +The CASheW-s editor is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The CASheW-s editor is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with The CASheW-s editor; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. +*/ + +package nongnu.cashews.owls.expression; + +/** + * This interface represents an OWL-S condition in a particular + * logical language. + * + * @author Andrew John Hughes (address@hidden) + */ +public interface Condition +{ +} Index: src/nongnu/cashews/owls/expression/Expression.java =================================================================== RCS file: src/nongnu/cashews/owls/expression/Expression.java diff -N src/nongnu/cashews/owls/expression/Expression.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/nongnu/cashews/owls/expression/Expression.java 31 Mar 2005 16:47:52 -0000 @@ -0,0 +1,42 @@ +/* Expression.java -- Representation of an expression. + Copyright (C) 2005 The University of Sheffield. + +This file is part of the CASheW-s editor. + +The CASheW-s editor is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The CASheW-s editor is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with The CASheW-s editor; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. +*/ + +package nongnu.cashews.owls.expression; + +/** + * This class represents an OWL-S expression in a particular + * logical language. + * + * @author Andrew John Hughes (address@hidden) + */ +public class Expression +{ + + /** + * The logical language in which this expression is written. + * + * @serial the logical language of this expression. + */ + private LogicLanguage language; + + /* TODO: Add expression body */ + +} Index: src/nongnu/cashews/owls/expression/LogicLanguage.java =================================================================== RCS file: src/nongnu/cashews/owls/expression/LogicLanguage.java diff -N src/nongnu/cashews/owls/expression/LogicLanguage.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/nongnu/cashews/owls/expression/LogicLanguage.java 31 Mar 2005 16:47:52 -0000 @@ -0,0 +1,275 @@ +/* LogicLanguage.java -- Representation of an OWL-S logic language. + Copyright (C) 2005 The University of Sheffield. + +This file is part of the CASheW-s editor. + +The CASheW-s editor is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The CASheW-s editor is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with The CASheW-s editor; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. +*/ + +package nongnu.cashews.owls.expression; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; + +/** + * This class represents a particular logical formalism, such + * as KIF, DRS or SWRL. At present, it simply allows for the specification + * of zero or more URIs, which point to the documentation for the + * formalism. + * + * @author Andrew John Hughes (address@hidden) + */ +public class LogicLanguage +{ + + /** + * A representation of the logical formalism, SWRL, + * as defined by the W3C. + */ + public static final LogicLanguage SWRL = new SWRL(); + + /** + * A representation of the logical formalism, DRS, + * as defined by the DAML team. + */ + public static final LogicLanguage DRS = new DRS(); + + /** + * A representation of the logical formalism, KIF, + * as defined by Stanford University. + */ + public static final LogicLanguage KIF = new KIF(); + + /** + * A list of URIs which specify the location + * of the documentation for this formalism. + * + * @serial the URIs of this formalism's documentation. + * @see java.net.URI + */ + private List uris; + + /** + * The default constructor for a LogicLanguage + * instance. + */ + public LogicLanguage() + { + uris = new ArrayList(); + } + + /** + * Adds a URI to the list specifying the documentation + * for this formalism. + * + * @param uri the URI to add. + * @see java.net.URI + */ + public void addURI(URI uri) + { + uris.add(uri); + } + + /** + * Returns the list of URIs for this logic + * formalism. + * + * @return a cloned list of the URIs of this formalism. + */ + public List getURIs() + { + List clonedURIs = new ArrayList(); + for (URI uri : uris) + { + try + { + URI newURI = new URI(uri.toString()); + clonedURIs.add(newURI); + } + catch (URISyntaxException e) + { + throw new IllegalStateException("The list of URIs includes an "+ + "Âinvalid UR.", e); + } + } + return clonedURIs; + } + + /** + * A specific subclass of LogicLanguage, which represents + * the SWRL logic formalism. Instances of this are not modifiable. + * + * @author Andrew John Hughes (address@hidden) + * @see LogicLanguage + */ + private static final class SWRL + extends LogicLanguage + { + + /** + * The default constructor for the SWRL language. + */ + public SWRL() + { + } + + /** + * This method always throws an exception in this subclass + * in order to prevent derivations of the SWRL formalism. + * + * @throws UnsupportedOperationException as the formalism + * can not be modified. + */ + public void addURI(URI uri) + { + throw new UnsupportedOperationException("The SWRL logic language "+ + "instance is not modifable."); + } + + /** + * Returns the list of URIs for the SWRL logic + * formalism. + * + * @return the SWRL URIs. + */ + public List getURIs() + { + List swrl = new ArrayList(); + try + { + swrl.add(new URI("http://www.w3.org/2003/11/swrl")); + } + catch (URISyntaxException e) + { + throw new IllegalStateException("The SWRL URL is invalid.", e); + } + return swrl; + } + + } + + /** + * A specific subclass of LogicLanguage, which represents + * the DRS logic formalism. Instances of this are not modifiable. + * + * @author Andrew John Hughes (address@hidden) + * @see LogicLanguage + */ + private static final class DRS + extends LogicLanguage + { + + /** + * The default constructor for the DRS language, which stores + * the URIs for its specification documents. + */ + public DRS() + { + } + + /** + * This method always throws an exception in this subclass + * in order to prevent derivations of the DRS formalism. + * + * @throws UnsupportedOperationException as the formalism + * can not be modified. + */ + public void addURI(URI uri) + { + throw new UnsupportedOperationException("The DRS logic language "+ + "instance is not modifable."); + } + + /** + * Returns the list of URIs for the DRS logic + * formalism. + * + * @return the DRS URIs. + */ + public List getURIs() + { + List drs = new ArrayList(); + try + { + drs.add(new URI("http://www.daml.org/services/owl-s/1.1/" + + "generic/drs.owl")); + } + catch (URISyntaxException e) + { + throw new IllegalStateException("The DRS URL is invalid.", e); + } + return drs; + } + + } + + /** + * A specific subclass of LogicLanguage, which represents + * the KIF logic formalism. Instances of this are not modifiable. + * + * @author Andrew John Hughes (address@hidden) + * @see LogicLanguage + */ + private static final class KIF + extends LogicLanguage + { + + /** + * The default constructor for the KIF language, which stores + * the URIs for its specification documents. + */ + public KIF() + { + } + + /** + * This method always throws an exception in this subclass + * in order to prevent derivations of the KIF formalism. + * + * @throws UnsupportedOperationException as the formalism + * can not be modified. + */ + public void addURI(URI uri) + { + throw new UnsupportedOperationException("The KIF logic language "+ + "instance is not modifable."); + } + + /** + * Returns the list of URIs for the KIF logic + * formalism. + * + * @return the KIF URIs. + */ + public List getURIs() + { + List kif = new ArrayList(); + try + { + kif.add(new URI("http://logic.stanford.edu/kif/kif.html")); + } + catch (URISyntaxException e) + { + throw new IllegalStateException("The KIF URL is invalid.", e); + } + return kif; + } + + } + +} Index: src/nongnu/cashews/owls/process/Parameter.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/owls/process/Parameter.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 Parameter.java --- src/nongnu/cashews/owls/process/Parameter.java 31 Mar 2005 15:25:30 -0000 1.1 +++ src/nongnu/cashews/owls/process/Parameter.java 31 Mar 2005 16:47:52 -0000 @@ -21,9 +21,10 @@ Free Software Foundation, Inc., 59 Templ package nongnu.cashews.owls.process; -import nongnu.cashews.rdf.RDFURI; import nongnu.cashews.rdf.XMLLiteral; +import java.net.URI; + /** * A Parameter is a generalization of the * inputs and outputs found within an OWL-S process. @@ -34,12 +35,12 @@ public abstract class Parameter { /** - * An RDFURI which specifies the OWL class + * A URI which specifies the OWL class * from which the values of this parameter are taken. * - * @see nongnu.cashews.rdf.RDFURI + * @see java.net.URI */ - private RDFURI type; + private URI type; /** * The value of this parameter, in the form of literal XML. Index: src/nongnu/cashews/owls/process/Result.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/owls/process/Result.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 Result.java --- src/nongnu/cashews/owls/process/Result.java 31 Mar 2005 15:25:30 -0000 1.1 +++ src/nongnu/cashews/owls/process/Result.java 31 Mar 2005 16:47:52 -0000 @@ -21,6 +21,9 @@ Free Software Foundation, Inc., 59 Templ package nongnu.cashews.owls.process; +import nongnu.cashews.owls.expression.Condition; +import nongnu.cashews.owls.expression.Expression; + import java.util.List; /** @@ -42,6 +45,23 @@ public class Result */ private List variables; - /* TODO: Add condition and effect lists and output bindings */ + /** + * A list of Conditions used within the scope + * of this Result instance. + * + * @serial the conditions scoped over this instance. + */ + private List conditions; + + /** + * A list of Expressions used within the scope + * of this Result instance to define the effects + * of this operation. + * + * @serial the effects scoped over this instance. + */ + private List expressions; + + /* TODO: Add output bindings */ }