Public
Edited
Jun 5, 2023
Importers
1 star
Insert cell
Insert cell
jsonld = require("https://unpkg.com/jsonld@1.0.0/dist/jsonld.min.js")
Insert cell
doc = {
return {
"http://schema.org/name": "Manu Sporny",
"http://schema.org/url": {"@id": "http://manu.sporny.org/"},
"http://schema.org/image": {"@id": "http://manu.sporny.org/images/manu.png"}
}
};
Insert cell
context = {
return {
"name": "http://schema.org/name",
"homepage": {"@id": "http://schema.org/url", "@type": "@id"},
"image": {"@id": "http://schema.org/image", "@type": "@id"}
}
}
Insert cell
compacted = await jsonld.compact(doc, context);
Insert cell
flattened = await jsonld.flatten(doc);
Insert cell
nquads = await jsonld.toRDF(compacted, {format: 'application/n-quads'});
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more