COINS-IO API

Inhoud

Introduction

The COINS-IO API is a platform independent interface to facilitate application programmers with functions to read and write CBIM model files and importing and exporting COINS containers. To fulfill the platform independence requirement the implementation of the IO functions is realized in Java. The API actually publishes two different interfaces:

  • a tightly coupling

which is gained by direct calling of the Java functions (by a Java application or using a generated DLL (eg. IKVM).

  • a loosely coupling

which uses a SOAP protocol in a service oriented architecture.

COINS-IO Architecture
COINS-IO Architecture

The SOAP protocol offers the opportunity to install COINS-IO as a client-server architecture where the server may or may not run on the same platform. This choice has some influence on the behaviour of some of the API functions. For example if the server does not run on the same platform local files need to be uploaded before the load or importContainer functions can be invoked. However, if these files can be retrieved from the web the location of the server is not relevant anymore.

Software to implement a COINS-IO interface yourself is available, see #Software.

API definition

API definition
Function call Return value Description
addAttributeFloatValue(String, int, Float) void postponed Since there are no multiple valued attributes in CBIM
addAttributeIntValue(String, int, Integer) void postponed Since there are no multiple valued attributes in CBIM
addAttributeStringValue(String, int, String) void postponed Since there are no multiple valued attributes in CBIM
addObject(int, String, String) String Create and add a new object to the model.
addObjectWithID(int, String, String, String) void Create and add object with ID to the model.
addOntology(int, String) void Add an imported ontology to the model.
addRelationTargetObject(String, String, String) void Add the relation target object.
cloneAttributeValues(String, String) void Clone the attribute values.
cloneRelations(String, String) void Clone the relations.
compareAttributeValues(String, String) String[] Compare the attribute values.
compareRelations(String, String) String[] Compare the relations.
create(String) int Create a new Coins model.
export(String, String, int) void obsolete see exportContainer(int, String)
exportContainer(int, String) void Exports a COINS container from a given model.
getAttributeBooleanValue(String, String) boolean Return the boolean typed attribute value.
getAttributeDateValue(String, String) long Return the date typed attribute value.
getAttributeDomain(int, String) String Get the domain class of an attribute type.
getAttributeFloatValue(String, String) float Return the float typed attribute value.
getAttributeFloatValues(String, String) float[] postponed Since there are no multiple valued attributes in CBIM
getAttributeIntegerValue(String, String) int Return the integer typed attribute value.
getAttributeIntegerValues(String, String) int[] postponed Since there are no multiple valued attributes in CBIM
getAttributeName(int) String obsolete see getAttributes
getAttributeRange(int, String) String Return the literal range of an attribute type.
getAttributes(int) String[] Return the attribute type ID's of this model (plus imported models).
getAttributeStringValue(String, String) String Return the string typed attribute value.
getAttributeStringValues(String, String) String[] postponed Since there are no multiple valued attributes in CBIM
getAttributeUri(int) String obsolete see getAttributes
getAttributeValuesCount(String, int) int postponed Since there are no multiple valued attributes in CBIM
getClassAttributeCount(int) int obsolete see getClassAttributes
getClassAttributeID(int, int) int obsolete see getClassAttributes
getClassAttributes(int, String) String[] Return the attributeID's of a class.
getClasses(int) String[] Return the class ID's of this model (plus imported models).
getClassName(int) String obsolete see getClasses
getClassRelationCount(int) int obsolete see getClassRelations
getClassRelationID(int, int) int obsolete see getClassRelations
getClassRelations(int, String) String[] Return the relationID's of a class.
getInverse(String) String Get the URI of the inverse of the specified relation or null.
getInverseName(int) String obsolete see getInverse(String)
getModelUri(int) String Get the URI of the model.
getObjectClass(String) String Return the class of an object.
getObjectID(int, int) String obsolete see getObjectIDs
getObjectIDs(int) String[] Return the objectID's in this model.
getObjectsCount(int) int Return the number of objects in the model.
getObjectUri(String) String obsolete see getObjectIDs
getOntologies(int) String[] List all imported ontologies.
getRelationName(int) String obsolete see getRelations
getRelations(int) String[] Get the relation type ID's of this model (plus imported models).
getRelationsCount(String, String) int Return the number of instances of this relation.
getRelationTargetObject(String, String) String Return the ID of the target object of the relation.
getRelationTargetObjects(String, String) String[] Return the ID's of the target objects of the relation.
getRelationUri(int) String obsolete see getRelations
getValueType(int) int obsolete see getAttributeRange
import(String, String) int renamed (because of Java reserved word clash) see importContainer
importContainer(String, String) int Imports a model from a given COINS container.
isAttributeNull(String, String) boolean Test if the attribute value for the specified object is set?
isMultiple(String, String) boolean Has the specified relation type used in the specified class a max cardinality of more than one?
isRelation(int) boolean obsolete Relations (object properties) and attributes (datatype properties) are discriminated through out the whole API.
load(String) int Load a Coins model. The uri may refer to a web file (uri: "http:// ... /[Coins model file name].owl") or a local file in case client and server run on the same platform.
removeAttributeValue(String, String) void Remove (or unset) the attribute value of the specified object
removeAttributeValue(String, int, String) void postponed Since there are no multiple valued attributes in CBIM
removeObject(int, String) void Remove an object from the model and remove also all relations with this object.
removeRelationTargetObject(String, String, String) void Remove an object from the relations set.
reset() void Reset the current session and forget all previously loaded models.
save(int, String) void Save the model as a local file. This function will only work if the server is installed as local host.
setAttributeBooleanValue(String, String, boolean) void (Re)Set the boolean typed attribute value.
setAttributeDateValue(String, String, long) void (Re)Set the date typed attribute value.
setAttributeFloatValue(String, String, float) void (Re)Set the float typed attribute value.
setAttributeIntegerValue(String, String, int) void (Re)Set the integer typed attribute value.
setAttributeStringValue(String, String, String) void (Re)Set the string typed attribute value.
setRelationTargetObject(String, String, String) void (Re)Set the relation target object.
upload(String, String, byte[]) void Upload a file to the server.


Software

Software is available to build a COINS-IO interface:

Afkomstig van CoinsWiki NL, de Vrije Encyclopedie. "http://www.coinsweb.nl/wiki/index.php/COINS-IO_API"
Personal tools