Index: ChangeLog =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/ChangeLog,v retrieving revision 1.9 diff -u -3 -p -u -r1.9 ChangeLog --- ChangeLog 31 Mar 2005 16:50:13 -0000 1.9 +++ ChangeLog 31 Mar 2005 16:57:06 -0000 @@ -1,5 +1,13 @@ 2005-03-31 Andrew John Hughes + * src/nongnu/cashews/owls/expression/Expression.java: + (value): Added expression body variable. + (setLanguage(LogicLanguage)): Added mutator. + * src/nongnu/cashews/owls/expression/SWRLExpression.java: + Implemented. + +2005-03-31 Andrew John Hughes + * src/nongnu/cashews/owls/expression/Condition.java: Implemented. * src/nongnu/cashews/owls/expression/Expression.java: Index: src/nongnu/cashews/owls/expression/Expression.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/owls/expression/Expression.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 Expression.java --- src/nongnu/cashews/owls/expression/Expression.java 31 Mar 2005 16:50:14 -0000 1.1 +++ src/nongnu/cashews/owls/expression/Expression.java 31 Mar 2005 16:57:06 -0000 @@ -21,6 +21,8 @@ Free Software Foundation, Inc., 59 Templ package nongnu.cashews.owls.expression; +import nongnu.cashews.rdf.XMLLiteral; + /** * This class represents an OWL-S expression in a particular * logical language. @@ -37,6 +39,21 @@ public class Expression */ private LogicLanguage language; - /* TODO: Add expression body */ + /** + * The value of this expression, in the form of literal XML. + * + * @see nongnu.cashews.rdf.XMLLiteral + */ + private XMLLiteral value; + + /** + * Sets the logical formalism used by this expression. + * + * @param newLang the new language to use. + */ + public void setLanguage(LogicLanguage newLang) + { + language = newLang; + } } Index: src/nongnu/cashews/owls/expression/SWRLExpression.java =================================================================== RCS file: src/nongnu/cashews/owls/expression/SWRLExpression.java diff -N src/nongnu/cashews/owls/expression/SWRLExpression.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/nongnu/cashews/owls/expression/SWRLExpression.java 31 Mar 2005 16:57:06 -0000 @@ -0,0 +1,57 @@ +/* SWRLExpression.java -- Representation of a SWRL 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 SWRL. + * + * @author Andrew John Hughes (address@hidden) + */ +public class SWRLExpression + extends Expression +{ + + /** + * This is the default constructor, which creates a new + * expression using the SWRL logical formalism and an empty + * body. + */ + public SWRLExpression() + { + super(); + setLanguage(LogicLanguage.SWRL); + } + + /** + * This method always throws an exception in this subclass + * in order to prevent changes to the expression language. + * + * @throws UnsupportedOperationException as the language + * can not be modified. + */ + public void setLanguage() + { + throw new UnsupportedOperationException("The logic language of this "+ + "class can not be changed."); + } + +}