3 releases
Uses old Rust 2015
0.1.3 | Mar 4, 2019 |
---|---|
0.1.2 | Feb 22, 2018 |
0.1.1 | Feb 19, 2018 |
#2177 in Parser implementations
40KB
1K
SLoC
Chelone: A RDF Turtle parser
Chelone is a rdf turtle parser.
chelone = "0.1"
extern crate chelone;
use chelone::Graph;
const TURTLE: &str = r##"
@base <http://example.org/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rel: <http://www.perceive.net/schemas/relationship/> .
<#Mozilla>
a foaf:Organization ;
foaf:name "Mozilla" .
<#Rust>
rel:childOf <#Mozilla> ;
a foaf:Project ;
foaf:name "Rust" .
"##;
fn main() {
let graph = Graph::new(TURTLE).unwrap_or_else(|e| panic!("{}", e));
let triples = graph.parse();
println!("{}", triples);
}
lib.rs
:
Chelone: A Turtle-RDF parsing library.
extern crate chelone;
use chelone::Graph;
const TURTLE: &str = r##"
@base <http://example.org/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rel: <http://www.perceive.net/schemas/relationship/> .
<#Mozilla>
a foaf:Organization ;
foaf:name "Mozilla" .
<#Rust>
rel:childOf <#Mozilla> ;
a foaf:Project ;
foaf:name "Rust" .
"##;
fn main() {
let graph = Graph::new(TURTLE).unwrap_or_else(|e| panic!("{}", e));
let triples = graph.parse();
println!("{}", triples);
}
Dependencies
~6MB
~136K SLoC