diff --git a/packages/data-table-view/src/data-table-view.js b/packages/data-table-view/src/data-table-view.js index 123f2e8c706d8e2ee27ac1f7494f29cae27d58ff..7fb40cdb5881f3c161aae280b3e78930a7d229b7 100644 --- a/packages/data-table-view/src/data-table-view.js +++ b/packages/data-table-view/src/data-table-view.js @@ -64,7 +64,11 @@ class DataTableView extends LitElement { JSONLD.initialize(this.entryPointUrl, function (jsonld) { that.jsonld = jsonld; try { - that.apiUrl = that.jsonld.getApiUrlForIdentifier("http://schema.org/" + that.value); + that.apiUrl = that.jsonld.getApiUrlForEntityName(that.value); + if (that.jsonld.entities[that.value] === undefined) { + console.dir(that.jsonld); + throw "Error: Could not get information about " + that.value; + } that.table_columns = that.jsonld.entities[that.value]['hydra:supportedProperty'].map(obj => obj['hydra:title']); // display empty table @@ -252,7 +256,7 @@ class DataTableView extends LitElement { const that = this; JSONLD.initialize(this.entryPointUrl, function (jsonld) { that.jsonld = jsonld; - that.apiUrl = that.jsonld.getApiUrlForIdentifier("http://schema.org/" + that.value); + that.apiUrl = that.jsonld.getApiUrlForEntityName(that.value); }); this.loadWebPageElement().catch(e => { console.log(e)}); break;