Skip to content

Commit 9100e25

Browse files
committed
license comments added, added Makefile
1 parent 6a33d05 commit 9100e25

6 files changed

Lines changed: 150 additions & 48 deletions

File tree

Cargo.lock

Lines changed: 95 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
[package]
22
name = "json2rdf"
3-
version = "0.1.1"
3+
version = "0.1.0"
4+
authors = ["bharath181 <bharathselvaraj18@gmail.com>", "Greg Hanson <g.isaac.hanson@gmail.com>"]
45
edition = "2021"
6+
license = "BSD-3-Clause OR Apache-2.0"
7+
description = "Library for converting a JSON file to N-Triple RDF"
8+
repository = "https://github.com/DeciSym/json2rdf"
9+
readme = "README.md"
10+
keywords = ["json", "rdf", "n-triples", "semantic-web", "converter", "parser"]
11+
categories = ["command-line-utilities", "encoding", "parser-implementations", "science", "web-programming"]
512

613
[dependencies]
7-
clap = { version = "4.5.20", features = ["derive"] }
8-
log = "0.4.22"
9-
oxrdf = "0.1.7"
14+
clap = { version = "4.5.30", features = ["derive"] }
15+
oxrdf = "0.2.4"
16+
serde_json = "1.0.139"
1017

11-
12-
serde = "1.0.203"
13-
serde_json = "1.0.117"
14-
uuid = { version = "1", features = ["v4"] }
18+
[dev-dependencies]
19+
oxrdfio = "0.1.6"

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) 2024-2025, DeciSym, LLC
2+
# Licensed under either of:
3+
# - Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
4+
# - BSD 3-Clause License (https://opensource.org/licenses/BSD-3-Clause)
5+
# at your option.
6+
7+
lint:
8+
cargo install cargo-machete
9+
cargo fmt --check
10+
cargo machete
11+
cargo clippy --benches --tests --bins --no-deps --all-features
12+
13+
build:
14+
cargo build
15+
16+
test:
17+
cargo test
18+
19+
presubmit: lint test

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,13 @@
22

33
This Rust-based tool converts JSON data into RDF format, utilizing the `oxrdf` crate for RDF graph handling and `serde_json` for efficient JSON parsing. It supports lightweight, memory-efficient processing by reading JSON data values sequentially, which makes it suitable for large datasets.
44

5+
## License
6+
7+
This project is licensed under either of
8+
9+
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
10+
http://www.apache.org/licenses/LICENSE-2.0)
11+
- BSD 3-Clause License ([LICENSE-BSD-3](LICENSE-BSD-3) or
12+
https://opensource.org/licenses/BSD-3-Clause)
13+
14+
at your option.

src/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Copyright (c) 2024-2025, DeciSym, LLC
2+
// Licensed under either of:
3+
// - Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
4+
// - BSD 3-Clause License (https://opensource.org/licenses/BSD-3-Clause)
5+
// at your option.
6+
17
//! # JSON2RDF Converter Library
28
//!
39
//! This library provides functionality for converting JSON data into RDF format.
@@ -38,7 +44,6 @@ use std::io::{BufReader, Write};
3844
///
3945
/// json_to_rdf(&"tests/airplane.json".to_string(), &Some("http://example.com/ns#".to_string()), &Some("output.nt".to_string()));
4046
/// ```
41-
4247
pub fn json_to_rdf(
4348
file_path: &String,
4449
namespace: &Option<String>,
@@ -114,7 +119,7 @@ pub fn json_to_rdf(
114119
writeln!(file, "{}", graph).expect("Error writing json2rdf data to file");
115120
Ok(None)
116121
} else {
117-
return Ok(Some(graph));
122+
Ok(Some(graph))
118123
}
119124
}
120125

@@ -143,7 +148,6 @@ pub fn json_to_rdf(
143148
/// - **String**: Converts to `xsd:string` literal.
144149
/// - **Boolean**: Converts to `xsd:boolean` literal.
145150
/// - **Number**: Converts to `xsd:int` or `xsd:float` literal based on value type.
146-
147151
fn process_value(
148152
subject_stack: &mut VecDeque<BlankNode>,
149153
property: &Option<String>,

src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Copyright (c) 2024-2025, DeciSym, LLC
2+
// Licensed under either of:
3+
// - Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
4+
// - BSD 3-Clause License (https://opensource.org/licenses/BSD-3-Clause)
5+
// at your option.
6+
17
//! # JSON2RDF Converter
28
//!
39
//! This is a Rust-based tool that converts JSON data into RDF format. It uses the `serde_json` crate

0 commit comments

Comments
 (0)