GetInstancePropertyCardinalityRestriction (inline)

...

Syntax

//
//   Strong typing definition
//

static  inline  void    GetInstancePropertyCardinalityRestriction(
                                OwlInstance             owlInstance,
                                RdfProperty             rdfProperty,
                                int64_t                 * minCard,
                                int64_t                 * maxCard
                            )
{
    OwlClass    owlClass = GetInstanceClassByIterator(owlInstance, 0);

    GetClassPropertyCardinalityRestriction(
            owlClass,
            rdfProperty,
            minCard,
            maxCard
        );

    while ( (owlClass = GetInstanceClassByIterator(owlInstance, owlClass)) ) {
        int64_t myMinCard = -1,
                myMaxCard = -1;

        GetClassPropertyCardinalityRestriction(
                owlClass,
                rdfProperty,
                &myMinCard,
                &myMaxCard
            );

        if ((*minCard) < myMinCard)
            (*minCard) = myMinCard;

        if (myMaxCard >= 0 &&
            ((*maxCard) == -1 || (*maxCard) > myMaxCard))
            (*maxCard) = myMaxCard;
    }
}


//
//   Weak typing definition
//

static  inline  void    GetInstancePropertyCardinalityRestriction(
                                int64_t                 owlInstance,
                                int64_t                 rdfProperty,
                                int64_t                 * minCard,
                                int64_t                 * maxCard
                            )
{
    OwlClass    owlClass = GetInstanceClassByIterator(owlInstance, 0);

    GetClassPropertyCardinalityRestriction(
            owlClass,
            rdfProperty,
            minCard,
            maxCard
        );

    while ( (owlClass = GetInstanceClassByIterator(owlInstance, owlClass)) ) {
        int64_t myMinCard = -1,
                myMaxCard = -1;

        GetClassPropertyCardinalityRestriction(
                owlClass,
                rdfProperty,
                &myMinCard,
                &myMaxCard
            );

        if ((*minCard) < myMinCard)
            (*minCard) = myMinCard;

        if (myMaxCard >= 0 &&
            ((*maxCard) == -1 || (*maxCard) > myMaxCard))
            (*maxCard) = myMaxCard;
    }
}
    

Property owlInstance

Size: 64 bit / 8 byte (value)
The handle to the specific instance in the design tree. The instance handle is static within one open model but is most probably different when the same instance is opened in another model. The instance is always exactly of one unique class.

Property rdfProperty

Size: 64 bit / 8 byte (value)
This attribute represents a handle to the property, this can be either a datatype property (attribute), an object property (relation) or non-defined property. The handle will be static during the life-time of the model, when the model (or part of it) is saved and opened again, the handle will most probably be different.

Property minCard

Size: 32 bit / 4 byte (reference)
The minimum cardinality (i.e. number of elements) of this property.

Property maxCard

Size: 32 bit / 4 byte (reference)
The maximum cardinality (i.e. number of elements) of this property.