Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const quadStream: RDF.Stream = store.match(N3.DataFactory.namedNode('http://ex.org/Mickey'));
interface N3QuadGeneralized extends N3.BaseQuad {
subject: N3.Quad_Subject | N3.BlankNode | N3.Literal;
predicate: N3.Quad_Predicate | N3.BlankNode | N3.Literal;
object: N3.Quad_Object | N3.BlankNode | N3.Literal;
graph: N3.Quad_Graph | N3.BlankNode | N3.Literal;
}
interface RDFQuadGeneralized extends RDF.BaseQuad {
subject: RDF.Quad_Subject | RDF.BlankNode | RDF.Literal;
predicate: RDF.Quad_Predicate | RDF.BlankNode | RDF.Literal;
object: RDF.Quad_Object | RDF.BlankNode | RDF.Literal;
graph: RDF.Quad_Graph | RDF.BlankNode | RDF.Literal;
}
const storeGeneralized = new N3.Store();
// storeGeneralized.
storeGeneralized.addQuad(N3.DataFactory.namedNode('http://ex.org/Pluto'), N3.DataFactory.blankNode(), N3.DataFactory.namedNode('http://ex.org/Dog'));
}
SummaryDatasource.prototype._initialize = function (done) {
this._tripleStore = new N3.Store();
// var parser = new N3.Parser();
// var self = this;
// If summaryDir does not exist, create it
if (!fs.existsSync(this._summariesFolder)) {
fs.mkdirSync(this._summariesFolder, { recursive: true });
}
// Initialize watcher.
var watcher = chokidar.watch(this._summariesFolder, {
ignored: /(^|[\/\\])\../,
persistent: true
});
console.log(`Watching ${this._summariesFolder}`)
watcher.on('add', (summaryFile) => this._storeFile(summaryFile, err => console.log(err)));
function LoadPromise (shex, json, turtle, jsonld, schemaOptions = {}, dataOptions = {}) {
var returns = {
schema: ShExUtil.emptySchema(),
data: new N3.Store(),
schemaMeta: [],
dataMeta: []
};
var promises = [];
var schemasSeen = shex.concat(json).map(p => {
// might be already loaded objects with a url property.
return typeof p === "object" ? p.url : p;
});
var transform = null;
if (schemaOptions && "iriTransform" in schemaOptions) {
transform = schemaOptions.iriTransform;
delete schemaOptions.iriTransform;
}
var allLoaded = DynamicPromise();
function loadImports (schema) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
store = new n3_1.Store();
store.addQuad(n3_1.DataFactory.quad(n3_1.DataFactory.namedNode('a'), n3_1.DataFactory.namedNode('b'), n3_1.DataFactory.namedNode('http://dbpedia.org/resource/Belgium')));
store.addQuad(n3_1.DataFactory.quad(n3_1.DataFactory.namedNode('a'), n3_1.DataFactory.namedNode('b'), n3_1.DataFactory.namedNode('http://dbpedia.org/resource/Ghent')));
myEngine = actor_init_sparql_rdfjs_1.newEngine();
return [4 /*yield*/, myEngine.query('SELECT * { ?s ?p . ?s ?p ?o } LIMIT 100', { sources: [{ type: 'rdfjsSource', value: store }] })];
case 1:
result = _a.sent();
result.bindingsStream.on('data', function (data) {
console.log(data);
});
return [2 /*return*/];
}
});
});
constructor() {
super()
this._store = Store()
this._parser = Parser()
}
(async function() {
console.time('query')
for (var i = 0; i < 500; i++) {
const result = await ComunicaEngine.query(sparql, {
source: { value: new Store(), type: 'rdfjsSource' },
});
const bindings = result.bindingsStream;
await readBindings(bindings);
}
console.timeEnd('query')
}())
function Reasoner() {
if (!(this instanceof Reasoner))
return new Reasoner();
utils.defineHidden(this, '_store', new N3.Store());
_init(this);
}
Reasoner.prototype.use_stream =
constructor (fetch) {
this._fetch = fetch
this.parser = new N3.Parser()
this.store = new N3.Store()
/** @type {Object.} */
this.cache = {}
this.prefix = {}
}
constructor () {
super()
this._store = Store()
}
MemoryDatasource.prototype._initialize = function (done) {
var tripleStore = this._tripleStore = new N3Store();
this._getAllTriples(function (s, p, o, g) { tripleStore.addTriple(s, p, o, g); }, done);
};