object User {
itemName user;
description """
User of the system.
""";
property oid {
type uuid;
}
property name {
type PolyString;
}
}
Prism and Axiom
Prism models the entities as uniquely identifiable objects. Object is hierarchical organization of its data as a tree of items in which each item has a name, and either a value (property) or a set of child items (container).
Prism defines five basic concepts for data modeling - objects, properties, containers, object references and value metadata.
Objects are top-level data structures. Objects are a set of items: properties, containers and references. Properties contain coherent data structures that are usually simple primitive values. Containers can be used to group other items in hierarchical data structures. References can be used to express relations between objects.
Terminology
The following terms are used in Prism:
- object
-
An identifiable entity. TODO: better explanation
- item
-
Item is attribute of object which can have value. There are 3 item types: property, container or object reference.
- property
-
An item, which can contain values of simple types, does not contain nested items. The type of value must be simple type.
- container
-
An item, whose values can contain multiple nested items, which are addressable. The type of value must be complex type.
- value
-
Represents concrete instance of type. The value is instance of type and may have value metadata attached.
- value metadata
-
Represents metadata attached to value. The value metadata could be property, container or object reference.
Objects
Object represents top-level entity, which may have nested data items. Object must be uniquely identifiable in the system. E.g. in Prism this is achieved by objects having object identifier (UUID). Objects contain data items.
<user>
<oid>0b2f5d5c-6560-43da-9dcb-445eb6fd742a</oid>
<name>administrator</name>
...
</user>
user:
oid: 0b2f5d5c-6560-43da-9dcb-445eb6fd742a
name: administrator
...
Properties
A property instance contains data of simple type like an integer or a string. It may have multiple values of particular type. In case of expanded value form it may have nested data items.
property comment {
type PolyString;
}
<comment>Simple value</comment>
<comment>
<orig>Complex Value</orig>
<norm>complex-value</norm>
<metadata>
...
</metadata>
</comment>
comment:
- Simple value
- orig: Complex value
norm: complex-value
metadata:
....
Containers
A container instance contains data of complex type like address or user details. It may have multiple values of particular type.
complexType Address {
property street {
type string;
}
property city {
type string;
}
property country {
type string;
}
}
container primaryAddress {
type Address;
}
primaryAddress:
street: Main Street 10
city: Bratislava
country: Slovak Republic
Object references
An object reference instance contains reference to object of particular type. It may have multiple references to particular object.
resourceReference managerRef {
description "Manager of the resource";
type User;
}
managerRef:
oid: 0b2f5d5c-6560-43da-9dcb-445eb6fd742a
Data Types
Prism-specific built-in types:
- PolyString
-
String which can have normalized form and language-specific variants defined.