forked from ad-freiburg/qlever
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Constants.h
87 lines (73 loc) · 3.7 KB
/
Constants.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
// Copyright 2015, University of Freiburg,
// Chair of Algorithms and Data Structures.
// Author: Björn Buchhold (buchhold@informatik.uni-freiburg.de)
#pragma once
#include <string>
static const size_t STXXL_MEMORY_TO_USE = 1024L * 1024L * 1024L * 2L;
static const size_t STXXL_DISK_SIZE_INDEX_BUILDER = 1000 * 1000;
static const size_t STXXL_DISK_SIZE_INDEX_TEST = 10;
static const size_t NOF_SUBTREES_TO_CACHE = 1000;
static const size_t MAX_NOF_ROWS_IN_RESULT = 100000;
static const size_t MIN_WORD_PREFIX_SIZE = 4;
static const char PREFIX_CHAR = '*';
static const std::string EXTERNALIZED_LITERALS_PREFIX = std::string({127});
static const size_t MAX_NOF_NODES = 64;
static const size_t MAX_NOF_FILTERS = 64;
static const size_t BUFFER_SIZE_RELATION_SIZE = 1000 * 1000 * 1000;
static const size_t BUFFER_SIZE_DOCSFILE_LINE = 1024 * 1024 * 100;
static const size_t DISTINCT_LHS_PER_BLOCK = 10 * 1000;
static const size_t USE_BLOCKS_INDEX_SIZE_TRESHOLD = 20 * 1000;
static const size_t TEXT_PREDICATE_CARDINALITY_ESTIMATE = 1000 * 1000 * 1000;
static const size_t GALLOP_THRESHOLD = 1000;
static const char CONTAINS_ENTITY_PREDICATE[] =
"<QLever-internal-function/contains-entity>";
static const char CONTAINS_WORD_PREDICATE[] =
"<QLever-internal-function/contains-word>";
static const char CONTAINS_WORD_PREDICATE_NS[] = "ql:contains-word";
static const char INTERNAL_TEXT_MATCH_PREDICATE[] =
"<QLever-internal-function/text>";
static const char HAS_PREDICATE_PREDICATE[] =
"<QLever-internal-function/has-predicate>";
// For anonymous nodes in Turtle.
static const std::string ANON_NODE_PREFIX = "QLever-Anon-Node";
static const std::string URI_PREFIX = "<QLever-internal-function/";
static const std::string LANGUAGE_PREDICATE = URI_PREFIX + "langtag>";
static const char VALUE_PREFIX[] = ":v:";
static const char VALUE_DATE_PREFIX[] = ":v:date:";
static const char VALUE_FLOAT_PREFIX[] = ":v:float:";
static const char XSD_DATETIME_SUFFIX[] =
"^^<http://www.w3.org/2001/XMLSchema#dateTime>";
static const char XSD_INT_SUFFIX[] = "^^<http://www.w3.org/2001/XMLSchema#int>";
static const char XSD_FLOAT_SUFFIX[] =
"^^<http://www.w3.org/2001/XMLSchema#float>";
static const char XSD_DOUBLE_SUFFIX[] =
"^^<http://www.w3.org/2001/XMLSchema#double>";
static const char XSD_DECIMAL_SUFFIX[] =
"^^<http://www.w3.org/2001/XMLSchema#decimal>";
static const char VALUE_DATE_TIME_SEPARATOR[] = "T";
static const int DEFAULT_NOF_VALUE_INTEGER_DIGITS = 50;
static const int DEFAULT_NOF_VALUE_EXPONENT_DIGITS = 20;
static const int DEFAULT_NOF_VALUE_MANTISSA_DIGITS = 30;
static const int DEFAULT_NOF_DATE_YEAR_DIGITS = 19;
static const std::string MMAP_FILE_SUFFIX = ".meta-mmap";
static const std::string CONFIGURATION_FILE = ".meta-data.json";
static const std::string PREFIX_FILE = ".prefixes";
// Constants for the range of valid compression prefixes
// all ASCII- printable characters are left out.
// when adding more special characters to the vocabulary make sure to leave out
// \n since the vocabulary is stored in a text file line by line.
// All prefix codes have a most significant bit of 1. This means the prefix
// codes are never valid UTF-8 and thus it is always able to determine, whether
// this vocabulary was compressed or not.
static constexpr uint8_t MIN_COMPRESSION_PREFIX = 128;
static constexpr uint8_t NUM_COMPRESSION_PREFIXES = 127;
// if this is the first character of a compressed string, this means that no
// compression has been applied to a word
static const uint8_t NO_PREFIX_CHAR =
MIN_COMPRESSION_PREFIX + NUM_COMPRESSION_PREFIXES;
#ifdef _PARALLEL_SORT
static constexpr bool USE_PARALLEL_SORT = true;
#else
static constexpr bool USE_PARALLEL_SORT = false;
#endif
static constexpr size_t NUM_SORT_THREADS = 4;