Skip to main content
Version: 3.0

DataElement 数据元素(草案)

用一组信息描述定义、标识、表示和允许值的数据单元。

结构声明

interface DataElement {
"concept": "DataElement", // 产品概念
"name": string, // 数据元素(草案)名称
"baseType": TypeAnnotation, // 基类型
"description": string, // 数据元素(草案)描述
"rules": Array<string>, // 验证规则
}

示例

Text

{
"concept": "DataElement",
"name": "Text",
"baseType": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "String",
"typeArguments": null,
"inferred": null
},
"description": "长文本",
"rules": [
"maxLength(65535)"
]
}

Email

{
"concept": "DataElement",
"name": "Email",
"baseType": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "String",
"typeArguments": null,
"inferred": null
},
"description": "Email",
"rules": [
"pattern(/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$/i)"
]
}

URL

{
"concept": "DataElement",
"name": "URL",
"baseType": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "String",
"typeArguments": null,
"inferred": null
},
"description": "URL",
"rules": [
"pattern(/^https?:\/\/(([a-zA-Z0-9_-])+(\\.)?)*(:\\d+)?(\/((\\.)?(\\?)?=?&?[a-zA-Z0-9_-](\\?)?)*)*$/i)"
]
}

身份证

{
"concept": "DataElement",
"name": "IDCard",
"baseType": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "String",
"typeArguments": null,
"inferred": null
},
"description": "身份证",
"rules": []
}

数学分数

{
"concept": "DataElement",
"name": "MathScore",
"baseType": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null,
"inferred": null
},
"description": "数学分数",
"rules": [
"min(0)",
"max(160)"
]
}

强密码

{
"concept": "DataElement",
"name": "StrongPassword",
"baseType": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "String",
"typeArguments": null,
"inferred": null
},
"description": "强密码",
"rules": null
}