cayleygraph/cayley · error

Expected "%v" but instead received "%v"

Error message

Expected "%v" but instead received "%v"

What it means

Error "Expected "%v" but instead received "%v"" thrown in cayleygraph/cayley.

Source

Thrown at query/linkedql/steps/jsonld_util.go:43

	}
	return i
}

// isomorphic checks whether source and target JSON-LD structures are the same
// semantically. This function is not complete and is maintained for testing
// 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)

View on GitHub (pinned to 81dcd7d73e)

When it happens

Trigger: Thrown at query/linkedql/steps/jsonld_util.go:43 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/43d7aa3c78bcbcd8. Report an issue: GitHub.