UNPKG

@rdfjs/data-model

Version:

A basic implementation of the RDF/JS Data Model

24 lines (20 loc) 631 B
class Quad { constructor (subject, predicate, object, graph) { this.subject = subject this.predicate = predicate this.object = object this.graph = graph } equals (other) { // `|| !other.termType` is for backwards-compatibility with old factories without RDF* support. return !!other && (other.termType === 'Quad' || !other.termType) && other.subject.equals(this.subject) && other.predicate.equals(this.predicate) && other.object.equals(this.object) && other.graph.equals(this.graph) } } Quad.prototype.termType = 'Quad' Quad.prototype.value = '' export default Quad