Skip to content

Commit

Permalink
chore: fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr committed Sep 12, 2022
1 parent 6a42241 commit 221d8c1
Show file tree
Hide file tree
Showing 4 changed files with 724 additions and 9 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ module.exports = {
'@typescript-eslint/no-extra-parens': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'import/no-extraneous-dependencies': 'off',
'@typescript-eslint/require-array-sort-compare': 'off'
}
}
],
Expand Down
30 changes: 24 additions & 6 deletions engines/query-sparql-reasoning/test/QuerySparqlReasoning-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,49 @@ describe('System test: QuerySparqlReasoning', () => {
});
it('rdfs rules on timbl and foaf', async() => {
const result = await engine.queryBindings(
'SELECT * WHERE { <https://www.w3.org/People/Berners-Lee/card#i> a ?o }', {
'SELECT DISTINCT * WHERE { <https://www.w3.org/People/Berners-Lee/card#i> a ?o }', {
[KeysRdfReason.implicitDatasetFactory.name]: () => new Store(),

[KeysRdfReason.rules.name]: KeysRdfDereferenceConstantHylar.rdfs,
sources: [
'https://www.w3.org/People/Berners-Lee/card',
'http://xmlns.com/foaf/spec/index.rdf',
// 'http://xmlns.com/foaf/spec/index.rdf',
'https://web.archive.org/web/20220614105937if_/http://xmlns.com/foaf/spec/20140114.rdf',
],
},
);
expect((await result.toArray()).length).toEqual(9);
expect((await result.toArray()).map(x => x.get('o')?.value).sort()).toEqual([
'http://www.w3.org/2000/10/swap/pim/contact#Male',
'http://www.w3.org/2000/01/rdf-schema#Resource',
'http://xmlns.com/foaf/0.1/Person',
'http://xmlns.com/foaf/0.1/Agent',
'http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing',
'http://www.w3.org/2002/07/owl#Thing',
].sort());
});
it('owl2rl on timbl and foaf', async() => {
const result = await engine.queryBindings(
'SELECT * WHERE { <https://www.w3.org/People/Berners-Lee/card#i> a ?o }', {
'SELECT DISTINCT * WHERE { <https://www.w3.org/People/Berners-Lee/card#i> a ?o }', {
[KeysRdfReason.implicitDatasetFactory.name]: () => new Store(),

[KeysRdfReason.rules.name]: KeysRdfDereferenceConstantHylar.owl2rl,
sources: [
'https://www.w3.org/People/Berners-Lee/card',
'http://xmlns.com/foaf/spec/index.rdf',
// 'http://xmlns.com/foaf/spec/index.rdf',
'https://web.archive.org/web/20220614105937if_/http://xmlns.com/foaf/spec/20140114.rdf',
],
},
);
expect((await result.toArray()).length).toEqual(8);
expect((await result.toArray()).map(x => x.get('o')?.value).sort()).toEqual([
'http://purl.org/dc/terms/Agent',
'http://schema.org/Person',
'http://www.w3.org/2000/10/swap/pim/contact#Male',
'http://www.w3.org/2000/10/swap/pim/contact#Person',
'http://www.w3.org/2002/07/owl#Thing',
'http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing',
'http://xmlns.com/foaf/0.1/Agent',
'http://xmlns.com/foaf/0.1/Person',
].sort());
});
});
});
Expand Down
Loading

0 comments on commit 221d8c1

Please sign in to comment.