terminusdb-tutorials icon indicating copy to clipboard operation
terminusdb-tutorials copied to clipboard

"team is not a property in Employee" for getting started lesson 5

Open dwinston opened this issue 4 years ago • 5 comments

In getting_started/lesson_5 when I get to

terminusdb alldocs --type Employee -q team=it

the output is

terminusdb_client.errors.InterfaceError: team is not a proerty in Employee

At this point in the lesson, my schema.py has a team property in EmployeesFromCSV but not in Employee.

I am using terminusdb-client==10.0.19 with terminusdb/terminusdb-server:v10.0.4.

dwinston avatar Oct 19 '21 19:10 dwinston

@dwinston I have made some changes last Friday maybe try again with the new code in the tutorial?

Cheukting avatar Oct 26 '21 13:10 Cheukting

Hmm, different error now:

terminusdb_client.errors.DatabaseError:
Error: query_error(unknown_type(enum('terminusdb:///schema#Team',
['terminusdb:///schema#Team/marketing','terminusdb:///schema#Team/it'])))

dwinston avatar Oct 26 '21 17:10 dwinston

The schema appears to be in the db though:

(terminus) mbp-16:getting_started dwinston$ terminusdb alldocs --schema
[
    {
        "@base": "terminusdb:///data/",
        "@documentation": {
            "@authors": [
                "Destiny Norris",
                "Fabian Dalby"
            ],
            "@description": "Database storing all the contact details of all employees in Awesome Startup",
            "@title": "Phonebook for Awesome Startup"
        },
        "@schema": "terminusdb:///schema#",
        "@type": "@context"
    },
    {
        "@documentation": {
            "@comment": "Home address of Employee",
            "@properties": {
                "postcode": "Postal Code",
                "street": "Street name.",
                "street_num": "Street number.",
                "town": "Town name."
            }
        },
        "@id": "Address",
        "@key": {
            "@type": "Random"
        },
        "@subdocument": [],
        "@type": "Class",
        "postcode": "xsd:string",
        "street": "xsd:string",
        "street_num": "xsd:integer",
        "town": "xsd:string"
    },
    {
        "@documentation": {
            "@comment": "Employee of the Company"
        },
        "@id": "Employee",
        "@type": "Class",
        "address": "Address",
        "contact_number": "xsd:string",
        "manager": {
            "@class": "Employee",
            "@type": "Optional"
        },
        "name": "xsd:string",
        "team": "Team",
        "title": "xsd:string"
    },
    {
        "@id": "Team",
        "@type": "Enum",
        "@value": [
            "marketing",
            "it"
        ]
    },
    {
        "@id": "EmployeesFromCSV",
        "@type": "Class",
        "employee_id": "xsd:string",
        "manager": {
            "@class": "EmployeesFromCSV",
            "@type": "Optional"
        },
        "name": {
            "@class": "xsd:string",
            "@type": "Optional"
        },
        "team": {
            "@class": "xsd:string",
            "@type": "Optional"
        },
        "title": {
            "@class": "xsd:string",
            "@type": "Optional"
        }
    }
]

dwinston avatar Oct 26 '21 17:10 dwinston

Hmm, different error now:

terminusdb_client.errors.DatabaseError:
Error: query_error(unknown_type(enum('terminusdb:///schema#Team',
['terminusdb:///schema#Team/marketing','terminusdb:///schema#Team/it'])))

At which step when you get this error?

Cheukting avatar Nov 01 '21 14:11 Cheukting

Hey -- I'm using TerminusX rather than a local database, but received the same error message working through getting_started/lesson_5.

My bet is that it's a TerminusDB Server code bug regarding Enum queries, not a tutorial-specific issue; the query started working for me, presumably because TerminusX was updated.

I'd recommend trying again with the latest release.

mwtillotson avatar Nov 02 '21 23:11 mwtillotson