View Javadoc

1   /*
2    wsmo4j - a WSMO API and Reference Implementation
3    Copyright (c) 2004-2005, OntoText Lab. / SIRMA
4    This library is free software; you can redistribute it and/or modify it under
5    the terms of the GNU Lesser General Public License as published by the Free
6    Software Foundation; either version 2.1 of the License, or (at your option)
7    any later version.
8    This library is distributed in the hope that it will be useful, but WITHOUT
9    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11   details.
12   You should have received a copy of the GNU Lesser General Public License along
13   with this library; if not, write to the Free Software Foundation, Inc.,
14   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15   */
16  
17  /**
18   * <p>Title: WSMO4J</p>
19   * <p>Description: WSMO API and a Reference Implementation</p>
20   * <p>Copyright:  Copyright (c) 2004-2005</p>
21   * <p>Company: OntoText Lab. / SIRMA </p>
22   */
23  
24  package org.wsmo.common;
25  
26  
27  import java.util.*;
28  
29  import org.wsmo.common.exception.*;
30  import org.omwg.ontology.*;
31  
32  /**
33   * Base class for all WSMO entities.
34   *
35   * @author not attributable
36   * @version $Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
37   */
38  public interface Entity {
39      /**
40       * Returns the list of values associated with the specified key.
41       * @param key The key (IRI) of interest.
42       * @return A list of values associated with the specified key.
43       * @throws org.wsmo.common.exception.SynchronisationException
44       * @see NFP
45       */
46      Set <Object> listNFPValues(IRI key)
47              throws SynchronisationException;
48  
49      /**
50       * Returns all the NFP with their values as java.util.Map.
51       * The Map entries are (key, set-of-values-for-that-key)
52       * @return A Map holding the NFPs and values
53       * @throws org.wsmo.common.exception.SynchronisationException
54       * @see NFP
55       */
56  
57      Map <IRI, Set <Object>> listNFPValues()
58              throws SynchronisationException;
59  
60      /**
61       * Adds a value to the list of values associated with this key.
62       * @param key The key of interest.
63       * @param value Identifier or DataValue to be added to the list of values associated with this key.
64       * @throws org.wsmo.common.exception.SynchronisationException
65       * @throws org.wsmo.common.exception.InvalidModelException
66       * @see NFP
67       */
68  
69      void addNFPValue(IRI key, Identifier value)
70              throws SynchronisationException, InvalidModelException;
71  
72      /**
73       * Adds a value to the list of values associated with this key.
74       * @param key The key of interest.
75       * @param value Identifier or DataValue to be added to the list of values associated with this key.
76       * @throws org.wsmo.common.exception.SynchronisationException
77       * @throws org.wsmo.common.exception.InvalidModelException
78       * @see NFP
79       */
80  
81      void addNFPValue(IRI key, Value value)
82              throws SynchronisationException, InvalidModelException;
83  
84      /**
85       * Removes a value from the list of values associated with a specific key.
86       * @param key The key of interest.
87       * @param value Identifier or DataValue to be removed from the list of values associated with the specified key.
88       * @throws org.wsmo.common.exception.SynchronisationException
89       * @throws org.wsmo.common.exception.InvalidModelException
90       * @see NFP
91       */
92      void removeNFPValue(IRI key, Identifier value)
93              throws SynchronisationException, InvalidModelException;
94  
95      /**
96       * Removes a value from the list of values associated with a specific key.
97       * @param key The key of interest.
98       * @param value Identifier or DataValue to be removed from the list of values associated with the specified key.
99       * @throws org.wsmo.common.exception.SynchronisationException
100      * @throws org.wsmo.common.exception.InvalidModelException
101      * @see NFP
102      */
103     void removeNFPValue(IRI key, Value value)
104             throws SynchronisationException, InvalidModelException;
105 
106     /**
107      * Removes a NFP (e.g. all key/value pairs) associated with a specific key.
108      * @param key The key of interest.
109      * @throws org.wsmo.common.exception.SynchronisationException
110      * @throws org.wsmo.common.exception.InvalidModelException
111      * @see NFP
112      */
113     void removeNFP(IRI key)
114             throws SynchronisationException, InvalidModelException;
115 
116     /**
117      * Returns the ID of this entity.
118      * @return The ID of this entity.
119      */
120     Identifier getIdentifier();
121 
122 // DO NOT EDIT below this line
123 
124     /**
125      * @supplierCardinality 1
126      * @supplierRole identifiedBy
127      * @directed*/
128     /*# Identifier lnkIdentifier; */
129 }
130 /*
131  * $Log$
132  * Revision 1.12  2007/04/02 12:13:14  morcen
133  * Generics support added to wsmo-api, wsmo4j and wsmo-test
134  *
135  * Revision 1.11  2005/09/27 13:10:24  marin_dimitrov
136  * javadoc
137  *
138  * Revision 1.10  2005/09/16 12:40:39  marin_dimitrov
139  * 1. Entity::addNfpValue(IRI, Object) split into Entity::addNfpValue(IRI, Identifier) and Entity::addNfpValue(IRI, Value)
140  *
141  * 2. same for removeNFP
142  *
143  * Revision 1.9  2005/08/31 12:28:37  vassil_momtchev
144  * addNFPValue and removeNFPValue changed back to accept Object. The Value type limits all kind of identifiers (IRI, AnonymousID)
145  *
146  * Revision 1.8  2005/08/31 09:16:43  vassil_momtchev
147  * use Type and Value instead of Object where appropriate bug SF[1276677]
148  *
149  * Revision 1.7  2005/08/19 08:57:49  marin_dimitrov
150  * added removeNFP(key)
151  *
152  * Revision 1.6  2005/06/01 10:30:48  marin_dimitrov
153  * v0.4.0
154  *
155  * Revision 1.3  2005/05/12 13:29:15  marin
156  * javadoc, header, footer, etc
157  *
158  */