cayleygraph/cayley · error
Expected multiple values but instead received the single val
Error message
Expected multiple values but instead received the single value: %#v
What it means
Error "Expected multiple values but instead received the single value: %#v" thrown in cayleygraph/cayley.
Source
Thrown at query/linkedql/steps/jsonld_util.go:49
// purposes. Hopefully in the future it can be proven sufficient for general
// purpose use.
func isomorphic(source interface{}, target interface{}) error {
source = unwrapValue(unwrapSingle(source))
target = unwrapValue(unwrapSingle(target))
switch s := source.(type) {
case string:
t, ok := target.(string)
if !ok {
return fmt.Errorf("Expected %v to be a string but instead received %T", target, target)
}
if s != t {
return fmt.Errorf("Expected \"%v\" but instead received \"%v\"", s, t)
}
return nil
case ldArray:
t, ok := target.(ldArray)
if !ok {
return fmt.Errorf("Expected multiple values but instead received the single value: %#v", target)
}
if len(s) != len(t) {
return fmt.Errorf("Expected %#v and %#v to have the same length", s, t)
}
items:
for _, i := range s {
for _, tI := range t {
if isomorphic(i, tI) == nil {
continue items
}
}
return fmt.Errorf("No matching values for the item %#v in %#v", i, t)
}
return nil
case ldMap:
t, ok := target.(ldMap)
if !ok {
return fmt.Errorf("Expected %#v to be a map or a slice with a single map but instead received %T", target, target)View on GitHub (pinned to 81dcd7d73e)
When it happens
Trigger: Thrown at query/linkedql/steps/jsonld_util.go:49 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of cayleygraph/cayley@81dcd7d73e (2026-09-06).
Data as JSON: /api/errors/2dfefae2139244e5.
Report an issue: GitHub.