Skip to content

Commit fbe6acf

Browse files
committed
Made fetch status consistent; added test for it.
1 parent 68d3310 commit fbe6acf

File tree

14 files changed

+251
-13
lines changed

14 files changed

+251
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515
- Aggregating SPARQL queries work now (#70).
16+
- Sources' fetch status is consistent now (#59).
1617

1718
### Removed
1819

cypress/e2e/aggregating-query.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
describe("Aggregating query", () => {
2-
it("AVG() function", () => {
2+
it("AVG() function - see https://github.com/SolidLabResearch/generic-data-viewer-react-admin/issues/70", () => {
33
cy.visit("/");
44

55
cy.contains("Average value").click();

cypress/e2e/sources-info.cy.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,42 @@
11
describe("Sources info", () => {
2-
it("Fetch status on query failed", () => {
2+
it("Fetch status on fetch failure", () => {
33
cy.visit("/");
44

55
cy.contains("My favourite musicians").click();
66
cy.contains("Finished in:");
77
cy.get('[aria-label="Sources info"]').click();
88

9-
cy.get('[aria-label="Query failed"]').should("exist");
9+
cy.get('[aria-label="Fetch failed"]').should("exist");
1010
});
1111

12-
it("Fetch status on query success", () => {
12+
it("Fetch status on fetch success", () => {
1313
cy.visit("/");
1414

1515
cy.contains("My wish list").click();
1616
cy.contains("Finished in:");
1717
cy.get('[aria-label="Sources info"]').click();
1818

19-
cy.get('[aria-label="Query was succesful"]').should("exist");
19+
cy.get('[aria-label="Fetch was succesful"]').should("exist");
2020
});
2121

22-
it("Authentication needed for query on public data", () => {
22+
it("Fetch status on cached source - see https://github.com/SolidLabResearch/generic-data-viewer-react-admin/issues/59", () => {
23+
cy.visit("/");
24+
25+
cy.contains("Components").click();
26+
cy.contains("Finished in:");
27+
cy.get('[aria-label="Sources info"]').click();
28+
29+
cy.get('[aria-label="Fetch was succesful"]').should("exist");
30+
31+
cy.contains("Components and their materials").click();
32+
cy.contains("Finished in:");
33+
cy.get('[aria-label="Sources info"]').click();
34+
35+
cy.get('[aria-label="Fetch was succesful"]').should("exist");
36+
cy.get('[aria-label="Fetch failed"]').should("not.exist");
37+
});
38+
39+
it("Authentication not required for query on public data", () => {
2340
cy.visit("/");
2441

2542
cy.contains("My wish list").click();
@@ -29,7 +46,7 @@ describe("Sources info", () => {
2946
cy.get('[aria-label="No authentication required"]').should("exist");
3047
});
3148

32-
it("Authentication needed for query on private data", () => {
49+
it("Authentication required for query on private data", () => {
3350
cy.visit("/");
3451

3552
cy.get('[aria-label="Profile"]').click();
@@ -53,7 +70,7 @@ describe("Sources info", () => {
5370
cy.get('[aria-label="Authentication required"]').should("exist");
5471
});
5572

56-
it("Authentication needed for query on failing query", () => {
73+
it("Authentication uncertain for query on not existing source", () => {
5774
cy.visit("/");
5875

5976
cy.contains("My favourite musicians").click();

initial-pod-data/boms$.ttl

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
<http://www/example.com/data/component-bom-b01> a <http://www/example.com/ont/component-bom>;
3+
<http://www/example.com/ont/has-component-material-assoc> <http://www/example.com/data/component-material-assoc-b01-m01>,
4+
<http://www/example.com/data/component-material-assoc-b01-m02>, <http://www/example.com/data/component-material-assoc-b01-m03> .
5+
6+
<http://www/example.com/data/component-bom-b02> a <http://www/example.com/ont/component-bom>;
7+
<http://www/example.com/ont/has-component-material-assoc> <http://www/example.com/data/component-material-assoc-b02-m04>,
8+
<http://www/example.com/data/component-material-assoc-b02-m05>, <http://www/example.com/data/component-material-assoc-b02-m06>,
9+
<http://www/example.com/data/component-material-assoc-b02-m07>, <http://www/example.com/data/component-material-assoc-b02-m08>,
10+
<http://www/example.com/data/component-material-assoc-b02-m09> .
11+
12+
<http://www/example.com/data/component-bom-b03> a <http://www/example.com/ont/component-bom>;
13+
<http://www/example.com/ont/has-component-material-assoc> <http://www/example.com/data/component-material-assoc-b03-m10>,
14+
<http://www/example.com/data/component-material-assoc-b03-m11> .
15+
16+
<http://www/example.com/data/component-material-assoc-b01-m01> a <http://www/example.com/ont/component-material-assoc>;
17+
<http://www/example.com/ont/has-material> <http://www/example.com/data/material-m01>;
18+
<http://www/example.com/ont/percentage> 60 .
19+
20+
<http://www/example.com/data/component-material-assoc-b01-m02> a <http://www/example.com/ont/component-material-assoc>;
21+
<http://www/example.com/ont/has-material> <http://www/example.com/data/material-m02>;
22+
<http://www/example.com/ont/percentage> 30 .
23+
24+
<http://www/example.com/data/component-material-assoc-b01-m03> a <http://www/example.com/ont/component-material-assoc>;
25+
<http://www/example.com/ont/has-material> <http://www/example.com/data/material-m03>;
26+
<http://www/example.com/ont/percentage> 10 .
27+
28+
<http://www/example.com/data/component-material-assoc-b02-m04> a <http://www/example.com/ont/component-material-assoc>;
29+
<http://www/example.com/ont/has-material> <http://www/example.com/data/material-m04>;
30+
<http://www/example.com/ont/percentage> 40 .
31+
32+
<http://www/example.com/data/component-material-assoc-b02-m05> a <http://www/example.com/ont/component-material-assoc>;
33+
<http://www/example.com/ont/has-material> <http://www/example.com/data/material-m05>;
34+
<http://www/example.com/ont/percentage> 20 .
35+
36+
<http://www/example.com/data/component-material-assoc-b02-m06> a <http://www/example.com/ont/component-material-assoc>;
37+
<http://www/example.com/ont/has-material> <http://www/example.com/data/material-m06>;
38+
<http://www/example.com/ont/percentage> 25 .
39+
40+
<http://www/example.com/data/component-material-assoc-b02-m07> a <http://www/example.com/ont/component-material-assoc>;
41+
<http://www/example.com/ont/has-material> <http://www/example.com/data/material-m07>;
42+
<http://www/example.com/ont/percentage> 7 .
43+
44+
<http://www/example.com/data/component-material-assoc-b02-m08> a <http://www/example.com/ont/component-material-assoc>;
45+
<http://www/example.com/ont/has-material> <http://www/example.com/data/material-m08>;
46+
<http://www/example.com/ont/percentage> 5 .
47+
48+
<http://www/example.com/data/component-material-assoc-b02-m09> a <http://www/example.com/ont/component-material-assoc>;
49+
<http://www/example.com/ont/has-material> <http://www/example.com/data/material-m09>;
50+
<http://www/example.com/ont/percentage> 3 .
51+
52+
<http://www/example.com/data/component-material-assoc-b03-m10> a <http://www/example.com/ont/component-material-assoc>;
53+
<http://www/example.com/ont/has-material> <http://www/example.com/data/material-m10>;
54+
<http://www/example.com/ont/percentage> 85 .
55+
56+
<http://www/example.com/data/component-material-assoc-b03-m11> a <http://www/example.com/ont/component-material-assoc>;
57+
<http://www/example.com/ont/has-material> <http://www/example.com/data/material-m11>;
58+
<http://www/example.com/ont/percentage> 15 .

initial-pod-data/boms.acl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
2+
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
3+
4+
<#public>
5+
a acl:Authorization;
6+
acl:accessTo <./boms>;
7+
acl:agentClass foaf:Agent;
8+
acl:mode acl:Read.
9+
10+
<#owner>
11+
a acl:Authorization;
12+
acl:accessTo <./boms>;
13+
acl:agent <http://localhost:8080/example/profile/card#me>;
14+
acl:mode acl:Read, acl:Write, acl:Control.

initial-pod-data/components$.ttl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
<http://www/example.com/data/component-c01> a <http://www/example.com/ont/Component>;
3+
<http://www/example.com/ont/has-component-bom> <http://www/example.com/data/component-bom-b01>;
4+
<http://www/example.com/ont/name> "Component 1";
5+
<http://www/example.com/ont/recycled-content-percentage> 80 .
6+
7+
<http://www/example.com/data/component-c02> a <http://www/example.com/ont/Component>;
8+
<http://www/example.com/ont/has-component-bom> <http://www/example.com/data/component-bom-b02>;
9+
<http://www/example.com/ont/name> "Component 2";
10+
<http://www/example.com/ont/recycled-content-percentage> 20 .
11+
12+
<http://www/example.com/data/component-c03> a <http://www/example.com/ont/Component>;
13+
<http://www/example.com/ont/has-component-bom> <http://www/example.com/data/component-bom-b03>;
14+
<http://www/example.com/ont/name> "Component 3";
15+
<http://www/example.com/ont/recycled-content-percentage> 0 .

initial-pod-data/components.acl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
2+
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
3+
4+
<#public>
5+
a acl:Authorization;
6+
acl:accessTo <./components>;
7+
acl:agentClass foaf:Agent;
8+
acl:mode acl:Read.
9+
10+
<#owner>
11+
a acl:Authorization;
12+
acl:accessTo <./components>;
13+
acl:agent <http://localhost:8080/example/profile/card#me>;
14+
acl:mode acl:Read, acl:Write, acl:Control.

initial-pod-data/materials$.ttl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
<http://www/example.com/data/material-m01> a <http://www/example.com/ont/Component>;
3+
<http://www/example.com/ont/name> "Material 1" .
4+
5+
<http://www/example.com/data/material-m02> a <http://www/example.com/ont/Component>;
6+
<http://www/example.com/ont/name> "Material 2" .
7+
8+
<http://www/example.com/data/material-m03> a <http://www/example.com/ont/Component>;
9+
<http://www/example.com/ont/name> "Material 3" .
10+
11+
<http://www/example.com/data/material-m04> a <http://www/example.com/ont/Component>;
12+
<http://www/example.com/ont/name> "Material 4" .
13+
14+
<http://www/example.com/data/material-m05> a <http://www/example.com/ont/Component>;
15+
<http://www/example.com/ont/name> "Material 5" .
16+
17+
<http://www/example.com/data/material-m06> a <http://www/example.com/ont/Component>;
18+
<http://www/example.com/ont/name> "Material 6" .
19+
20+
<http://www/example.com/data/material-m07> a <http://www/example.com/ont/Component>;
21+
<http://www/example.com/ont/name> "Material 7" .
22+
23+
<http://www/example.com/data/material-m08> a <http://www/example.com/ont/Component>;
24+
<http://www/example.com/ont/name> "Material 8" .
25+
26+
<http://www/example.com/data/material-m09> a <http://www/example.com/ont/Component>;
27+
<http://www/example.com/ont/name> "Material 9" .
28+
29+
<http://www/example.com/data/material-m10> a <http://www/example.com/ont/Component>;
30+
<http://www/example.com/ont/name> "Material 10" .
31+
32+
<http://www/example.com/data/material-m11> a <http://www/example.com/ont/Component>;
33+
<http://www/example.com/ont/name> "Material 11" .

initial-pod-data/materials.acl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
2+
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
3+
4+
<#public>
5+
a acl:Authorization;
6+
acl:accessTo <./materials>;
7+
acl:agentClass foaf:Agent;
8+
acl:mode acl:Read.
9+
10+
<#owner>
11+
a acl:Authorization;
12+
acl:accessTo <./materials>;
13+
acl:agent <http://localhost:8080/example/profile/card#me>;
14+
acl:mode acl:Read, acl:Write, acl:Control.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Query Texon's components and their materials
2+
# Datasources: https://css5.onto-deside.ilabt.imec.be/texon/data/dt/out/components.ttl https://css5.onto-deside.ilabt.imec.be/texon/data/dt/out/boms.ttl https://css5.onto-deside.ilabt.imec.be/texon/data/dt/out/materials.ttl
3+
4+
PREFIX oo: <http://purl.org/openorg/>
5+
PREFIX ao: <http://purl.org/ontology/ao/core#>
6+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
7+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
8+
PREFIX d: <http://www/example.com/data/>
9+
PREFIX o: <http://www/example.com/ont/>
10+
11+
SELECT ?component ?componentName ?material ?materialName ?percentage
12+
WHERE {
13+
?component
14+
a o:Component ;
15+
o:name ?componentName ;
16+
o:has-component-bom [
17+
o:has-component-material-assoc [
18+
o:percentage ?percentage ;
19+
o:has-material ?material ;
20+
];
21+
];
22+
.
23+
?material o:name ?materialName ;
24+
}
25+
ORDER BY ?componentName

0 commit comments

Comments
 (0)