Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
RDF2h.Renderee = function (rdf2h, graph, node, context) {
if (!node) {
throw "no node specficied!";
}
if (Object.prototype.toString.call(node) === '[object Array]') {
throw "Renderee must be a single node";
}
this.rdf2h = rdf2h;
this.graph = graph;
this.node = node;
this.context = context;
var cf = clownface.Graph(graph);
this.graphNode = cf.node(node);
};
RDF2h.prototype.getRenderer = function (renderee) {
var cf = clownface.Graph(this.matcherGraph);
function matchPattern(cfTriplePattern) {
function isThis(node) {
return (node && (node.interfaceName === "NamedNode") &&
(node.toString() === "http://rdf2h.github.io/2015/rdf2h#this"));
}
var s = cfTriplePattern.out("http://rdf2h.github.io/2015/rdf2h#subject").nodes()[0];
var p = cfTriplePattern.out("http://rdf2h.github.io/2015/rdf2h#predicate").nodes()[0];
var o = cfTriplePattern.out("http://rdf2h.github.io/2015/rdf2h#object").nodes()[0];
if (isThis(s)) {
if (renderee.node.interfaceName === "Literal") {
if (rdf.createNamedNode(RDF2h.resolveCurie("rdf:type")).equals(p)) {
return renderee.node.datatype.equals(o);
}
}
return renderee.graphNode.out(p).nodes().some(function (e) {