How to use the rdf-ext.prefixes 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 rdf2h / rdf2h / dist / rdf2h.js View on Github external
}
    if (!context) {
        context = RDF2h.resolveCurie("r2h:Default");
    }
    //wrap all in one object that gets special care by lookup
    var renderee = new RDF2h.Renderee(this, graph, node, context);
    if (!startMatcherIndex) {
        this.startMatcherIndex = 0;
    } else {
        this.startMatcherIndex = startMatcherIndex;
    }
    var renderer = this.getRenderer(renderee);
    return renderer(renderee);
}

RDF2h.prefixMap = rdf.prefixes;
RDF2h.prefixMap["s"] = "http://schema.org/";
/*rdf.prefixes.addAll({
    "s": "http://schema.org/"
});*/

RDF2h.resolveCurie = function (curie) {
    RDF2h.logger.debug("resolving " + curie);
    var splits = curie.split(":");
    var prefix = splits[0];
    var suffix = splits[1];
    if (RDF2h.prefixMap[prefix]) {
        return RDF2h.prefixMap[prefix] + suffix;
    } else {
        return curie;
    }