[MOBY-guts] biomoby commit
senger@ebi.ac.uk
senger at pub.open-bio.org
Thu Sep 23 10:20:30 UTC 2004
senger
Thu Sep 23 06:20:30 EDT 2004
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared
In directory pub.open-bio.org:/tmp/cvs-serv17926/src/main/org/biomoby/shared
Modified Files:
Central.java MobyDataSimpleInstance.java MobyDataType.java
MobyRelationship.java
Log Message:
some constants moved from MobyRelationship to Central interface
moby-live/Java/src/main/org/biomoby/shared Central.java,1.5,1.6 MobyDataSimpleInstance.java,1.2,1.3 MobyDataType.java,1.3,1.4 MobyRelationship.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2004/05/18 10:13:17 1.5
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2004/09/23 10:20:29 1.6
@@ -48,15 +48,38 @@
public interface Central {
- /** A name for the relationship type "is a". */
+ /** A relationship type expressing a straight inheritance (as
+ * string). If Object_A ISA Object_B then all attributes of
+ * Object_B are guaranteed to be present in Object_A.
+ */
static final String ISA = "ISA";
- /** A name for the relationship type "has a". */
+ /** A relationship type expressing a contaiment (as string). If
+ * Object_A HASA Object_B then Object_B is an object inside of
+ * Object_A in one copy only. */
static final String HASA = "HASA";
- /** A name for the relationship type "has". */
+ /** A relationship type expressing a contaiment (as string). If
+ * Object_A HAS Object_B then Object_B is an object inside of
+ * Object_A in one or more copies. */
static final String HAS = "HAS";
+ /** A relationship type expressing a straight inheritance (as
+ * integer). If Object_A ISA Object_B then all attributes of
+ * Object_B are guaranteed to be present in Object_A.
+ */
+ static final int iISA = 1;
+
+ /** A relationship type expressing a contaiment (as integer). If
+ * Object_A HASA Object_B then Object_B is an object inside of
+ * Object_A in one copy only. */
+ static final int iHASA = 2;
+
+ /** A relationship type expressing a contaiment (as integer). If
+ * Object_A HAS Object_B then Object_B is an object inside of
+ * Object_A in one or more copies. */
+ static final int iHAS = 3;
+
/**************************************************************************
* Get a (redundant) list of all registered service names.
*<p>
@@ -309,7 +332,7 @@
/**************************************************************************
* Find service matching both all non-empty fields in the 'pattern' and
- * the 'keywords', and take into account also the whole ontology tree:
+ * the 'keywords', and take into account also the whole ontology tree.
* <p>
* @param includeChildrenServiceTypes - if true (which is default)
* then it discovers also services that are child types (more
@@ -351,4 +374,12 @@
* Reports whether server responses are being cached or not.
*************************************************************************/
boolean getCacheMode();
+
+
+ // Work in progress:
+// http://biomoby.org/RESOURCES/MOBY-S/Objects
+// http://biomoby.org/RESOURCES/MOBY-S/Services
+// http://biomoby.org/RESOURCES/MOBY-S/Namespaces
+// http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances
+
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataSimpleInstance.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataSimpleInstance.java 2004/09/03 20:28:16 1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataSimpleInstance.java 2004/09/23 10:20:29 1.3
@@ -140,7 +140,7 @@
}
/**
- * Used to set the data instance value based on a ID string (i.e. just an Object)
+ * Used to set the data instance value based on an ID string. E.i. just an Object.
*/
public void setId(String value){
super.setId(value);
@@ -214,7 +214,7 @@
* a template for use in MOBY Central services, or a Simple element for use in calling a service
* instance.
*
- * @returns the MOBY XML representation of the data instance
+ * @return the MOBY XML representation of the data instance
*/
public String toXML(){
if(xmlMode == SERVICE_XML_MODE)
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2004/09/22 21:11:17 1.3
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2004/09/23 10:20:29 1.4
@@ -176,8 +176,8 @@
* types - in other words it does not go up through the whole
* ontology tree to find all children. <p>
*
- * @see MobyRelationship.HAS
- * @see MobyRelationship.HASA
+ * @see Central#iHAS
+ * @see Central#iHASA
*/
public MobyRelationship[] getChildren() {
return children;
@@ -216,18 +216,18 @@
* also a null or empty string here - but according to the BioMoby
* API (0.8) this name should be always given.
* @param typeName is a name of the child data type,
- * e.g. 'Integer'. If null it is ignored.
- * @param relationshipType is either {@link MobyRelationship.HASA
- * HASA} or {@link MobyRelationship.HAS HAS}. If it is something
- * else it is silenty changed to {@link MobyRelationship.HASA
+ * e.g. 'Integer'. If it is null it is ignored.
+ * @param relationshipType is either {@link Central#iHASA
+ * HASA} or {@link Central#iHAS HAS}. If it is something
+ * else it is silenty changed to {@link Central#iHASA
* HASA}.
*/
public void addChild (String name, String typeName, int relationshipType) {
if (typeName != null) {
if (name == null) name = "";
- if (relationshipType != MobyRelationship.HASA &&
- relationshipType != MobyRelationship.HAS)
- relationshipType = MobyRelationship.HASA;
+ if (relationshipType != Central.iHASA &&
+ relationshipType != Central.iHAS)
+ relationshipType = Central.iHASA;
addChild (new MobyRelationship (name, typeName, relationshipType));
}
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyRelationship.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyRelationship.java 2004/09/22 21:11:17 1.1
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyRelationship.java 2004/09/23 10:20:29 1.2
@@ -20,25 +20,9 @@
public class MobyRelationship {
- /** A relationship type expressing a straight inheritance. If
- * Object_A ISA Object_B then all attributes of Object_B are
- * guaranteed to be present in Object_A.
- */
- public static final int ISA = 1;
-
- /** A relationship type expressing a contaiment. If Object_A HASA
- * Object_B then Object_B is an object inside of Object_A in one
- * copy only. */
- public static final int HASA = 2;
-
- /** A relationship type expressing a contaiment. If Object_A HAS
- * Object_B then Object_B is an object inside of Object_A in one
- * or more copies. */
- public static final int HAS = 3;
-
protected String name; // articleName
protected String dataTypeName;
- protected int relationshipType = HASA;
+ protected int relationshipType = Central.iHASA;
/**************************************************************************
* Default (and only) constructor. <p>
@@ -50,15 +34,15 @@
* should be always given.
* @param dataTypeName is a name of a data type that is defined by
* this relationship, e.g. 'Integer'.
- * @param relationshipType is either {@link #HASA} or {@link
- * #HAS}. If it is something else it is silently changed to {@link
- * #HASA}.
+ * @param relationshipType is either {@link Central#iHASA HASA} or {@link
+ * Central#iHAS HAS}. If it is something else it is silently changed to {@link
+ * Central#iHASA HASA}.
*************************************************************************/
public MobyRelationship (String name, String dataTypeName, int relationshipType) {
this.name = name;
this.dataTypeName = dataTypeName;
- if (relationshipType != HASA && relationshipType != HAS)
- relationshipType = HASA;
+ if (relationshipType != Central.iHASA && relationshipType != Central.iHAS)
+ relationshipType = Central.iHASA;
this.relationshipType = relationshipType;
}
@@ -78,8 +62,8 @@
}
/**
- * Return type of this relationship. It is either {@link #HASA} or
- * {@link #HAS}.
+ * Return type of this relationship. It is either {@link Central#iHASA HASA} or
+ * {@link Central#iHAS HAS}.
*/
public int getRelationshipType() {
return relationshipType;
@@ -93,9 +77,9 @@
*/
public static String type2str (int relationshipType) {
switch (relationshipType) {
- case HASA: return "HASA";
- case HAS: return "HAS";
- case ISA: return "ISA";
+ case Central.iHASA: return Central.HASA;
+ case Central.iHAS: return Central.HAS;
+ case Central.iISA: return Central.ISA;
default: return "unknown";
}
}
More information about the MOBY-guts
mailing list