RDFa processor
graph-rdfa-processor is a library to extract RDF statements (as N-Triples) from an html page, based on its RDFa annotations.
It’s the extract step of Swarm: local administrations in Flanders publish their decisions as RDFa annotated html, and this library turns them into triples.
Usage
In Rust:
use graph_rdfa_processor::RdfaGraph;
let triples = RdfaGraph::parse_str(html, "http://example.com", None, None)?;
In Node, through WebAssembly:
npm i @nbittich/rdfa-wasm
const { html_to_rdfa } = require("@nbittich/rdfa-wasm");
console.log(html_to_rdfa(html, "http://example.com", ""));
It’s still a work in progress and doesn’t cover the whole spec, so expect some edge cases to fail.