Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: switched to github ci, switched to stricter-standard, updated deps #26

Merged
merged 2 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI
on: push
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
node:
- '12'
- '14'
- '16'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm test
- run: npm run coverage
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.idea
coverage
node_modules
package-lock.json
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

348 changes: 192 additions & 156 deletions dist/rdf-data-model.js
Original file line number Diff line number Diff line change
@@ -1,165 +1,201 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.rdf = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
var DataFactory = require('./lib/data-factory')

module.exports = DataFactory

},{"./lib/data-factory":3}],2:[function(require,module,exports){
function BlankNode (id) {
this.value = id || ('b' + (++BlankNode.nextId))
}

BlankNode.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value
}

BlankNode.prototype.termType = 'BlankNode'

BlankNode.nextId = 0

module.exports = BlankNode

},{}],3:[function(require,module,exports){
var BlankNode = require('./blank-node')
var DefaultGraph = require('./default-graph')
var Literal = require('./literal')
var NamedNode = require('./named-node')
var Quad = require('./quad')
var Variable = require('./variable')

function DataFactory () {}

DataFactory.namedNode = function (value) {
return new NamedNode(value)
}

DataFactory.blankNode = function (value) {
return new BlankNode(value)
}

DataFactory.literal = function (value, languageOrDatatype) {
if (typeof languageOrDatatype === 'string') {
if (languageOrDatatype.indexOf(':') === -1) {
return new Literal(value, languageOrDatatype)
}

return new Literal(value, null, DataFactory.namedNode(languageOrDatatype))
}

return new Literal(value, null, languageOrDatatype)
}

DataFactory.defaultGraph = function () {
return DataFactory.defaultGraphInstance
}

DataFactory.variable = function (value) {
return new Variable(value)
}

DataFactory.triple = function (subject, predicate, object) {
return DataFactory.quad(subject, predicate, object)
}

DataFactory.quad = function (subject, predicate, object, graph) {
return new Quad(subject, predicate, object, graph || DataFactory.defaultGraphInstance)
}

DataFactory.defaultGraphInstance = new DefaultGraph()

module.exports = DataFactory

},{"./blank-node":2,"./default-graph":4,"./literal":5,"./named-node":6,"./quad":7,"./variable":8}],4:[function(require,module,exports){
function DefaultGraph () {
this.value = ''
}

DefaultGraph.prototype.equals = function (other) {
return !!other && other.termType === this.termType
}

DefaultGraph.prototype.termType = 'DefaultGraph'

module.exports = DefaultGraph

},{}],5:[function(require,module,exports){
var NamedNode = require('./named-node')

function Literal (value, language, datatype) {
this.value = value
this.datatype = Literal.stringDatatype
this.language = ''

if (language) {
this.language = language
this.datatype = Literal.langStringDatatype
} else if (datatype) {
this.datatype = datatype
}
}

Literal.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value &&
other.language === this.language && other.datatype.equals(this.datatype)
}

Literal.prototype.termType = 'Literal'
Literal.langStringDatatype = new NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString')
Literal.stringDatatype = new NamedNode('http://www.w3.org/2001/XMLSchema#string')

module.exports = Literal

},{"./named-node":6}],6:[function(require,module,exports){
function NamedNode (iri) {
this.value = iri
}

NamedNode.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value
}

NamedNode.prototype.termType = 'NamedNode'

module.exports = NamedNode

},{}],7:[function(require,module,exports){
var DefaultGraph = require('./default-graph')

function Quad (subject, predicate, object, graph) {
this.subject = subject
this.predicate = predicate
this.object = object

if (graph) {
this.graph = graph
(function (f) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
module.exports = f()
} else if (typeof define === 'function' && define.amd) {
define([], f)
} else {
this.graph = new DefaultGraph()
let g; if (typeof window !== 'undefined') {
g = window
} else if (typeof global !== 'undefined') {
g = global
} else if (typeof self !== 'undefined') {
g = self
} else {
g = this
}g.rdf = f()
}
}

Quad.prototype.equals = function (other) {
// `|| !other.termType` is for backwards-compatibility with old factories without RDF* support.
return !!other && (other.termType === 'Quad' || !other.termType) &&
})(function () {
let define, module, exports; return (function () {
function r (e, n, t) {
function o (i, f) {
if (!n[i]) {
if (!e[i]) {
const c = typeof require === 'function' && require; if (!f && c) {
return c(i, !0)
} if (u) {
return u(i, !0)
} const a = new Error("Cannot find module '" + i + "'"); throw a.code = 'MODULE_NOT_FOUND', a
} const p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) {
const n = e[i][1][r]; return o(n || r)
}, p, p.exports, r, e, n, t)
} return n[i].exports
} for (var u = typeof require === 'function' && require, i = 0; i < t.length; i++) {
o(t[i])
} return o
} return r
})()({
1: [function (require, module, exports) {
const DataFactory = require('./lib/data-factory')

module.exports = DataFactory
}, { './lib/data-factory': 3 }],
2: [function (require, module, exports) {
function BlankNode (id) {
this.value = id || ('b' + (++BlankNode.nextId))
}

BlankNode.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value
}

BlankNode.prototype.termType = 'BlankNode'

BlankNode.nextId = 0

module.exports = BlankNode
}, {}],
3: [function (require, module, exports) {
const BlankNode = require('./blank-node')
const DefaultGraph = require('./default-graph')
const Literal = require('./literal')
const NamedNode = require('./named-node')
const Quad = require('./quad')
const Variable = require('./variable')

function DataFactory () {}

DataFactory.namedNode = function (value) {
return new NamedNode(value)
}

DataFactory.blankNode = function (value) {
return new BlankNode(value)
}

DataFactory.literal = function (value, languageOrDatatype) {
if (typeof languageOrDatatype === 'string') {
if (languageOrDatatype.indexOf(':') === -1) {
return new Literal(value, languageOrDatatype)
}

return new Literal(value, null, DataFactory.namedNode(languageOrDatatype))
}

return new Literal(value, null, languageOrDatatype)
}

DataFactory.defaultGraph = function () {
return DataFactory.defaultGraphInstance
}

DataFactory.variable = function (value) {
return new Variable(value)
}

DataFactory.triple = function (subject, predicate, object) {
return DataFactory.quad(subject, predicate, object)
}

DataFactory.quad = function (subject, predicate, object, graph) {
return new Quad(subject, predicate, object, graph || DataFactory.defaultGraphInstance)
}

DataFactory.defaultGraphInstance = new DefaultGraph()

module.exports = DataFactory
}, { './blank-node': 2, './default-graph': 4, './literal': 5, './named-node': 6, './quad': 7, './variable': 8 }],
4: [function (require, module, exports) {
function DefaultGraph () {
this.value = ''
}

DefaultGraph.prototype.equals = function (other) {
return !!other && other.termType === this.termType
}

DefaultGraph.prototype.termType = 'DefaultGraph'

module.exports = DefaultGraph
}, {}],
5: [function (require, module, exports) {
const NamedNode = require('./named-node')

function Literal (value, language, datatype) {
this.value = value
this.datatype = Literal.stringDatatype
this.language = ''

if (language) {
this.language = language
this.datatype = Literal.langStringDatatype
} else if (datatype) {
this.datatype = datatype
}
}

Literal.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value &&
other.language === this.language && other.datatype.equals(this.datatype)
}

Literal.prototype.termType = 'Literal'
Literal.langStringDatatype = new NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString')
Literal.stringDatatype = new NamedNode('http://www.w3.org/2001/XMLSchema#string')

module.exports = Literal
}, { './named-node': 6 }],
6: [function (require, module, exports) {
function NamedNode (iri) {
this.value = iri
}

NamedNode.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value
}

NamedNode.prototype.termType = 'NamedNode'

module.exports = NamedNode
}, {}],
7: [function (require, module, exports) {
const DefaultGraph = require('./default-graph')

function Quad (subject, predicate, object, graph) {
this.subject = subject
this.predicate = predicate
this.object = object

if (graph) {
this.graph = graph
} else {
this.graph = new DefaultGraph()
}
}

Quad.prototype.equals = function (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 = ''

module.exports = Quad
}

},{"./default-graph":4}],8:[function(require,module,exports){
function Variable (name) {
this.value = name
}
Quad.prototype.termType = 'Quad'
Quad.prototype.value = ''

Variable.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value
}
module.exports = Quad
}, { './default-graph': 4 }],
8: [function (require, module, exports) {
function Variable (name) {
this.value = name
}

Variable.prototype.termType = 'Variable'
Variable.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value
}

module.exports = Variable
Variable.prototype.termType = 'Variable'

},{}]},{},[1])(1)
});
module.exports = Variable
}, {}]
}, {}, [1])(1)
})
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
var DataFactory = require('./lib/data-factory')
const DataFactory = require('./lib/data-factory')

module.exports = DataFactory
Loading
Loading