Skip to content

Commit

Permalink
Code for locating triples in an existing index
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Hannah Bast committed Jun 9, 2023
1 parent df93d56 commit 84a4bdf
Show file tree
Hide file tree
Showing 9 changed files with 789 additions and 22 deletions.
18 changes: 18 additions & 0 deletions src/global/IdTriple.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2023, University of Freiburg
// Chair of Algorithms and Data Structures
// Authors: Hannah Bast <[email protected]>

#pragma once

#include <array>

#include "global/Id.h"

// Should we have an own class for this? We need this at several places.
using IdTriple = std::array<Id, 3>;

// Hash value for such triple.
template <typename H>
H AbslHashValue(H h, const IdTriple& triple) {
return H::combine(std::move(h), triple[0], triple[1], triple[2]);
}
1 change: 1 addition & 0 deletions src/index/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ add_library(index
VocabularyOnDisk.h VocabularyOnDisk.cpp
IndexMetaData.h IndexMetaDataImpl.h
MetaDataHandler.h
LocatedTriples.h LocatedTriples.cpp
StxxlSortFunctors.h
TextMetaData.cpp TextMetaData.h
DocsDB.cpp DocsDB.h
Expand Down
1 change: 1 addition & 0 deletions src/index/CompressedRelation.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ class CompressedRelationReader {
static void decompressColumn(const std::vector<char>& compressedColumn,
size_t numRowsToRead, Iterator iterator);

public:
// Read the block that is identified by the `blockMetaData` from the `file`,
// decompress and return it.
// If `columnIndices` is `nullopt`, then all columns of the block are read,
Expand Down
20 changes: 12 additions & 8 deletions src/index/IndexMetaData.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2015, University of Freiburg,
// Chair of Algorithms and Data Structures.
// Author: Björn Buchhold ([email protected])

#pragma once

#include <stdio.h>
Expand All @@ -13,14 +14,14 @@
#include <utility>
#include <vector>

#include "../global/Id.h"
#include "../util/File.h"
#include "../util/HashMap.h"
#include "../util/MmapVector.h"
#include "../util/ReadableNumberFact.h"
#include "../util/Serializer/Serializer.h"
#include "./MetaDataHandler.h"
#include "CompressedRelation.h"
#include "global/Id.h"
#include "index/CompressedRelation.h"
#include "index/MetaDataHandler.h"
#include "util/File.h"
#include "util/HashMap.h"
#include "util/MmapVector.h"
#include "util/ReadableNumberFact.h"
#include "util/Serializer/Serializer.h"

using std::array;
using std::pair;
Expand Down Expand Up @@ -86,7 +87,10 @@ class IndexMetaData {
// name and the variable name are terrible.

// For each relation, its meta data.
public:
MapType _data;

private:
// For each compressed block, its meta data.
BlocksType _blockData;

Expand Down
Loading

0 comments on commit 84a4bdf

Please sign in to comment.