View Javadoc

1   /*
2    wsmo4j - a WSMO API and Reference Implementation
3   
4    Copyright (c) 2004, , University of Innsbruck, Austria
5   
6    This library is free software; you can redistribute it and/or modify it under
7    the terms of the GNU Lesser General Public License as published by the Free
8    Software Foundation; either version 2.1 of the License, or (at your option)
9    any later version.
10   This library is distributed in the hope that it will be useful, but WITHOUT
11   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13   details.
14   You should have received a copy of the GNU Lesser General Public License along
15   with this library; if not, write to the Free Software Foundation, Inc.,
16   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17   */
18  package org.omwg.logicalexpression.terms;
19  
20  
21  import java.util.*;
22  
23  import org.omwg.ontology.*;
24  import org.wsmo.common.*;
25  
26  
27  /**
28   * The interface for constructed terms (function symbols).
29   * 
30   * E.g. in the molecule jon[age(2005) hasValue 12]
31   * age(2005) is a function symbol. Function symbols are only
32   * allowed in WSML Rule and WSML FOL. Note that some data
33   * values (e.g. _date(2005,12,12) look syntactically like function
34   * symbols, but are transformed by the parser directly to
35   * a {@link DataValue}.
36   *
37   * @author DERI Innsbruck, reto.krummenacher@deri.org
38   * @author Holger Lausen
39   * @version $Revision: 1350 $ $Date: 2005-11-28 17:36:42 +0200 (Mon, 28 Nov 2005) $
40   * @see org.omwg.logicalexpression.terms.Term
41   */
42  public interface ConstructedTerm
43          extends Term {
44  
45      /**
46       * The arity of the ConstructedTerm indicates how many Terms are contained in the
47       * Term's list of arguments.
48       *
49       * @return the arity of the term, i.e. the number of parameters
50       */
51      public int getArity();
52  
53      /**
54       * The returned IRI represents the name of the ConstructedTerm.
55       *
56       * @return the name of the term, in wsml only possible in form of an IRI
57       */
58      public IRI getFunctionSymbol();
59  
60      /**
61       * The index i points to a position in the ConstructedTerm's list of arguments.
62       * The desired Term, to which the index points, is returned.
63       *
64       * @param i the position of the parameter desired, maximal getArity()-1
65       * @return the chosen parameter
66       */
67      public Term getParameter(int i);
68      
69      /**
70       * Return the list of all Parameters 
71       * @return list of parameter of the constructed term
72       */
73      public List listParameters();
74  }
75  /*
76   * $Log$
77   * Revision 1.4  2005/11/28 15:36:42  holgerlausen
78   * added convinience method listParameter (RFE 1363559)
79   *
80   * Revision 1.3  2005/09/09 11:58:20  holgerlausen
81   * fixed header logexp no longer extension
82   *
83   * Revision 1.2  2005/09/09 11:03:14  marin_dimitrov
84   * formatting
85   *
86   * Revision 1.1  2005/09/02 13:32:44  ohamano
87   * move logicalexpression packages from ext to core
88   * move tests from logicalexpression.test to test module
89   *
90   * Revision 1.5  2005/09/02 09:43:27  ohamano
91   * integrate wsmo-api and le-api on api and reference implementation level; full parser, serializer and validator integration will be next step
92   *
93   * Revision 1.4  2005/08/16 16:28:29  nathaliest
94   * JavaDoc added
95   * Method getArgument(int) at UnaryImpl, QuantifiedImpl and BinaryImpl changed
96   * Method equals(Object) at QuantifiedImpl changed
97   *
98   * Revision 1.3  2005/06/22 13:32:02  ohamano
99   * change header
100  *
101  * Revision 1.2  2005/06/18 14:06:08  holgerlausen
102  * added local LEFactory, updated javadoc, refactored LEVariable > Variable etc. parse(String) for LEFactory is running now
103  *
104  * Revision 1.1  2005/06/16 13:55:23  ohamano
105  * first import
106  *
107  */