|
CoSMoS: Component Service Model with Semantics |
|
Component Service Model with Semantics:
|
|
<cosmos targetNamespace=hURIh
[targetComponent="String"]> |
This is a root element of CoSMoS/XML. Every CoSMoS/XML document must have this element. 'targetNamespace' attribute specifies the target namespace of the component defined in this document. 'targetComponent' attribute specifies the name of the class that the component defined in this document implements.
|
<import URL=hURLh/> |
This element is used to import another CoSMoS document.
|
<primitive
name="String" type=hStringh> |
This element represents a primitive data type, such as integer or string. CoSMoS/XML supports the data types defined in XML Schema: Datatypes. A default value of this element can be specified by using a default attribute.
An invariant element in this element specifies a Boolean condition that must be always satisfied by this primitive element. For example, one can specify that the value of gpriceh integer element must be always positive. XPath is used to describe an invariant.
|
<structure
name="String" [schema=hURLh]> |
This element is used to define a data structure that consists of multiple classes. A structure element can be defined by listing its members, by describing its structure using XML Schema, or by specifying the URL of a XML Schema file in 'schema' property..
|
<array
name="String" type="String" size=hinth> |
This element is used to define an array. The size attribute specifies the size of the array. Multidimensional array can be defined by nesting array elements.
|
<binary MIME=hStringh /> |
This element is used to define a binary data. The MIME attribute specifies the MIME type of the binary data.
|
<concept name="URI"
[wildcard="true|false"]> |
This element is used to define a concept. A 'name' attribute specifies the name of the concept. This element may have zero or more <subConceptOf> element(s), which defines that this concept is a subconcept of the concept specified by <subConceptOf> element. (This is similar to what rdfs:subClassOf defines in RDF Schema.) This element also may have zero or more <equivalentTo> element(s), which defines that this concept is equivalent to the concept specified by <equivalentTo> element. (This is similar to what owl:equivalentTo defines in OWL.)
|
<predicate name="URI" [wildcard="true|false"]/> |
This element is used to define a predicate, which is a subtype of concept. A 'name' attribute specifies the name of the predicate. Similarly as <concept>, this element may have zero or more <subConceptOf> element(s) and zero or more <equivalentTo> elements.
|
<noun name="URI" [wildcard="true|false"]/> |
This element is used to define a noun, which is a subtype of concept. A 'name' attribute specifies the name of the predicate. Similarly as <concept>, this element may have zero or more <subConceptOf> element(s) and zero or more <equivalentTo> elements.
|
<link [name=hStringh] represents="URI" [source=hURIh] target=hURIh/> |
This element is used to define a link to connect two nodes (instances/elements) defined in this document or defined in other documents. A link must have its name. 'source' and 'target' attributes specify the source and target nodes that this link connects. The source attribute can be omitted when the link is specified in another element such as <component> or <operation>.
|
<implies
[name="String"] source="URI" target="URI"/> |
Those elements define a special type of link to represent a predicate logic.
|
<component name="String"
[type="URI"]
represents="URI"> |
This element is used to define a component. A 'name' attribute specifies the name of the component. A 'type' attribute specifies the URI of the class representing the type of this component. A 'represents' attribute specified the URI of the concept representing the semantics of this component.
|
<operation
name="String" [performs=hURIh]> |
This element is used to define an operation, which is a set of inputs, outputs, precondition and postcondition. A perform attribute may be used to indicate the predicate of this operation (See CoSMoS model specification about predicate). <precondition> and <postcondition> of this operation are specified by using XPath.
|
<input> |
This element is used to define a set of inputs for an operation.
|
<output> |
This element is used to define a set of outputs for an operation.
|
<property
ref="URI"/> |
This element is used to define a property of a component. A 'ref' attribute specifies the URI of the component. Either 'ref' attribute or the child <component/> node must be specified.
The following elements, Literal, Choice, Option and RealObject are subelements of Component. Thus, they inherit the attributes of Component.
|
<literal value="String"/> |
This element is used to define a literal value.
|
<choice
min="number" max="number"> |
This element is used to define a group of literal values. It represents that either of the defined literals can substitute this element. For instance, the following example shows that either of the two primitive elements, gCaliforniah or gFloridah, can substitute the choice element gdestinationh.
Example:
|
<choice
name=hdestinationh> |
@
|
<option value="string"/> |
This element is used to define a group of literal values. It represents that either of the defined literals can substitute this element. For instance, the following example shows that either of the two primitive elements, gCaliforniah or gFloridah, can substitute the choice element gdestinationh.
|
<real/> |
This element is used to define an object in the real world.
| Name | CoSMoS/XML | CoSMoS graph (click image to enlarge) |
| Restaurant | Restaurant.xml, Location.xml |
![]() |
| Direction Generator | DirectionGenerator.xml |
![]() |
| Color Printer | ColorPrinter.xml |
![]() |
XML Schema definition of CoSMoS/XML is available here.
@
|
(c) Keita Fujii (kfujii@ics.uci.edu) |