mirror of
https://github.com/NexVeridian/wikidata-to-surrealdb.git
synced 2025-09-02 01:49:13 +00:00
fix: continue on BadId
This commit is contained in:
parent
4663a862a4
commit
200d5a0377
2 changed files with 6 additions and 2 deletions
1
Makefile
1
Makefile
|
@ -16,6 +16,7 @@ view:
|
||||||
precommit:
|
precommit:
|
||||||
rustup update
|
rustup update
|
||||||
cargo update
|
cargo update
|
||||||
|
cargo check
|
||||||
cargo fmt
|
cargo fmt
|
||||||
cargo t
|
cargo t
|
||||||
cargo clippy --fix --allow-dirty
|
cargo clippy --fix --allow-dirty
|
||||||
|
|
|
@ -144,13 +144,16 @@ impl CreateVersion {
|
||||||
|
|
||||||
for line in lines {
|
for line in lines {
|
||||||
let json: Value = from_str(&line).expect("Failed to parse JSON");
|
let json: Value = from_str(&line).expect("Failed to parse JSON");
|
||||||
let data = Entity::from_json(json).expect("Failed to parse JSON");
|
let data = match Entity::from_json(json) {
|
||||||
|
Ok(data) => data,
|
||||||
|
Err(_) => continue,
|
||||||
|
};
|
||||||
let (claims, data) = EntityMini::from_entity(data);
|
let (claims, data) = EntityMini::from_entity(data);
|
||||||
match data.id.clone().expect("No ID").tb.as_str() {
|
match data.id.clone().expect("No ID").tb.as_str() {
|
||||||
"Property" => property_vec.push(data),
|
"Property" => property_vec.push(data),
|
||||||
"Lexeme" => lexeme_vec.push(data),
|
"Lexeme" => lexeme_vec.push(data),
|
||||||
"Entity" => entity_vec.push(data),
|
"Entity" => entity_vec.push(data),
|
||||||
_ => panic!("Unknown table"),
|
_ => continue,
|
||||||
}
|
}
|
||||||
claims_vec.push(claims);
|
claims_vec.push(claims);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue