Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
Go to the documentation of this file.
8 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_FRICTIONLESS_DATA_UTIL_H_
9 #define SERVICES_FIELD_TRIALS_INCLUDE_FRICTIONLESS_DATA_UTIL_H_
14 #include "bson/bson.h"
17 #ifndef DOXYGEN_SHOULD_SKIP_THIS
20 #ifdef ALLOCATE_FD_UTIL_TAGS
21 #define FD_UTIL_PREFIX GRASSROOTS_FRICTIONLESS_DATA_API
22 #define FD_UTIL_VAL(x) = x
24 #define FD_UTIL_PREFIX extern GRASSROOTS_FRICTIONLESS_DATA_API
25 #define FD_UTIL_VAL(x)
33 FD_UTIL_PREFIX
const char *
const FD_PROFILE_S
FD_UTIL_VAL (
"profile");
34 FD_UTIL_PREFIX
const char *
const FD_PROFILE_DATA_PACKAGE_S
FD_UTIL_VAL (
"data-package");
35 FD_UTIL_PREFIX
const char *
const FD_PROFILE_TABULAR_PACKAGE_S
FD_UTIL_VAL (
"tabular-data-package");
36 FD_UTIL_PREFIX
const char *
const FD_PROFILE_TABULAR_RESOURCE_S
FD_UTIL_VAL (
"tabular-data-resource");
37 FD_UTIL_PREFIX
const char *
const FD_PROFILE_PROPERTY_ORDER_S
FD_UTIL_VAL (
"propertyOrder");
38 FD_UTIL_PREFIX
const char *
const FD_NAME_S
FD_UTIL_VAL (
"name");
39 FD_UTIL_PREFIX
const char *
const FD_TITLE_S
FD_UTIL_VAL (
"title");
40 FD_UTIL_PREFIX
const char *
const FD_ID_S
FD_UTIL_VAL (
"id");
41 FD_UTIL_PREFIX
const char *
const FD_LICENSES_S
FD_UTIL_VAL (
"licenses");
42 FD_UTIL_PREFIX
const char *
const FD_DESCRIPTION_S
FD_UTIL_VAL (
"description");
43 FD_UTIL_PREFIX
const char *
const FD_URL_S
FD_UTIL_VAL (
"homepage");
44 FD_UTIL_PREFIX
const char *
const FD_RESOURCES_S
FD_UTIL_VAL (
"resources");
47 FD_UTIL_PREFIX
const char *
const FD_SCHEMA_S
FD_UTIL_VAL (
"schema");
49 FD_UTIL_PREFIX
const char *
const FD_TABLE_FIELDS_S
FD_UTIL_VAL (
"fields");
51 FD_UTIL_PREFIX
const char *
const FD_DATA_S
FD_UTIL_VAL (
"data");
54 FD_UTIL_PREFIX
const char *
const FD_ITEMS_S
FD_UTIL_VAL (
"items");
55 FD_UTIL_PREFIX
const char *
const FD_REF_S
FD_UTIL_VAL (
"$ref");
61 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_NAME
FD_UTIL_VAL (
"name");
63 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_TITLE
FD_UTIL_VAL (
"title");
65 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_TYPE
FD_UTIL_VAL (
"type");
67 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_FORMAT
FD_UTIL_VAL (
"format");
69 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_DESCRIPTION
FD_UTIL_VAL (
"description");
71 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_CONSTRAINTS
FD_UTIL_VAL (
"constraints");
73 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_RDF_TYPE
FD_UTIL_VAL (
"rdfType");
75 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_NULL_VALUE
FD_UTIL_VAL (
"missingValues");
82 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_CONSTRAINT_REQUIRED
FD_UTIL_VAL (
"required");
84 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_CONSTRAINT_UNIQUE
FD_UTIL_VAL (
"unique");
86 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_CONSTRAINT_MIN_LENGTH
FD_UTIL_VAL (
"minLength");
88 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_CONSTRAINT_MAX_LENGTH
FD_UTIL_VAL (
"maxLength");
90 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_CONSTRAINT_MIN
FD_UTIL_VAL (
"minimum");
92 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_CONSTRAINT_MAX
FD_UTIL_VAL (
"maximum");
94 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_CONSTRAINT_PATTERN
FD_UTIL_VAL (
"pattern");
96 FD_UTIL_PREFIX
const char *FD_TABLE_FIELD_CONSTRAINT_ENUM
FD_UTIL_VAL (
"enum");
102 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT
FD_UTIL_VAL (
"dialect");
108 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT_DELIMITER
FD_UTIL_VAL (
"delimiter");
113 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT_LINE_TERMINATOR
FD_UTIL_VAL (
"lineTerminator");
118 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT_QUOTE_CHAR
FD_UTIL_VAL (
"quoteChar");
124 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT_DOUBLE_QUOTE
FD_UTIL_VAL (
"doubleQuote");
130 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT_ESCAPE_CHAR
FD_UTIL_VAL (
"escapeChar");
135 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT_NULL_VALUE
FD_UTIL_VAL (
"nullSequence");
142 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT_SKIP_INITIAL_SPACE
FD_UTIL_VAL (
"skipInitialSpace");
148 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT_HEADER_ROW
FD_UTIL_VAL (
"header");
153 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT_COMMENT_CHAR
FD_UTIL_VAL (
"commentChar");
159 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT_CASE_SENSITIVE_HEADER
FD_UTIL_VAL (
"caseSensitiveHeader");
165 FD_UTIL_PREFIX
const char *FD_CSV_DIALECT_VERSION
FD_UTIL_VAL (
"csvddfVersion");
173 FD_UTIL_PREFIX
const char *FD_TYPE_STRING
FD_UTIL_VAL (
"string");
176 FD_UTIL_PREFIX
const char *FD_TYPE_STRING_FORMAT_DEFAULT
FD_UTIL_VAL (
"default");
179 FD_UTIL_PREFIX
const char *FD_TYPE_STRING_FORMAT_EMAIL
FD_UTIL_VAL (
"email");
182 FD_UTIL_PREFIX
const char *FD_TYPE_STRING_FORMAT_URI
FD_UTIL_VAL (
"uri");
185 FD_UTIL_PREFIX
const char *FD_TYPE_STRING_FORMAT_BINARY
FD_UTIL_VAL (
"binary");
188 FD_UTIL_PREFIX
const char *FD_TYPE_STRING_FORMAT_UUID
FD_UTIL_VAL (
"uuid");
193 FD_UTIL_PREFIX
const char *FD_TYPE_NUMBER
FD_UTIL_VAL (
"number");
202 FD_UTIL_PREFIX
const char *FD_TYPE_INTEGER
FD_UTIL_VAL (
"integer");
206 FD_UTIL_PREFIX
const char *FD_TYPE_BOOLEAN
FD_UTIL_VAL (
"boolean");
212 FD_UTIL_PREFIX
const char *FD_TYPE_DATE
FD_UTIL_VAL (
"date");
218 FD_UTIL_PREFIX
const char *FD_TYPE_TIME
FD_UTIL_VAL (
"time");
224 FD_UTIL_PREFIX
const char *FD_TYPE_DATETIME
FD_UTIL_VAL (
"datetime");
230 FD_UTIL_PREFIX
const char *FD_TYPE_GEOJSON
FD_UTIL_VAL (
"geojson");
235 FD_UTIL_PREFIX
const char *FD_TYPE_JSON_OBJECT
FD_UTIL_VAL (
"object");
239 FD_UTIL_PREFIX
const char *FD_TYPE_JSON_ARRAY
FD_UTIL_VAL (
"array");
264 const char *null_seqeunce_s,
const bool has_header_row_flag,
const bool case_sensitive_header_flag,
265 const bool double_quote_flag,
const bool skip_initial_space_flag,
const char *quote_p,
266 const uint32 major_version,
const uint32 minor_version);
GRASSROOTS_FRICTIONLESS_DATA_API bool SetTableFieldMaximumInteger(json_t *field_p, const json_int_t value)
GRASSROOTS_FRICTIONLESS_DATA_API json_t * AddTableField(json_t *fields_p, const char *name_s, const char *title_s, const char *type_s, const char *format_s, const char *description_s, const char *rdf_type_s)
GRASSROOTS_FRICTIONLESS_DATA_API json_t * AddNumberField(json_t *fields_p, const char *name_s, const char *title_s, const char *format_s, const char *description_s, const char *rdf_type_s, const double *min_value_p)
GRASSROOTS_FRICTIONLESS_DATA_API bool SetTableFieldUnique(json_t *field_p)
const GRASSROOTS_FRICTIONLESS_DATA_API char * GetRefSchemaURI(const json_t *field_p)
GRASSROOTS_FRICTIONLESS_DATA_API bool SetFDTableString(json_t *row_p, const char *const key_s, const char *const value_s, const char *const null_sequence_s)
GRASSROOTS_FRICTIONLESS_DATA_API bool SetTableFieldMinimumInteger(json_t *field_p, const json_int_t value)
GRASSROOTS_FRICTIONLESS_DATA_API bool SetTableFieldEnum(json_t *field_p, json_t *enum_p)
GRASSROOTS_FRICTIONLESS_DATA_API bool SetTableFieldRequired(json_t *field_p)
GRASSROOTS_FRICTIONLESS_DATA_API bool SetTableFieldMinimumNumber(json_t *field_p, const double value)
GRASSROOTS_FRICTIONLESS_DATA_API bool SetTableFieldMaximumNumber(json_t *field_p, const double value)
GRASSROOTS_FRICTIONLESS_DATA_API bool SetTableFieldPattern(json_t *field_p, const char *const pattern_s)
GRASSROOTS_FRICTIONLESS_DATA_API json_t * GetCSVDialect(const char *delimter_s, const char *line_terminator_s, const char *comment_char_p, const char *escape_char_p, const char *null_seqeunce_s, const bool has_header_row_flag, const bool case_sensitive_header_flag, const bool double_quote_flag, const bool skip_initial_space_flag, const char *quote_p, const uint32 major_version, const uint32 minor_version)
GRASSROOTS_FRICTIONLESS_DATA_API json_t * GetDataPackage(const char *name_s, const char *description_s, const char *id_s)
GRASSROOTS_FRICTIONLESS_DATA_API json_t * AddIntegerField(json_t *fields_p, const char *name_s, const char *title_s, const char *format_s, const char *description_s, const char *rdf_type_s, const int *min_value_p)
#define GRASSROOTS_FRICTIONLESS_DATA_API
Definition: grassroots_frictionless_data_library.h:47
const FD_UTIL_PREFIX char *const FD_PROFILE_S FD_UTIL_VAL("profile")
GRASSROOTS_FRICTIONLESS_DATA_API bool SetFDTableReal(json_t *row_p, const char *const key_s, const double64 *value_p, const char *const null_sequence_s)