Skip to content

Commit 84a4bdf

Browse files
author
Hannah Bast
committed
Code for locating triples in an existing index
This is the first part of a series of PRs split of from the large proof-of-concept PR #916, which realizes SPARQL 1.1 Update
1 parent df93d56 commit 84a4bdf

File tree

9 files changed

+789
-22
lines changed

9 files changed

+789
-22
lines changed

src/global/IdTriple.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2023, University of Freiburg
2+
// Chair of Algorithms and Data Structures
3+
// Authors: Hannah Bast <bast@cs.uni-freiburg.de>
4+
5+
#pragma once
6+
7+
#include <array>
8+
9+
#include "global/Id.h"
10+
11+
// Should we have an own class for this? We need this at several places.
12+
using IdTriple = std::array<Id, 3>;
13+
14+
// Hash value for such triple.
15+
template <typename H>
16+
H AbslHashValue(H h, const IdTriple& triple) {
17+
return H::combine(std::move(h), triple[0], triple[1], triple[2]);
18+
}

src/index/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ add_library(index
88
VocabularyOnDisk.h VocabularyOnDisk.cpp
99
IndexMetaData.h IndexMetaDataImpl.h
1010
MetaDataHandler.h
11+
LocatedTriples.h LocatedTriples.cpp
1112
StxxlSortFunctors.h
1213
TextMetaData.cpp TextMetaData.h
1314
DocsDB.cpp DocsDB.h

src/index/CompressedRelation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ class CompressedRelationReader {
305305
static void decompressColumn(const std::vector<char>& compressedColumn,
306306
size_t numRowsToRead, Iterator iterator);
307307

308+
public:
308309
// Read the block that is identified by the `blockMetaData` from the `file`,
309310
// decompress and return it.
310311
// If `columnIndices` is `nullopt`, then all columns of the block are read,

src/index/IndexMetaData.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright 2015, University of Freiburg,
22
// Chair of Algorithms and Data Structures.
33
// Author: Björn Buchhold (buchhold@informatik.uni-freiburg.de)
4+
45
#pragma once
56

67
#include <stdio.h>
@@ -13,14 +14,14 @@
1314
#include <utility>
1415
#include <vector>
1516

16-
#include "../global/Id.h"
17-
#include "../util/File.h"
18-
#include "../util/HashMap.h"
19-
#include "../util/MmapVector.h"
20-
#include "../util/ReadableNumberFact.h"
21-
#include "../util/Serializer/Serializer.h"
22-
#include "./MetaDataHandler.h"
23-
#include "CompressedRelation.h"
17+
#include "global/Id.h"
18+
#include "index/CompressedRelation.h"
19+
#include "index/MetaDataHandler.h"
20+
#include "util/File.h"
21+
#include "util/HashMap.h"
22+
#include "util/MmapVector.h"
23+
#include "util/ReadableNumberFact.h"
24+
#include "util/Serializer/Serializer.h"
2425

2526
using std::array;
2627
using std::pair;
@@ -86,7 +87,10 @@ class IndexMetaData {
8687
// name and the variable name are terrible.
8788

8889
// For each relation, its meta data.
90+
public:
8991
MapType _data;
92+
93+
private:
9094
// For each compressed block, its meta data.
9195
BlocksType _blockData;
9296

0 commit comments

Comments
 (0)