private object HandleConceptOrExpressionSlotInAttributeValue(
            TemplateInformationSlot infoSlot,
            ConceptReference attrName,
            OneOf <ConceptReplacementSlot, ExpressionReplacementSlot> valueSlot,
            IDictionary <string, TemplateData.Item> itemData,
            string lang
            )
        {
            var(attrTitle, attrDesc) = GetConceptOrSlotTitleAndDesc(infoSlot, attrName, itemData, lang);
            var result = new Dictionary <string, object>
            {
                ["attribute"] = attrName.SctId
            };

            result["title"] = attrTitle ?? throw new Exception($"No title specified for {attrName.SctId}");
            if (attrDesc != null)
            {
                result["description"] = attrDesc;
            }
            result["cardinality"] = new
            {
                min = infoSlot?.Cardinality?.MinCardinality ?? 1,
                max = infoSlot?.Cardinality?.MaxCardinality
            };
            result["value"] = GetConceptSlotJson(valueSlot.Handle(c => c.ExpressionConstraint, e => e.ExpressionConstraint));
            return(result);
        }
Exemple #2
0
 public Attribute(ConceptReference concept, IAttributeValue value)
 {
     Name  = new AttributeName(concept);
     Value = value;
 }
Exemple #3
0
 public FocusConcept(ConceptReference concept) : base(concept)
 {
 }
Exemple #4
0
 protected ConceptReference(ConceptReference concept)
 {
     SctId = concept.SctId;
     Term  = concept.Term;
 }
 public AttributeName(ConceptReference concept) : base(concept)
 {
 }