| | 1 | | namespace ValidateLib.UtilityClasses |
| | 2 | | { |
| | 3 | | public class DatatypeUtilityClass |
| | 4 | | { |
| 1 | 5 | | public static Dictionary<string, string> datatypesIdsAndNames = new Dictionary<string, string> |
| 1 | 6 | | { |
| 1 | 7 | | ["anyAtomicType"] = "http://www.w3.org/2001/XMLSchema#", |
| 1 | 8 | | ["any"] = "http://www.w3.org/2001/XMLSchema#", |
| 1 | 9 | | ["anyURI"] = "http://www.w3.org/2001/XMLSchema#anyURI", |
| 1 | 10 | | ["base64Binary"] = "http://www.w3.org/2001/XMLSchema#base64Binary", |
| 1 | 11 | | ["binary"] = "http://www.w3.org/2001/XMLSchema#base64Binary", |
| 1 | 12 | | ["boolean"] = "http://www.w3.org/2001/XMLSchema#boolean", |
| 1 | 13 | | ["byte"] = "http://www.w3.org/2001/XMLSchema#byte", |
| 1 | 14 | | ["date"] = "http://www.w3.org/2001/XMLSchema#date", |
| 1 | 15 | | ["dateTime"] = "http://www.w3.org/2001/XMLSchema#dateTime", |
| 1 | 16 | | ["dateTimeStamp"] = "http://www.w3.org/2001/XMLSchema#dateTimeStamp", |
| 1 | 17 | | ["datetime"] = "http://www.w3.org/2001/XMLSchema#dateTime", |
| 1 | 18 | | ["dayTimeDuration"] = "http://www.w3.org/2001/XMLSchema#dayTimeDuration", |
| 1 | 19 | | ["decimal"] = "http://www.w3.org/2001/XMLSchema#decimal", |
| 1 | 20 | | ["double"] = "http://www.w3.org/2001/XMLSchema#double", |
| 1 | 21 | | ["duration"] = "http://www.w3.org/2001/XMLSchema#duration", |
| 1 | 22 | | ["float"] = "http://www.w3.org/2001/XMLSchema#float", |
| 1 | 23 | | ["gDay"] = "http://www.w3.org/2001/XMLSchema#gDay", |
| 1 | 24 | | ["gMonth"] = "http://www.w3.org/2001/XMLSchema#gMonth", |
| 1 | 25 | | ["gMonthDay"] = "http://www.w3.org/2001/XMLSchema#gMonthDay", |
| 1 | 26 | | ["gYear"] = "http://www.w3.org/2001/XMLSchema#gYear", |
| 1 | 27 | | ["gYearMonth"] = "http://www.w3.org/2001/XMLSchema#gYearMonth", |
| 1 | 28 | | ["hexBinary"] = "http://www.w3.org/2001/XMLSchema#hexBinary", |
| 1 | 29 | | ["html"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML", |
| 1 | 30 | | ["int"] = "http://www.w3.org/2001/XMLSchema#int", |
| 1 | 31 | | ["integer"] = "http://www.w3.org/2001/XMLSchema#integer", |
| 1 | 32 | | ["json"] = "http://www.w3.org/ns/csvw#JSON", |
| 1 | 33 | | ["language"] = "http://www.w3.org/2001/XMLSchema#language", |
| 1 | 34 | | ["long"] = "http://www.w3.org/2001/XMLSchema#long", |
| 1 | 35 | | ["Name"] = "http://www.w3.org/2001/XMLSchema#Name", |
| 1 | 36 | | ["negativeInteger"] = "http://www.w3.org/2001/XMLSchema#negativeInteger", |
| 1 | 37 | | ["NMTOKEN"] = "http://www.w3.org/2001/XMLSchema#NMTOKEN", |
| 1 | 38 | | ["nonNegativeInteger"] = "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", |
| 1 | 39 | | ["nonPositiveInteger"] = "http://www.w3.org/2001/XMLSchema#nonPositiveInteger", |
| 1 | 40 | | ["normalizedString"] = "http://www.w3.org/2001/XMLSchema#normalizedString", |
| 1 | 41 | | ["number"] = "http://www.w3.org/2001/XMLSchema#double", |
| 1 | 42 | | ["positiveInteger"] = "http://www.w3.org/2001/XMLSchema#positiveInteger", |
| 1 | 43 | | ["QName"] = "http://www.w3.org/2001/XMLSchema#QName", |
| 1 | 44 | | ["short"] = "http://www.w3.org/2001/XMLSchema#short", |
| 1 | 45 | | ["string"] = "http://www.w3.org/2001/XMLSchema#string", |
| 1 | 46 | | ["time"] = "http://www.w3.org/2001/XMLSchema#time", |
| 1 | 47 | | ["token"] = "http://www.w3.org/2001/XMLSchema#token", |
| 1 | 48 | | ["unsignedByte"] = "http://www.w3.org/2001/XMLSchema#unsignedByte", |
| 1 | 49 | | ["unsignedInt"] = "http://www.w3.org/2001/XMLSchema#unsignedInt", |
| 1 | 50 | | ["unsignedLong"] = "http://www.w3.org/2001/XMLSchema#unsignedLong", |
| 1 | 51 | | ["unsignedShort"] = "http://www.w3.org/2001/XMLSchema#unsignedShort", |
| 1 | 52 | | ["xml"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral", |
| 1 | 53 | | ["yearMonthDuration"] = "http://www.w3.org/2001/XMLSchema#yearMonthDuration" |
| 1 | 54 | | }; |
| | 55 | |
|
| | 56 | |
|
| 1 | 57 | | public static bool IsIdOfBuiltInType(string id) => datatypesIdsAndNames.ContainsValue(id); |
| | 58 | |
|
| 1 | 59 | | public static bool IsBuiltInType(string type) => datatypesIdsAndNames.ContainsKey(type); |
| | 60 | | } |
| | 61 | | } |