Skip to content

Commit

Permalink
fix: exclude blank nodes (#31)
Browse files Browse the repository at this point in the history
* chore(deps): oxrdf 0.1.7 -> 0.2.1

* fix: always exclude blank nodes

* chore: bump to v0.2.5
  • Loading branch information
cmdoret authored Oct 23, 2024
1 parent ed357db commit 6c18ba2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 26 deletions.
27 changes: 8 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions fuzon-http/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "fuzon-http"
version = "0.2.4"
version = "0.2.5"
license.workspace = true
edition.workspace = true

[dependencies]
actix-web = "4.9.0"
clap = { version = "4.5.18", features = ["derive"] }
env_logger = "0.11.5"
fuzon = { version = "0.2.4", path = "../fuzon" }
fuzon = { version = "0.2.5", path = "../fuzon" }
log = "0.4.22"
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.128"
4 changes: 2 additions & 2 deletions fuzon/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fuzon"
version = "0.2.4"
version = "0.2.5"
edition = "2021"

[lib]
Expand All @@ -12,7 +12,7 @@ clap = { version = "4.5.16", features = ["derive"] }
crossterm = "0.28.1"
dirs = "5.0.1"
lazy_static = "1.5.0"
oxrdf = "0.1.7"
oxrdf = "0.2.1"
oxrdfio = "0.1.0"
oxttl = "0.1.0-rc.1"
postcard = { version = "1.0.10", features = ["alloc"] }
Expand Down
3 changes: 3 additions & 0 deletions fuzon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use std::{
use anyhow::Result;
use lazy_static::lazy_static;
use oxrdfio::{RdfFormat, RdfParser};
use oxrdf::Subject;
use postcard;
use reqwest::{blocking::Client, Url};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -164,8 +165,10 @@ pub fn gather_terms(readers: Vec<(impl BufRead, RdfFormat)>) -> impl Iterator<It
let mut terms = Vec::new();
for (reader, format) in readers {
let parser = RdfParser::from_format(format).for_reader(reader);
// Drop blank nodes and filter by common annotation properties
let mut out = parser
.map(|t| t.expect("Error parsing RDF"))
.filter(|t| if let Subject::NamedNode(_) = t.subject {true} else {false})
.filter(|t| ANNOTATIONS.contains(t.predicate.as_str()))
.map(|t| Term {
uri: t.subject.to_string(),
Expand Down
6 changes: 3 additions & 3 deletions pyfuzon/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyfuzon"
version = "0.2.4"
version = "0.2.5"
edition = "2021"

[lib]
Expand All @@ -11,9 +11,9 @@ crate-type = ["cdylib"]
anyhow = "1.0.86"
clap = { version = "4.5.16", features = ["derive"] }
crossterm = "0.28.1"
fuzon = { version = "0.2.4", path = "../fuzon" }
fuzon = { version = "0.2.5", path = "../fuzon" }
lazy_static = "1.5.0"
oxrdf = "0.1.7"
oxrdf = "0.2.1"
oxttl = "0.1.0-rc.1"
pyo3 = { version = "0.22.2", features = ["abi3-py310", "anyhow"] }
ratatui = "0.28.1"
Expand Down

0 comments on commit 6c18ba2

Please sign in to comment.