Problem accessing data on AnythingDB

Lander Unai Fariñas Gómez
Lander Unai Fariñas Gómez Altair Community Member
edited April 8 in Community Q&A

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

  • Martin Schoones
    Martin Schoones
    Altair Employee
    edited April 8 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.

Answers

  • Martin Schoones
    Martin Schoones
    Altair Employee
    edited April 8

    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?

  • Lander Unai Fariñas Gómez
    Lander Unai Fariñas Gómez Altair Community Member
    edited April 4

    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.

    image

  • Martin Schoones
    Martin Schoones
    Altair Employee
    edited April 5

    When I do that the following 3 errors appear. I have also tried with other browsers and the result is the same.

    image

    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.

    image

  • Martin Schoones
    Martin Schoones
    Altair Employee
    edited April 5

    When I do that the following 3 errors appear. I have also tried with other browsers and the result is the same.

    image

    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).

  • Lander Unai Fariñas Gómez
    Lander Unai Fariñas Gómez Altair Community Member
    edited April 5

    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.

    image

    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"
    }

  • Lander Unai Fariñas Gómez
    Lander Unai Fariñas Gómez Altair Community Member
    edited April 5

    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.

  • Martin Schoones
    Martin Schoones
    Altair Employee
    edited April 8 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.

  • Lander Unai Fariñas Gómez
    Lander Unai Fariñas Gómez Altair Community Member
    edited April 8

    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.