Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
# Conflicts:
#	CMakeLists.txt
#	Dockerfile
#	conanfile.txt
#	src/exec/TentrisTerminal.cpp
#	src/lib/tentris/http/SparqlEndpoint.hpp
#	src/lib/tentris/store/QueryExecutionPackage.hpp
#	src/lib/tentris/store/SPARQL/ParsedSPARQL.hpp
  • Loading branch information
bigerl committed Aug 29, 2023
2 parents 8a76366 + 9ff31e2 commit 627bb8f
Show file tree
Hide file tree
Showing 7 changed files with 459 additions and 25 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.13)
project(tentris
LANGUAGES CXX
VERSION 1.1.0)
VERSION 1.1.2)
set(CMAKE_CXX_STANDARD 20)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/tentris/tentris_version.hpp)
Expand Down Expand Up @@ -72,7 +72,7 @@ target_include_directories(rapidjson INTERFACE
find_package(tsl-hopscotch-map REQUIRED)
find_package(fmt REQUIRED)
find_package(hypertrie REQUIRED)
find_package(sparql-parser REQUIRED)
find_package(sparql-parser-base REQUIRED)
find_package(rdf-parser REQUIRED)
if (TENTRIS_STATIC)
SET(Boost_USE_STATIC_LIBS ON)
Expand Down Expand Up @@ -103,8 +103,8 @@ target_link_libraries(tentris
stdc++fs # for #include <filesystem>
cxxopts
rapidjson
sparql-parser-base::sparql-parser-base
tsl::hopscotch_map
sparql-parser::sparql-parser
fmt::fmt
hypertrie::hypertrie
rdf-parser::rdf-parser
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM ubuntu:groovy AS builder
FROM ubuntu:22.04 AS builder
ARG DEBIAN_FRONTEND=noninteractive
ARG TENTRIS_MARCH="x86-64"

RUN apt-get -qq update && \
apt-get -qq install -y make cmake uuid-dev git openjdk-11-jdk python3-pip python3-setuptools python3-wheel libstdc++-10-dev clang-11 g++-10 pkg-config lld autoconf libtool
RUN rm /usr/bin/ld && ln -s /usr/bin/lld-11 /usr/bin/ld
ARG CXX="clang++-11"
ARG CC="clang-11"
apt-get -qq install -y make cmake uuid-dev git openjdk-11-jdk python3-pip python3-setuptools python3-wheel libstdc++-11-dev clang-14 g++-11 pkg-config lld autoconf libtool
RUN rm /usr/bin/ld && ln -s /usr/bin/lld-14 /usr/bin/ld
ARG CXX="clang++-14"
ARG CC="clang-14"
ENV CXXFLAGS="${CXXFLAGS} -march=${TENTRIS_MARCH}"
ENV CMAKE_EXE_LINKER_FLAGS="-L/usr/local/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib"

# Compile more recent tcmalloc-minimal with clang-11 + -march
# Compile more recent tcmalloc-minimal with clang-14 + -march
RUN git clone --quiet --branch gperftools-2.8.1 https://github.com/gperftools/gperftools
WORKDIR /gperftools
RUN ./autogen.sh
Expand Down
7 changes: 4 additions & 3 deletions conanfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
boost/1.75.0
fmt/7.1.3
restinio/0.6.12
hypertrie/0.6.0@dice-group/rc15
rdf-parser/0.13.1@dice-group/stable
sparql-parser/0.3.0@dice-group/rc2
hypertrie/0.6.1@dice-group/stable
rdf-parser/0.13.0@dice-group/stable
sparql-parser-base/0.2.2@dice-group/stable

[options]
restinio:asio=boost
restinio:with_zlib=True
boost:shared=False
*:shared=False
sparql-parser-base:sparql_version=1.0


[generators]
Expand Down
2 changes: 1 addition & 1 deletion src/exec/TentrisTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
using namespace tentris::store;
using namespace tentris::logging;
using namespace tentris::store::cache;
using namespace tentris::store::sparql;
using namespace std::filesystem;
using namespace iter;
using namespace tentris::tensor;
using namespace std::chrono;

using Variable = Dice::sparql::Variable;
using SelectModifier = Dice::sparql::Nodes::QueryNodes::SelectNodes::SelectModifier;

TerminalConfig cfg;

Expand Down
3 changes: 2 additions & 1 deletion src/lib/tentris/http/SparqlEndpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <restinio/all.hpp>

#include "tentris/http/QueryResultState.hpp"
#include "tentris/store/SPARQL/ParsedSPARQL.hpp"
#include "tentris/store/AtomicQueryExecutionPackageCache.hpp"
#include "tentris/store/SparqlJsonResultSAXWriter.hpp"
#include "tentris/store/AtomicTripleStore.hpp"
Expand All @@ -28,7 +29,7 @@ namespace tentris::http {

using namespace ::tentris::logging;
using namespace ::tentris::store;
using SelectModifier = Dice::sparql::Nodes::QueryNodes::SelectNodes::SelectModifier;
using namespace ::tentris::store::sparql;
using namespace ::tentris::tensor;

using namespace std::string_literals;
Expand Down
20 changes: 9 additions & 11 deletions src/lib/tentris/store/QueryExecutionPackage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@

#include "tentris/store/RDF/TermStore.hpp"
#include "tentris/store/AtomicTripleStore.hpp"
#include "tentris/store/SPARQL/ParsedSPARQL.hpp"
#include "tentris/tensor/BoolHypertrie.hpp"

#include <Dice/sparql-parser/Parser.hpp>
#include <Dice/sparql-query/Nodes/QueryNodes/SelectNodes/SelectNode.hpp>

namespace tentris::store {
class TripleStore;
};
Expand All @@ -25,10 +23,10 @@ namespace tentris::store::cache {
struct QueryExecutionPackage {
using const_BoolHypertrie = ::tentris::tensor::const_BoolHypertrie;
using time_point_t = logging::time_point_t;
using SelectModifier = Dice::sparql::Nodes::QueryNodes::SelectNodes::SelectModifier;
using SelectModifier = sparql::SelectModifier;
using Variable = Dice::sparql::Variable;
using ParsedSPARQL = sparql::ParsedSPARQL;
using Subscript = ::tentris::tensor::Subscript;
using SelectNode= Dice::sparql::Nodes::QueryNodes::SelectNodes::SelectNode;

private:
std::string sparql_string;
Expand Down Expand Up @@ -61,18 +59,18 @@ namespace tentris::store::cache {
explicit QueryExecutionPackage(const std::string &sparql_string) : sparql_string{sparql_string} {
using namespace logging;
logDebug(fmt::format("Parsing query: {}", sparql_string));
std::shared_ptr<SelectNode> selectNode= Dice::sparql_parser::parseSelectQuery(sparql_string);
subscript = std::make_shared<Subscript>( selectNode->getOperands(), selectNode->getSubscriptResult());
select_modifier =selectNode->getSelectModifier();
ParsedSPARQL parsed_sparql{sparql_string};
subscript = parsed_sparql.getSubscript();
select_modifier = parsed_sparql.getSelectModifier();
logDebug(fmt::format("Parsed subscript: {} [distinct = {}]",
subscript,
select_modifier == SelectModifier::DISTINCT));
query_variables = selectNode->getSelectVariables();
query_variables = parsed_sparql.getQueryVariables();

auto &triple_store = AtomicTripleStore::getInstance();

logDebug(fmt::format("Slicing TPs"));
for ([[maybe_unused]] const auto &[op_pos, tp]: iter::enumerate(selectNode->getBgps())) {
for ([[maybe_unused]] const auto &[op_pos, tp]: iter::enumerate(parsed_sparql.getBgps())) {
logDebug(fmt::format("Slice key {}: ⟨{}⟩", op_pos, fmt::join(tp, ", ")));
std::variant<const_BoolHypertrie, bool> op = triple_store.resolveTriplePattern(tp);
if (std::holds_alternative<bool>(op)) {
Expand Down Expand Up @@ -150,7 +148,7 @@ struct fmt::formatter<tentris::store::cache::QueryExecutionPackage> {

template<typename FormatContext>
auto format(const tentris::store::cache::QueryExecutionPackage &p, FormatContext &ctx) {
using SelectModifier = Dice::sparql::Nodes::QueryNodes::SelectNodes::SelectModifier;
using SelectModifier = tentris::store::sparql::SelectModifier;
return format_to(ctx.begin(),
" SPARQL: {}\n"
" subscript: {}\n"
Expand Down
Loading

0 comments on commit 627bb8f

Please sign in to comment.