Problem accessing data on AnythingDB
When I click on a thing I've previously created on AnythingDB the whole page goes blank and I cannot access its data.
Best Answer
-
I posted the JSON in the other reply. The "@type" is not a string but it does have a "type" which is a string. I don't really understand it so I don't know if it means the same thing. I'm going through the documentation right now but I can't make heads or tails of the problem.
The "@type" at the root of the JSON schema is a string. We currently have a known bug in our UI that will cause a javascript error when this "@type" is a string.
Please use the API Inspector to update your schema.
Change it from:
{ "@context": "https://www.w3.org/2019/wot/td/v1", "@type": "ThingTemplate",
To:
{ "@context": "https://www.w3.org/2019/wot/td/v1", "@type": ["ThingTemplate"],
(I omitted the rest of the schema.)
Change the "@type" to an array by adding the square brackets.
0
Answers
-
I would need more information to find out what the underlying issue is.
Can you open the Developer Tools of your browser, go through the same process that causes the page to go blank and see if there are specific (javascript) errors in the console of the Developer Tools?
0 -
Martin Schoones said:
I would need more information to find out what the underlying issue is.
Can you open the Developer Tools of your browser, go through the same process that causes the page to go blank and see if there are specific (javascript) errors in the console of the Developer Tools?
When I do that the following 3 errors appear. I have also tried with other browsers and the result is the same.
0 -
When I do that the following 3 errors appear. I have also tried with other browsers and the result is the same.
Can you use the "API Inspector" from the "Utility Belt" to run `GET /spaces/{space}/things/{thing-uid}` and save the returned JSON? Then post it either in a subsequent message or you can email it to me at mschoones@altair.com.
0 -
When I do that the following 3 errors appear. I have also tried with other browsers and the result is the same.
Does the JSON schema of your things have a string for the "@type" instead of an array of strings? We have a known bug that causes the page to go blank when trying to load the details page of a thing with a string value for the "@type". If this is the case, I suggest you use the API Inspector to update the schema and change the "@type" to an array (even if it only has a single element).
0 -
Martin Schoones said:
Can you use the "API Inspector" from the "Utility Belt" to run `GET /spaces/{space}/things/{thing-uid}` and save the returned JSON? Then post it either in a subsequent message or you can email it to me at mschoones@altair.com.
This is the JSON it returns:
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"@type": "ThingTemplate",
"actions": {
"toggle": {
"description": "Turn the lamp on or off",
"input": {}
}
},
"categories": [],
"created": "2024-03-22T17:15:57.429079938Z",
"description": "Lamp Thing Description Template",
"events": {
"overheating": {
"data": {
"type": "string"
},
"description": "Lamp reaches a critical temperature",
"title": ""
}
},
"href": "/spaces/testlfarinas/things/01HSKJK0KNCVFSXBJZPEC60S5Q",
"id": "https://api.swx.altairone.com/spaces/testlfarinas/things/01HSKJK0KNCVFSXBJZPEC60S5Q",
"model": null,
"modified": "2024-03-22T17:15:57.429079938Z",
"properties": {
"state": {
"description": "current state of the lamp on|off",
"title": "",
"type": "string"
}
},
"title": "Lamp Thing Description Template 0",
"uid": "01HSKJK0KNCVFSXBJZPEC60S5Q"
}0 -
Martin Schoones said:
Does the JSON schema of your things have a string for the "@type" instead of an array of strings? We have a known bug that causes the page to go blank when trying to load the details page of a thing with a string value for the "@type". If this is the case, I suggest you use the API Inspector to update the schema and change the "@type" to an array (even if it only has a single element).
I posted the JSON in the other reply. The "@type" is not a string but it does have a "type" which is a string. I don't really understand it so I don't know if it means the same thing. I'm going through the documentation right now but I can't make heads or tails of the problem.
0 -
I posted the JSON in the other reply. The "@type" is not a string but it does have a "type" which is a string. I don't really understand it so I don't know if it means the same thing. I'm going through the documentation right now but I can't make heads or tails of the problem.
The "@type" at the root of the JSON schema is a string. We currently have a known bug in our UI that will cause a javascript error when this "@type" is a string.
Please use the API Inspector to update your schema.
Change it from:
{ "@context": "https://www.w3.org/2019/wot/td/v1", "@type": "ThingTemplate",
To:
{ "@context": "https://www.w3.org/2019/wot/td/v1", "@type": ["ThingTemplate"],
(I omitted the rest of the schema.)
Change the "@type" to an array by adding the square brackets.
0 -
Martin Schoones said:
The "@type" at the root of the JSON schema is a string. We currently have a known bug in our UI that will cause a javascript error when this "@type" is a string.
Please use the API Inspector to update your schema.
Change it from:
{ "@context": "https://www.w3.org/2019/wot/td/v1", "@type": "ThingTemplate",
To:
{ "@context": "https://www.w3.org/2019/wot/td/v1", "@type": ["ThingTemplate"],
(I omitted the rest of the schema.)
Change the "@type" to an array by adding the square brackets.
Thank you, I changed the type as you suggested and I can see the details of the thing again without the page going blank.
0