From cbb77e77b723691c5060b4584b54474860f7963c Mon Sep 17 00:00:00 2001 From: Christoph Reiter <reiter.christoph@gmail.com> Date: Thu, 24 Feb 2022 12:00:03 +0100 Subject: [PATCH] Remove getApiUrlForIdentifier() Since it's not clear if IRIs should be unique in the API (also with subclasses etc) just stop usingn them for now, to avoid name ID clashes. --- .../check-in-place-select/src/check-in-place-select.js | 3 +-- packages/common/jsonld.js | 10 ---------- packages/person-select/src/person-select.js | 3 +-- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/packages/check-in-place-select/src/check-in-place-select.js b/packages/check-in-place-select/src/check-in-place-select.js index 613fdfed..978a5120 100644 --- a/packages/check-in-place-select/src/check-in-place-select.js +++ b/packages/check-in-place-select/src/check-in-place-select.js @@ -147,8 +147,7 @@ export class CheckInPlaceSelect extends ScopedElementsMixin(AdapterLitElement) { } // find the correct api url for a checkInPlace - const apiUrl = this.jsonld.getApiUrlForIdentifier('http://schema.org/Place'); - // const apiUrl = this.jsonld.getApiUrlForEntityName("CheckInPlace"); + const apiUrl = this.jsonld.getApiUrlForEntityName("CheckinPlace"); if (this.$select === null) { return false; diff --git a/packages/common/jsonld.js b/packages/common/jsonld.js index 0a42f6fa..021a62db 100644 --- a/packages/common/jsonld.js +++ b/packages/common/jsonld.js @@ -208,16 +208,6 @@ export default class JSONLD { return this.entities[entityName]; } - getApiUrlForIdentifier(identifier) { - const entity = this.getEntityForIdentifier(identifier); - - if (entity === undefined || entity['@entryPoint'] === undefined) { - throw new Error(`Entity with identifier "${identifier}" not found!`); - } - - return entity['@entryPoint']; - } - getApiUrlForEntityName(entityName) { const entity = this.getEntityForEntityName(entityName); diff --git a/packages/person-select/src/person-select.js b/packages/person-select/src/person-select.js index 5ec65875..bc7ed95e 100644 --- a/packages/person-select/src/person-select.js +++ b/packages/person-select/src/person-select.js @@ -148,8 +148,7 @@ export class PersonSelect extends ScopedElementsMixin(AdapterLitElement) { } // find the correct api url for a person - const apiUrl = this.jsonld.getApiUrlForIdentifier('http://schema.org/Person'); - // const apiUrl = this.jsonld.getApiUrlForEntityName("Event"); + const apiUrl = this.jsonld.getApiUrlForEntityName("BasePerson"); if (this.$select === null) { return false; -- GitLab