You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,5 +3,58 @@ CLI tool for converting XML to RDF
3
3
4
4
This Rust-based tool converts XML data into RDF format, utilizing the `oxrdf` crate for RDF graph handling and `xml-rs` for efficient XML parsing. Generated triples can either be added to an `oxrdf::Graph` or written directly to file.
5
5
6
+
## Using the xml2rdf CLI
7
+
8
+
This library includes a CLI utility for parsing XML and generating N-Triple RDF using the `convert` subcommand. The binary can be built using `cargo build`.
9
+
10
+
```bash
11
+
$ xml2rdf convert --help
12
+
Convert XML to RDF format.
13
+
14
+
The `convert`command parses a XML file, converts it to RDF triples using `xml-rs`for parsing and `oxrdf` to construct the graph, and saves the output.
15
+
16
+
Usage: xml2rdf convert [OPTIONS]
17
+
18
+
Options:
19
+
-n, --namespace <NAMESPACE>
20
+
Namespace for RDF graph generation.
21
+
22
+
A custom namespace to prefix RDF resources created from XML keys and values.
23
+
24
+
[default: https://decisym.ai/xml2rdf/data]
25
+
26
+
-x, --xml <XML>...
27
+
Path to input XML file(s).
28
+
29
+
Provide the path to one or more XML files that will be parsed and converted.
30
+
31
+
-o, --output-file <OUTPUT_FILE>
32
+
Path to output file.
33
+
34
+
Optional: Specify the path to save the generated RDF data. If not provided, data will be written to stdout
35
+
36
+
-h, --help
37
+
Print help (see a summary with '-h')
38
+
```
39
+
40
+
## Using the convert library
41
+
42
+
The conversion functionality can also be called directly in Rust. The library supports writing results to a file or building an in-memory `oxrdf::Graph`.
0 commit comments