Skip to content

Commit 59e04a9

Browse files
committed
Merge branch 'development' into 'main'
Merge for v0.2.1 See merge request KNoWS/projects/onto-deside/helper!10
2 parents cd02267 + a2a078e commit 59e04a9

File tree

4 files changed

+57
-114
lines changed

4 files changed

+57
-114
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [0.2.1] - 2025-02-26
11+
12+
### Fixed
13+
14+
- The check to avoid making a verifiable credentials version of a resource that already is a verifiable credentials version now also works
15+
if data source is not json(ld) ([internal issue #6](https://gitlab.ilabt.imec.be/KNoWS/projects/onto-deside/helper/-/issues/6)).
16+
1017
## [0.2.0] - 2025-02-26
1118

1219
### Added
@@ -25,6 +32,7 @@ result in HTTP status 429 "Too Many Requests" when searching for index files wit
2532

2633
First release.
2734

28-
[Unreleased]: https://github.com/KNowledgeOnWebScale/solid-ocp-helper/compare/v0.2.0...HEAD
35+
[Unreleased]: https://github.com/KNowledgeOnWebScale/solid-ocp-helper/compare/v0.2.1...HEAD
36+
[0.2.1]: https://github.com/KNowledgeOnWebScale/solid-ocp-helper/releases/tag/v0.2.1
2937
[0.2.0]: https://github.com/KNowledgeOnWebScale/solid-ocp-helper/releases/tag/v0.2.0
3038
[0.1.0]: https://github.com/KNowledgeOnWebScale/solid-ocp-helper/releases/tag/v0.1.0

main/src/vcWrapper.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,31 @@ export async function makeVC(authInfo, contentType, text, authFetchFunction) {
5050
/**
5151
* Verify a verifiable credentials object
5252
*
53-
* @param {String} signedCredentialText the verifiable credentials object serialized as text
53+
* @param {String} signedCredentialText the verifiable credentials object as text
5454
* @returns {String}
5555
*/
5656
export async function verifyVC(signedCredentialText) {
5757
let v;
58-
let ret;
5958

59+
let verifiableCredential;
6060
try {
61-
v = await coreVerify(JSON.parse(signedCredentialText));
61+
verifiableCredential = JSON.parse(signedCredentialText);
6262
} catch (e) {
63-
ret = `verifying error: ${e.message}`;
63+
return "verification impossible; invalid contents (not JSON)";
6464
}
65-
if (v.validationResult.valid) {
66-
if (v.verificationResult.verified) {
67-
ret = "verification passed";
65+
66+
try {
67+
v = await coreVerify(verifiableCredential);
68+
if (v.validationResult.valid) {
69+
if (v.verificationResult.verified) {
70+
return "verification passed";
71+
} else {
72+
return "verification failed";
73+
}
6874
} else {
69-
ret = "verification failed";
75+
return "verification impossible; invalid contents";
7076
}
71-
} else {
72-
ret = "verification impossible; invalid contents";
77+
} catch (e) {
78+
return `verifying error: ${e.message}`;
7379
}
74-
return ret;
7580
}

test/css/pod-template/base/data/product-1$.jsonld

Lines changed: 0 additions & 102 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<http://example.com/JUY9242-REACHCompliance> <http://w3id.org/CEON/ontology/product/complianceWith> <http://w3id.org/CEON/demo/electronics/REACH> .
2+
<http://example.com/JUY9242-REACHCompliance> <http://w3id.org/CEON/ontology/product/hasCertificate> <https://cloud.ilabt.imec.be/index.php/s/ZN5ZFEsACXp2NXt> .
3+
<http://example.com/JUY9242-REACHCompliance> <http://w3id.org/CEON/ontology/provenance/statementAbout> <http://example.com/product-JUY9242> .
4+
<http://example.com/JUY9242-REACHCompliance> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://w3id.org/CEON/ontology/product/Compliance> .
5+
<http://example.com/JUY9242-REACHCompliance> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://w3id.org/CEON/ontology/provenance/Statement> .
6+
<http://example.com/manufacturer-company2> <http://w3id.org/CEON/demo/electronics/siteCountry> "Austria" .
7+
<http://example.com/producing-company2-JUY9242> <http://w3id.org/CEON/ontology/actorODP/participantRole> <http://w3id.org/CEON/ontology/actor/manufacturer> .
8+
<http://example.com/producing-company2-JUY9242> <http://w3id.org/CEON/ontology/actorODP/participatingActor> <http://example.com/manufacturer-company2> .
9+
<http://example.com/producing-company2-JUY9242> <http://w3id.org/CEON/ontology/actorODP/participatingResource> <http://example.com/product-JUY9242> .
10+
<http://example.com/product-JUY9242> <http://w3id.org/CEON/demo/electronics/hasCompliance> <http://example.com/JUY9242-REACHCompliance> .
11+
<http://example.com/product-JUY9242> <http://w3id.org/CEON/ontology/resourceODP/hasMatter> <http://w3id.org/CEON/demo/electronics/RareEarthMaterial> .
12+
<http://example.com/product-JUY9242> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://w3id.org/CEON/demo/electronics/ElectronicsProduct> .
13+
<http://example.com/product-JUY9242> <http://www.w3.org/2000/01/rdf-schema#label> "Electrical structure" .
14+
<http://example.com/product-JUY9242-DysprosiumComposition> <http://qudt.org/schema/qudt/hasUnit> <https://qudt.org/vocab/unit/PERCENT> .
15+
<http://example.com/product-JUY9242-DysprosiumComposition> <http://w3id.org/CEON/ontology/product/associatedWithMatter> <http://example.com/Dy> .
16+
<http://example.com/product-JUY9242-DysprosiumComposition> <http://w3id.org/CEON/ontology/product/compositionOf> <http://example.com/product-JUY9242> .
17+
<http://example.com/product-JUY9242-DysprosiumComposition> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://w3id.org/CEON/ontology/product/MatterComposition> .
18+
<http://example.com/product-JUY9242-DysprosiumComposition> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://w3id.org/CEON/ontology/provenance/Statement> .
19+
<http://example.com/product-JUY9242-NeodymiumComposition> <http://qudt.org/schema/qudt/hasUnit> <https://qudt.org/vocab/unit/PERCENT> .
20+
<http://example.com/product-JUY9242-NeodymiumComposition> <http://w3id.org/CEON/ontology/product/associatedWithMatter> <http://example.com/Nd> .
21+
<http://example.com/product-JUY9242-NeodymiumComposition> <http://w3id.org/CEON/ontology/product/compositionOf> <http://example.com/product-JUY9242> .
22+
<http://example.com/product-JUY9242-NeodymiumComposition> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://w3id.org/CEON/ontology/product/MatterComposition> .
23+
<http://example.com/product-JUY9242-NeodymiumComposition> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://w3id.org/CEON/ontology/provenance/Statement> .
24+
<http://example.com/product-JUY9242-PostCustomerRecycledContent> <http://qudt.org/schema/qudt/hasUnit> <https://qudt.org/vocab/unit/PERCENT> .
25+
<http://example.com/product-JUY9242-PostCustomerRecycledContent> <http://w3id.org/CEON/ontology/provenance/statementAbout> <http://example.com/product-JUY9242> .
26+
<http://example.com/product-JUY9242-PostCustomerRecycledContent> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://w3id.org/CEON/demo/electronics/PostCustomerRecycledContent> .
27+
<http://example.com/product-JUY9242-PostCustomerRecycledContent> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://w3id.org/CEON/ontology/provenance/Statement> .
28+
<http://example.com/product-JUY9242-PreCustomerRecycledContent> <http://qudt.org/schema/qudt/hasUnit> <https://qudt.org/vocab/unit/PERCENT> .
29+
<http://example.com/product-JUY9242-PreCustomerRecycledContent> <http://qudt.org/schema/qudt/numericValue> "3"^^<http://www.w3.org/2001/XMLSchema#decimal> .
30+
<http://example.com/product-JUY9242-PreCustomerRecycledContent> <http://w3id.org/CEON/ontology/provenance/statementAbout> <http://example.com/product-JUY9242> .
31+
<http://example.com/product-JUY9242-PreCustomerRecycledContent> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://w3id.org/CEON/demo/electronics/PreCustomerRecycledContent> .
32+
<http://example.com/product-JUY9242-PreCustomerRecycledContent> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://w3id.org/CEON/ontology/provenance/Statement> .

0 commit comments

Comments
 (0)