-
Notifications
You must be signed in to change notification settings - Fork 0
/
definitions.h
107 lines (93 loc) · 4.61 KB
/
definitions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#ifndef DEFINITIONS_H
#define DEFINITIONS_H
#include <string>
#include <unordered_set>
#include <vector>
// Uncomment to enable debug output
// #define DEBUG
// Struct to hold the subjectMap information
struct SubjectMapInfo {
std::string name_triplesMap_node; // Name of parent triplesMap
std::string constant; // constant value of subjectMap
std::string reference; // reference value of subjectMap
std::string template_str; // template of subjectMap
std::string termType; // termType of subjectMap
std::string graph_template; // Used to store subjectMap graph template
std::string graph_constant; // Used to store subjectMap graph constant value
std::string graph_termType; // Used to store subjectMap graph termType
std::string base_uri; // Store the base uri
};
// Struct to hold the predicateMap information
struct PredicateMapInfo {
std::string constant; // constant value of predicateMap
std::string template_str; // template of predicateMap
std::string reference; // reference of predicateMap
};
// Struct to hold the objectMap information
struct ObjectMapInfo {
std::string constant; // constant value of objectMap
std::string base_uri; // base_uri
std::string template_str; // template of objectMap
std::string termType; // termType of objectMap
std::string reference; // reference of objectMap
std::string language; // language tag
std::string parentSource; // source of parent TriplesMap
std::string parent_in_memory_name; // in memory name of parten TriplesMap
std::string parentRef; // Reference formualtion of parent source
std::string parent; // Store parent key
std::string child; // Store child key
std::string dataType; // Stores specified dataType
std::string dataType_child; // Stores specified dataType of child
std::string join_reference_condition_available; // Stores if join can be performed using reference condition
std::string dataType_template; // Template for datatype
};
// Struct to hold the objectMap information
struct PredicateObjectMapInfo {
std::string graph_template; // Used to store subjectMap graph template
std::string graph_constant; // Used to store subjectMap graph constant value
std::string graph_termType; // Used to store subjectMap graph termType
};
// Struct to hold the logicalSourceMap information
struct LogicalSourceInfo {
std::string reference_formulation;
std::string source_path;
std::string logical_iterator;
std::string in_memory_name;
};
// Strcut to hold a generated Triple
struct NTriple {
std::string subject;
std::string predicate;
std::string object;
};
// Strcut to hold a generated Quad
struct NQuad {
std::string subject;
std::string predicate;
std::string object;
std::string graph;
// Comparision is needed for unorderedSet
bool operator==(const NQuad &other) const {
return subject == other.subject && predicate == other.predicate &&
object == other.object && graph == other.graph;
}
};
struct Flags {
std::string mapping_file = ""; // default is an empty string
std::string output_file = "output.nq"; // defualt output path
bool check_duplicates = false; // check for duplicates?
bool threading = false; // use threading?
int thread_count = 0; // number of threads to use
bool adaptive_hash_selection = false; // use adaptive hash selection? or always 128 bit
float sampling_probability = 0.2; // defines the sampling probability used when estimating result size
int fixed_bit_size = 0; // Specife the bit size of the hash function manually, 0 means not fixed
std::unordered_set<std::string> tokens_to_remove; // Hash set of tokens when encountered triple should be skipped
bool in_memory_mapping = false; // Map data completely in memory
std::string output_serialization = "nquad"; // Output RDF serialization
std::string base_uri = ""; // Initialize base uri to resolve relative uris
};
// Starting Number when generating blank nodes
extern int blank_node_counter;
const int THRESHOLD_32BIT = 2073;
const int THRESHOLD_64BIT = 135835773;
#endif