Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var blogGraph = rdf.createGraph([
rdf.createTriple(
rdf.createNamedNode(blogIri),
rdf.createNamedNode('http://schema.org/name'),
rdf.createLiteral('simple blog')),
rdf.createTriple(
rdf.createNamedNode(blogIri),
rdf.createNamedNode('http://schema.org/post'),
blogPostNode),
rdf.createTriple(
blogPostNode,
rdf.createNamedNode('http://schema.org/headline'),
rdf.createLiteral('first blog post'))
])
var blogStore = rdf.createStore()
blogStore.add('http://example.org/blog', blogGraph).then(function () {
return simple(blogContext, blogIri, null, blogStore).get()
}).then(function (blog) {
console.log('fetched blog from: ' + blog._iri.toString())
console.log(blog.name)
console.log(blog.post.shift().headline)
// move blog to new location
blog.iri('http://example.org/new-blog')
return blog.save()
}).then(function (blog) {
console.log('stored blog at: ' + blog._iri.toString())
return blogStore.graph('http://example.org/new-blog')
constructor(options: RDFStoreOptions) {
this.parser = options.parser;
this.acceptBlankNodes = Boolean(options.acceptBlankNodes);
this.rdfStorage = createStore();
this.prefs = {
RDF: prefixFactory('http://www.w3.org/1999/02/22-rdf-syntax-ns#'),
RDFS: prefixFactory('http://www.w3.org/2000/01/rdf-schema#'),
FOAF: prefixFactory('http://xmlns.com/foaf/0.1/'),
XSD: prefixFactory('http://www.w3.org/2001/XMLSchema#'),
OWL: prefixFactory('http://www.w3.org/2002/07/owl#'),
};
}