From 27856c00e644488099bdc960f576e0057019f79e Mon Sep 17 00:00:00 2001 From: James McLaughlin Date: Wed, 27 Sep 2023 01:29:20 +0100 Subject: [PATCH 1/2] read both foaf:depiction and foaf:depicted_by (#487) --- frontend/src/model/Entity.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/model/Entity.ts b/frontend/src/model/Entity.ts index d1c4a239e..1b5eefd13 100644 --- a/frontend/src/model/Entity.ts +++ b/frontend/src/model/Entity.ts @@ -82,7 +82,8 @@ export default abstract class Entity extends Thing { getDepictedBy(): Reified[] { return Reified.fromJson( - this.properties["http://xmlns.com/foaf/0.1/depicted_by"] + [ ...(this.properties["http://xmlns.com/foaf/0.1/depicted_by"] || []), + ...(this.properties["http://xmlns.com/foaf/0.1/depiction"] || []) ] ); } @@ -104,6 +105,7 @@ export default abstract class Entity extends Thing { // this is handled explicitly in EntityPage if (predicate === "http://xmlns.com/foaf/0.1/depicted_by") continue; + if (predicate === "http://xmlns.com/foaf/0.1/depiction") continue; let linkedEntity = this.getLinkedEntities().get(predicate) if (linkedEntity != undefined && linkedEntity.type.indexOf("objectProperty") !== -1) continue; From 526e984a9a82c4374973c10817bf86805e55d23f Mon Sep 17 00:00:00 2001 From: James McLaughlin Date: Wed, 27 Sep 2023 01:48:42 +0100 Subject: [PATCH 2/2] handle depictions being an array --- frontend/src/model/Entity.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/model/Entity.ts b/frontend/src/model/Entity.ts index 1b5eefd13..45dca156a 100644 --- a/frontend/src/model/Entity.ts +++ b/frontend/src/model/Entity.ts @@ -82,8 +82,8 @@ export default abstract class Entity extends Thing { getDepictedBy(): Reified[] { return Reified.fromJson( - [ ...(this.properties["http://xmlns.com/foaf/0.1/depicted_by"] || []), - ...(this.properties["http://xmlns.com/foaf/0.1/depiction"] || []) ] + [ ...asArray(this.properties["http://xmlns.com/foaf/0.1/depicted_by"] || []), + ...asArray(this.properties["http://xmlns.com/foaf/0.1/depiction"] || []) ] ); }