dasch124 / modeller

a quick and dirty generic data modelling workfow
MIT License
0 stars 0 forks source link

add enums for properties #1

Closed sennierer closed 1 year ago

sennierer commented 1 year ago

there should be the possibility to add an array of possible values to a property

dasch124 commented 1 year ago

up until now I indicated the allowed values as a vocablary in the <vocabularies> section:

<vocabularies>
        <vocab ID="vocabs.courtTypes">
            <name>Court Types</name>
            <values>
                <list>
                    <item>Hof</item>
                    <item>Klosterhof</item>
                    <item>Kaiserhof</item>
                    <item>Königshof</item>
                    <item>Bischöflicher Hof</item>
                    <item>Kurfürstlicher Hof</item>
                    <item>Erzbischöflicher Hof</item>
                    <item>Königlicher Hof</item>
                    <item>Kaiserlicher Hof</item>
                </list>
            </values>
        </vocab>
    </vocabularies>

… and then indicated the constraint on the datatype of the respective property:

<property ID="court.type">
       <arity>1</arity>
       <name>Typ</name>
       <datatypeName target="choiceField" vocabRef="vocabs.courtTypes"/>
       <note>Art des Hofes</note>
</property>
sennierer commented 1 year ago

ah, yes, thats a good choice