How to use the rdf-ext.createBlankNode function in rdf-ext

To help you get started, we’ve selected a few rdf-ext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github simplerdf / simplerdf / examples / get-save.js View on Github external
var rdf = require('rdf-ext')
var simple = require('../')

var blogContext = {
  name: 'http://schema.org/name',
  post: {
    '@id': 'http://schema.org/post',
    '@container': '@set'
  },
  headline: 'http://schema.org/headline',
  content: 'http://schema.org/content'
}

var blogIri = 'http://example.org/blog'

var blogPostNode = rdf.createBlankNode()

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'))
])
github simplerdf / simplerdf / lib / core.js View on Github external
static buildIri (iri) {
    if (typeof iri === 'string') {
      return rdf.createNamedNode(iri)
    } else {
      return iri || rdf.createBlankNode()
    }
  }
}