The Web Graph Database

wiki:Docs/ModelDefinitionFormat/AnnotatedExample

Model Definition File Format / Annotated Example

Here is a simple example Model for the Model Definition File Format, taken from the org.infogrid.model.Wiki ModelModule that is part of InfoGrid:

<!DOCTYPE model PUBLIC '-//InfoGrid.org//InfoGrid Model//EN' 'http://infogrid.org/dtds/model.dtd'>
<model>
    <subjectarea ID="org.infogrid.model.Wiki">
        <name>org.infogrid.model.Wiki</name>
        <username>Wiki Subject Area</username>
        <userdescription>Defines concepts for wiki-style data representation.</userdescription>

        <entitytype ID="org.infogrid.model.Wiki/WikiObject">
            <name>WikiObject</name>
            <username>Wiki Object</username>
            <userdescription>A wiki object</userdescription>

            <propertytype ID="org.infogrid.model.Wiki/WikiObject_Content">
                <name>Content</name>
                <username>Content</username>
                <userdescription>Current official content of the Wiki Object.</userdescription>
                <datatype>
                    <BlobDataType default="theTextHtmlType"/>
                </datatype>
                <defaultvalue><![CDATA[<p>(Wiki Object Placeholder)</p>]]></defaultvalue>
            </propertytype>
        </entitytype>
    </subjectarea>

This file defines a Model containing one SubjectArea with identifier org.infogrid.model.Wiki.

The SubjectArea has a computer-interpreted name called org.infogrid.model.Wiki. It also has an internationalizable name and internationalizable description that may be shown to a user. It does not depend on any other SubjectArea.

This simple SubjectArea defines a single EntityType with identifier org.infogrid.model.Wiki/WikiObject. By convention, all identifiers of MeshTypes have to start with the identifier of the SubjectArea in which they are defined, followed by a slash. The EntityType has a computer-interpreted name called WikiObject. It also has an internationalizable name and internationalizable description that may be shown to a user.

This EntityType does not inherit from any other EntityType.

The EntityType defines a single PropertyType with identifier org.infogrid.model.Wiki/WikiObject_Content. By convention, all identifiers of PropertyTypes have to start with the identifier of the EntityType in which they are defined, followed by an underscore. The PropertyType has a computer-interpreted name called Content. It also has an internationalizable name and internationalizable description that may be shown to a user.

It further has a BlobDataType as the DataType for values of this Property that accepts text/html as a MIME type. It does not list <isoptional/> and thus null values are not allowed. By default, the value of the Property is <p>(Wiki Object Placeholder)</p>.

This simple example does not show any RelationshipType or many other possible constructs. For other examples, please refer to model.xml files in InfoGrid ModelModules.

See also:

Last modified 4 years ago Last modified on 01/19/10 06:35:22