Package Exports
- rdf-ns
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rdf-ns) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
RDF Namespace
Simple helper object for referencing RDF namespaces, library-independent. Inspired by RDFLib.js.
Instead of:
Vocab: {
'rdfs': {
'seeAlso': 'http://www.w3.org/2000/01/rdf-schema#seeAlso',
'subClassOf': 'http://www.w3.org/2000/01/rdf-schema#subClassOf'
}
}
var seeAlso = Vocab.rdfs.seeAlso
Do:
var ns = require('rdf-ns')()
var rdfs = ns.base('http://www.w3.org/2000/01/rdf-schema#')
var seeAlso = rdfs('seeAlso')
console.log(seeAlso) // -> 'http://www.w3.org/2000/01/rdf-schema#seeAlso'
You can also inject an RDF library, and get back NamedNode
instances.
var rdf = require('rdflib')
var ns = require('rdf-ns')(rdf)
var rdfs = ns.base('http://www.w3.org/2000/01/rdf-schema#')
var seeAlso = rdfs('seeAlso')
console.log(seeAlso)
// -> NamedNode(<http://www.w3.org/2000/01/rdf-schema#seeAlso>)