Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
darroyue committed Oct 3, 2021
1 parent 24d9839 commit 5ee16aa
Show file tree
Hide file tree
Showing 31 changed files with 13,601 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
g++ -fpermissive -O9 -msse4.2 -std=c++11 -DNODEBUG -I ~/include -L ~/lib src/nfa/src/bitmasks.c src/nfa/src/options.c src/nfa/src/parser.c src/nfa/src/regular.c src/build-index.cpp -o build-index -lsdsl -ldivsufsort -ldivsufsort64

g++ -fpermissive -Ofast -msse4.2 -frename-registers -std=c++11 -DNODEBUG -I ~/include -L ~/lib src/nfa/src/bitmasks.c src/nfa/src/options.c src/nfa/src/parser.c src/nfa/src/regular.c src/query-index.cpp -o query-index -lsdsl -ldivsufsort -ldivsufsort64


2,110 changes: 2,110 additions & 0 deletions data/paths.tsv

Large diffs are not rendered by default.

5,419 changes: 5,419 additions & 0 deletions data/wikidata-unsorted-enumerated.dat.P

Large diffs are not rendered by default.

1,637 changes: 1,637 additions & 0 deletions data/wikidata-unsorted-enumerated.dat.SO

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions src/Config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Config.hpp
* Copyright (C) 2020 Author removed for double-blind evaluation
*
* This is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CONFIG_BWT
#define CONFIG_BWT

#include <set>
#include <map>
#include <tuple>
#include <vector>

#include <sdsl/suffix_arrays.hpp>
#include <sdsl/vectors.hpp>
#include <sdsl/bit_vectors.hpp>
#include <sdsl/wavelet_trees.hpp>
#include <sdsl/wt_algorithm.hpp>
#include <sdsl/init_array.hpp>

using namespace sdsl;
using namespace std;

typedef std::tuple<uint32_t, uint32_t, uint32_t> spo_triple;
//typedef sdsl::wm_int<bit_vector, rank_support_v<>, select_support_mcl<>, select_support_mcl<>> bwt_type;
typedef sdsl::wm_int<bit_vector> bwt_type;

typedef sdsl::bit_vector C_type;
typedef sdsl::rank_support_v<> C_rank_type;
typedef sdsl::select_support_mcl<> C_select_type;
typedef sdsl::select_support_mcl<0> C_select0_type;

#endif
Binary file added src/RPQ.tar
Binary file not shown.
Binary file added src/build-index
Binary file not shown.
53 changes: 53 additions & 0 deletions src/build-index.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include <iostream>
#include "triple_bwt.hpp"
#include <fstream>
#include <sdsl/construct.hpp>

using namespace std;

using namespace std::chrono;
using timer = std::chrono::high_resolution_clock;


int main(int argc, char **argv)
{

vector<spo_triple> D, E;

std::ifstream ifs(argv[1]);
uint64_t s, p , o;
//set<spo_triple> S;
do {
ifs >> s >> p >> o;
//S.insert(spo_triple(s, p, o));
D.push_back(spo_triple(s, p, o));
} while (!ifs.eof());

//for (set<spo_triple>::iterator it=S.begin(); it!=S.end(); it++)
// D.push_back(*it);

//S.clear();

if (D[D.size()-1] == D[D.size()-2])
D.pop_back();

D.shrink_to_fit();

uint64_t input_size = D.size();

cout << "--Indexing " << D.size() << " triples" << endl;
memory_monitor::start();
auto start = timer::now();

ring_rpq A(D);
auto stop = timer::now();
memory_monitor::stop();
cout << " Index built " << (float)A.size()/input_size << " bytes per triple" << endl;

A.save(string(argv[1]));
cout << "Index saved" << endl;
cout << duration_cast<seconds>(stop-start).count() << " seconds." << endl;
// cout << memory_monitor::peak() << " bytes." << endl;
return 0;
}

Loading

0 comments on commit 5ee16aa

Please sign in to comment.