-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from weso/several-stores-get-predicate-and-opt…
…imizations All test work and I have checked the new project structure
- Loading branch information
Showing
35 changed files
with
1,763 additions
and
710 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ benches/*/*.nt | |
!resources/root.zarr | ||
.vscode | ||
heaptrack.* | ||
tests/out | ||
tests/out | ||
uniprotkb_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
use remote_hdt::engine::EngineStrategy; | ||
use remote_hdt::storage::matrix::MatrixLayout; | ||
use remote_hdt::storage::HTTPStorage; | ||
use remote_hdt::error::RemoteHDTError; | ||
use remote_hdt::storage::layout::matrix::MatrixLayout; | ||
use remote_hdt::storage::ops::Ops; | ||
use remote_hdt::storage::params::{Backend, Serialization}; | ||
use remote_hdt::storage::Storage; | ||
use std::time::Instant; | ||
|
||
fn main() { | ||
let mut remote_hdt = HTTPStorage::new(MatrixLayout); | ||
let arr = remote_hdt | ||
.connect("https://raw.githubusercontent.com/weso/RemoteHDT/master/resources/root.zarr") | ||
.unwrap(); | ||
let index = remote_hdt | ||
.get_dictionary() | ||
.get_subject_idx_unchecked("<http://example.org/alan>"); | ||
fn main() -> Result<(), RemoteHDTError> { | ||
let mut binding = Storage::new(MatrixLayout, Serialization::Zarr); | ||
let arr = binding.load(Backend::HTTP( | ||
"https://raw.githubusercontent.com/weso/RemoteHDT/master/resources/root.zarr", | ||
))?; | ||
|
||
let before = Instant::now(); | ||
arr.get_subject(index).unwrap(); | ||
let after = before.elapsed(); | ||
arr.get_subject("<http://example.org/alan>")?; | ||
|
||
println!("Elapsed time: {:.2?}", after) | ||
println!("Elapsed time: {:.2?}", before.elapsed()); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
use remote_hdt::storage::tabular::TabularLayout; | ||
use remote_hdt::storage::LocalStorage; | ||
use remote_hdt::error::RemoteHDTError; | ||
use remote_hdt::storage::layout::tabular::TabularLayout; | ||
use remote_hdt::storage::params::{Backend, Serialization}; | ||
use remote_hdt::storage::Storage; | ||
use std::env; | ||
use std::time::Instant; | ||
|
||
fn main() { | ||
fn main() -> Result<(), RemoteHDTError> { | ||
let args: Vec<String> = env::args().collect(); | ||
if args.len() <= 1 { | ||
panic!("Usage: cargo run --example query_bench <number_of_universities>"); | ||
} | ||
|
||
let number_of_universities: &String = &args[1]; | ||
let zarr_path = format!("{}-lubm", number_of_universities); | ||
|
||
let before = Instant::now(); | ||
LocalStorage::new(TabularLayout) | ||
.load(format!("{}.zarr", zarr_path).as_str()) | ||
.unwrap(); | ||
let after = before.elapsed(); | ||
|
||
println!("Elapsed time: {:.2?}", after) | ||
Storage::new(TabularLayout, Serialization::Zarr) | ||
.load(Backend::FileSystem(format!("{}.zarr", zarr_path).as_str()))?; | ||
|
||
println!("Elapsed time: {:.2?}", before.elapsed()); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
use remote_hdt::storage::tabular::TabularLayout; | ||
use remote_hdt::storage::ChunkingStrategy; | ||
use remote_hdt::storage::LocalStorage; | ||
use remote_hdt::error::RemoteHDTError; | ||
use remote_hdt::storage::layout::tabular::TabularLayout; | ||
use remote_hdt::storage::params::{Backend, ChunkingStrategy, ReferenceSystem, Serialization}; | ||
use remote_hdt::storage::Storage; | ||
|
||
pub fn main() { | ||
LocalStorage::new(TabularLayout) | ||
.serialize( | ||
"root.zarr", | ||
"examples/ntriples/rdf.nt", | ||
ChunkingStrategy::Chunk, | ||
) | ||
.unwrap(); | ||
pub fn main() -> Result<(), RemoteHDTError> { | ||
Storage::new(TabularLayout, Serialization::Zarr).serialize( | ||
Backend::FileSystem("root.zarr"), | ||
"examples/ntriples/rdf.nt", | ||
ChunkingStrategy::Chunk, | ||
ReferenceSystem::SPO, | ||
)?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
use remote_hdt::engine::EngineStrategy; | ||
use remote_hdt::storage::matrix::MatrixLayout; | ||
use remote_hdt::storage::LocalStorage; | ||
use remote_hdt::error::RemoteHDTError; | ||
use remote_hdt::storage::layout::matrix::MatrixLayout; | ||
use remote_hdt::storage::ops::Ops; | ||
use remote_hdt::storage::params::{Backend, Serialization}; | ||
use remote_hdt::storage::Storage; | ||
use std::env; | ||
use std::time::Instant; | ||
|
||
const SUBJECT: &str = "<http://www.Department0.University0.edu/AssistantProfessor0/Publication0>"; | ||
const SUBJECT: &str = "<http://www.Department1.University0.edu/Course8>"; | ||
|
||
fn main() { | ||
fn main() -> Result<(), RemoteHDTError> { | ||
let args: Vec<String> = env::args().collect(); | ||
if args.len() <= 1 { | ||
panic!("Usage: cargo run --example query_bench <number_of_universities>"); | ||
} | ||
|
||
let number_of_universities: &String = &args[1]; | ||
let zarr_path = format!("{}-lubm", number_of_universities); | ||
|
||
let mut remote_hdt = LocalStorage::new(MatrixLayout); | ||
let arr = remote_hdt | ||
.load(format!("{}.zarr", zarr_path).as_str()) | ||
.unwrap(); | ||
let index = remote_hdt | ||
.get_dictionary() | ||
.get_subject_idx_unchecked(SUBJECT); | ||
let mut binding = Storage::new(MatrixLayout, Serialization::Zarr); | ||
let arr = binding.load(Backend::FileSystem(format!("{}.zarr", zarr_path).as_str()))?; | ||
|
||
let before = Instant::now(); | ||
arr.get_subject(index).unwrap(); | ||
let after = before.elapsed(); | ||
arr.get_object(SUBJECT)?; | ||
|
||
println!("Elapsed time: {:.2?}", before.elapsed()); | ||
|
||
println!("Elapsed time: {:.2?}", after) | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
use remote_hdt::storage::tabular::TabularLayout; | ||
use remote_hdt::storage::ChunkingStrategy; | ||
use remote_hdt::storage::LocalStorage; | ||
use remote_hdt::error::RemoteHDTError; | ||
use remote_hdt::storage::layout::tabular::TabularLayout; | ||
use remote_hdt::storage::params::{Backend, ChunkingStrategy, ReferenceSystem, Serialization}; | ||
use remote_hdt::storage::Storage; | ||
|
||
pub fn main() { | ||
LocalStorage::new(TabularLayout) | ||
.serialize( | ||
"root.zarr", | ||
"examples/rdf_xml/rdf.rdf", | ||
ChunkingStrategy::Chunk, | ||
) | ||
.unwrap(); | ||
pub fn main() -> Result<(), RemoteHDTError> { | ||
Storage::new(TabularLayout, Serialization::Zarr).serialize( | ||
Backend::FileSystem("root.zarr"), | ||
"examples/rdf_xml/rdf.rdf", | ||
ChunkingStrategy::Chunk, | ||
ReferenceSystem::SPO, | ||
)?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use remote_hdt::error::RemoteHDTError; | ||
use remote_hdt::storage::layout::matrix::MatrixLayout; | ||
use remote_hdt::storage::params::{Backend, ChunkingStrategy, ReferenceSystem, Serialization}; | ||
use remote_hdt::storage::Storage; | ||
use std::env; | ||
use std::time::Instant; | ||
|
||
fn main() -> Result<(), RemoteHDTError> { | ||
let args: Vec<String> = env::args().collect(); | ||
if args.len() <= 3 { | ||
panic!("Usage: cargo run --example serialize <rdf_path> <zarr_path> <shard_size>"); | ||
} | ||
|
||
let rdf_path = &args[1].as_str(); | ||
let zarr_path = &args[2].as_str(); | ||
let shard_size = &args[3].parse::<u64>().unwrap(); | ||
|
||
let before = Instant::now(); | ||
|
||
Storage::new(MatrixLayout, Serialization::Zarr).serialize( | ||
Backend::FileSystem(zarr_path), | ||
rdf_path, | ||
ChunkingStrategy::Sharding(*shard_size), | ||
ReferenceSystem::SPO, | ||
)?; | ||
|
||
println!("Elapsed time: {:.2?}", before.elapsed()); | ||
|
||
Ok(()) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
use remote_hdt::storage::tabular::TabularLayout; | ||
use remote_hdt::storage::ChunkingStrategy; | ||
use remote_hdt::storage::LocalStorage; | ||
use remote_hdt::error::RemoteHDTError; | ||
use remote_hdt::storage::layout::tabular::TabularLayout; | ||
use remote_hdt::storage::params::{Backend, ChunkingStrategy, ReferenceSystem, Serialization}; | ||
use remote_hdt::storage::Storage; | ||
|
||
pub fn main() { | ||
LocalStorage::new(TabularLayout) | ||
.serialize( | ||
"root.zarr", | ||
"examples/turtle/rdf.ttk", | ||
ChunkingStrategy::Chunk, | ||
) | ||
.unwrap(); | ||
pub fn main() -> Result<(), RemoteHDTError> { | ||
Storage::new(TabularLayout, Serialization::Zarr).serialize( | ||
Backend::FileSystem("root.zarr"), | ||
"examples/turtle/rdf.ttl", | ||
ChunkingStrategy::Chunk, | ||
ReferenceSystem::SPO, | ||
)?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.