{"record":{"id":"8505631456ce947a","repo":"cayleygraph/cayley","slug":"expected-v-to-be-a-string-but-instead-received-t","errorCode":null,"errorMessage":"Expected %v to be a string but instead received %T","messagePattern":"Expected (.+?) to be a string but instead received %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"query/linkedql/steps/jsonld_util.go","lineNumber":40,"sourceCode":"\ta, ok := i.(ldArray)\n\tif ok && len(a) == 1 {\n\t\treturn a[0]\n\t}\n\treturn i\n}\n\n// isomorphic checks whether source and target JSON-LD structures are the same\n// semantically. This function is not complete and is maintained for testing\n// purposes. Hopefully in the future it can be proven sufficient for general\n// purpose use.\nfunc isomorphic(source interface{}, target interface{}) error {\n\tsource = unwrapValue(unwrapSingle(source))\n\ttarget = unwrapValue(unwrapSingle(target))\n\tswitch s := source.(type) {\n\tcase string:\n\t\tt, ok := target.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"Expected %v to be a string but instead received %T\", target, target)\n\t\t}\n\t\tif s != t {\n\t\t\treturn fmt.Errorf(\"Expected \\\"%v\\\" but instead received \\\"%v\\\"\", s, t)\n\t\t}\n\t\treturn nil\n\tcase ldArray:\n\t\tt, ok := target.(ldArray)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"Expected multiple values but instead received the single value: %#v\", target)\n\t\t}\n\t\tif len(s) != len(t) {\n\t\t\treturn fmt.Errorf(\"Expected %#v and %#v to have the same length\", s, t)\n\t\t}\n\titems:\n\t\tfor _, i := range s {\n\t\t\tfor _, tI := range t {\n\t\t\t\tif isomorphic(i, tI) == nil {\n\t\t\t\t\tcontinue items","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/cayleygraph/cayley/blob/81dcd7d73e45136bc0d01802a8ba4685d8a533eb/query/linkedql/steps/jsonld_util.go#L22-L58","documentation":"Error \"Expected %v to be a string but instead received %T\" thrown in cayleygraph/cayley.","triggerScenarios":"Thrown at query/linkedql/steps/jsonld_util.go:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81dcd7d73e45136bc0d01802a8ba4685d8a533eb","analyzedAt":"2026-09-06T06:14:12.358Z","contentChangedAt":"2026-09-06T06:14:12.358Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}