public object Visit(CogniPy.CNL.DL.HasKey e) { StringBuilder sb = new StringBuilder(); sb.Append(e.C.accept(this)); sb.Append("○⊑"); if (e.Roles.Count > 0) { using (isKindOf.set(EntityKind.Role)) { sb.Append("("); bool first = true; foreach (var x in e.Roles) { if (first) { first = false; } else { sb.Append(","); } sb.Append(x.accept(this)); } sb.Append(")"); } } if (e.DataRoles.Count > 0) { sb.Append("⊓"); using (isKindOf.set(EntityKind.DataRole)) { sb.Append("("); bool first = true; foreach (var x in e.DataRoles) { if (first) { first = false; } else { sb.Append(","); } sb.Append(x.accept(this)); } sb.Append(")"); } } return(sb.ToString()); }
public virtual object Visit(CogniPy.CNL.DL.HasKey e) { using (isKindOf.set("D")) { for (int i = 0; i < e.DataRoles.Count; i++) { e.DataRoles[i].accept(this); } } using (isKindOf.set("R")) { for (int i = 0; i < e.Roles.Count; i++) { e.Roles[i].accept(this); } } e.C.accept(this); return(e); }