Refused schema shapes

zanzibar-index refuses some schemas and calls that look reasonable, because each one would otherwise be run with a meaning other than the one written, would give the two evaluation backends different answers, or would break a store. This page lists every documented refusal, grouped by where it happens: while a schema text or a JSON model is parsed, while the object_wildcard_shapes argument is checked, while the graph index’s rules are built, and in the set engine, the store and the graph index API.

Each entry says what is refused, why, what to write instead, and the exception raised. The page is generated from the comments the code keeps beside each refusal, so it cannot drift from the installed version.

Most schema refusals raise zanzibar.SchemaError (a ValueError) with a message that says what is wrong. The entries that raise zanzibar.ShapeNoLongerAccepted are shapes an earlier version accepted; that exception is a SchemaError subclass whose instead attribute is the rewrite that keeps the meaning an older store was serving, and a store whose saved schema uses such a shape raises zanzibar.PersistedSchemaRefused when it is opened.

Plain syntax errors, such as an unclosed [, a missing : after a relation name, an empty restriction list or a stray token, also raise SchemaError; the syntax they break is the grammar. For the accepted language as a whole, see Schema language and its JSON models section; for a worked rewrite, see Rewrite a refused schema shape; for the wildcard forms that have no OpenFGA counterpart, see Wildcard extensions beyond OpenFGA.

Schema text

Refused while a DSL schema is parsed, by parse_openfga_schema(), by Store and by SetEngine alike.

Schema file and header lines

A schema line naming any version but 1.1

Refused, for example: schema 1.2, schema 9.9, schema 1.0, schema abc, a bare schema

Why: Only schema 1.1 is implemented, so a schema 1.2 model (OpenFGA’s modular models) would otherwise run with whatever meaning 1.1 gives it. The JSON front end refuses every schema_version but '1.1' the same way. This is stricter than OpenFGA, which also accepts 1.2.

Instead: schema 1.1. Schema 1.2’s additions (module, extend type) are not supported.

Raises: ShapeNoLongerAccepted (the shape was accepted by version 0.0.4 and earlier).

A model, schema 1.1 or relations line with more words on it

Refused, for example: relations define viewer: [user], model x, relations # c, schema 1.1 # c

Why: These lines are read by their first word, so the rest of the line would be dropped without a word: relations define viewer: [user] would leave viewer undeclared. OpenFGA’s grammar refuses extra words on these lines too.

Instead: One keyword per line, each define on its own line under a bare relations, and a comment on its own line (# people, then relations).

Raises: ShapeNoLongerAccepted (the shape was accepted by version 0.0.4 and earlier).

OpenFGA modules, extend type and condition blocks

Refused, for example: module core, extend type doc, condition in_office(ip: ipaddress) {

Why: Neither feature is implemented. Modules would merge type definitions from several files, and a condition would gate tuples on request context that neither backend evaluates; skipping either would run a schema other than the one written.

Instead: None — write one self-contained schema 1.1 file (move the extend type relations into the type block). Model a condition that is a stored fact as a relation: define viewer: [user] but not suspended.

Raises: SchemaError

A second type block for the same type

Refused, for example: type doc declared twice in one schema

Why: Merging the two blocks would let a duplicate pasted into a schema change its relations without any warning.

Instead: Put every relation of the type under one type doc block.

Raises: SchemaError

A second define of the same relation in one type

Refused, for example: define viewer: [user] and then define viewer: editor under one type doc

Why: The second definition would silently replace the first, so the store would run a schema other than the one written.

Instead: One define joining the arms — define viewer: [user] or editor (and / but not if that is the intended combination).

Raises: SchemaError

A schema that declares no type

Refused, for example: "", whitespace, comments only, or only the model / schema 1.1 header lines

Why: Store(session, "x", schema="") would save the empty schema as the store’s permanent schema. Every later write would be refused, reopening the store with the intended schema would raise SchemaMismatch, and a store cannot be dropped, so the store id would be lost. An empty schema file read from disk is the usual way to get here.

Instead: Declare the types and their relations, for example:

model
  schema 1.1
type user
type doc
  relations
    define viewer: [user]

Raises: SchemaError

Types but no relation anywhere

Refused, for example: type user, or type user / type doc with empty relations blocks

Why: It is the same empty schema as "" and would lose a store id the same way: saved permanently, every write refused, and reopening with the intended schema raising SchemaMismatch.

Instead: Declare the relations, for example:

type user
type doc
  relations
    define viewer: [user]

Raises: SchemaError

Names

A declared type or relation name outside the write identifier charset

Refused, for example: define *: ..., define can view: ..., type d#oc, a non-ASCII or a 257-character name

Why: Every write is held to the identifier charset, so no tuple can ever be written on such a name, yet a computed reference or a from can still reach it. With define *: viewer but not blocked, a valid write on viewer would be refused, and an index maintained asynchronously would stall.

Instead: Name it inside [A-Za-z0-9_/@+=-] (. is also allowed in a type name), e.g. define can_view: [user].

Raises: SchemaError

An empty declared relation name

Refused, for example: define : [user]

Why: No tuple can be written on an empty name, yet a computed reference to it (define : viewer) would still be reached through a valid write on viewer, and there the two evaluation backends would give different answers.

Instead: Name it — define viewer: [user].

Raises: SchemaError

. in a declared relation name

Refused, for example: define can.view: [user]

Why: . is reserved for the names the compiler gives its internal relations (<relation>.<index>), so a *declared* relation name may never contain it. Tuple-side entity names remain unrestricted.

Instead: Use _ — define can_view: [user] rather than can.view.

Raises: SchemaError

. in a referenced name

Refused, for example: [doc#viewer.0], viewer.0, viewer.0 from parent

Why: Names containing . belong to the compiler’s internal relations, so a reference reads or writes compiled state.

Instead: Reference the public relation — [doc#viewer], viewer.

Raises: SchemaError

Operators

or and and mixed in one chain without parentheses

Refused, for example: a or b and c

Why: The grammar gives them no relative precedence, so either reading would be a guess — and the two readings grant different subjects.

Instead: Parenthesise the intended reading: (a or b) and c or a or (b and c).

Raises: SchemaError

but not beside or / and / a second but not at one level

Refused, for example: [user] or a but not b, a but not b or c, a and b but not c, a but not b and c, a but not b but not c

Why: Without parentheses the shape has two readings that grant different subjects: a but not b or c reads as (a but not b) or c, but can also mean a but not (b or c), and only the first admits the members of c. OpenFGA’s grammar refuses the shape too. A store whose saved schema uses it was served the second reading by version 0.0.4 and earlier; the exception’s instead attribute is the rewrite that keeps that meaning.

Instead: Parenthesise the intended reading — (a or b) but not c, a but not (b or c), (a but not b) or c.

Raises: ShapeNoLongerAccepted (the shape was accepted by version 0.0.4 and earlier).

A relation that depends on itself through the right-hand side of a but not

Refused, for example: define viewer: [user] but not viewer from parent where define parent: [doc] links a doc to another doc, or member: [user] but not blocked with blocked: [group#member] on type group

Why: Such a schema has no consistent answer on some data (doc:a parent doc:a makes viewer = not viewer) and several on other data, so there is no single answer for the two evaluation backends to agree on.

Instead: Subtract a relation that does not depend on the one being defined, and put the recursion in it:

define blocked: [user] or blocked from parent
define viewer: [user] but not blocked

A nested x but not (y but not z) is (x but not y) or (x and z), which is positive in z.

Raises: SchemaError

Type restrictions

A conditional type restriction

Refused, for example: [user with in_office]

Why: Neither backend evaluates a condition, and dropping one would make the restriction unconditional — wider access than the model says.

Instead: None — conditions are unsupported. Where the condition is a stored fact, model it as a relation: define viewer: [user] but not suspended.

Raises: SchemaError

A restriction naming a type no type line declares

Refused, for example: define viewer: [usr], [usr:*], [usr#...] with no type usr

Why: A typo here would grant access. Write admission checks a write against the schema, not the schema against itself, so a usr:x write would be admitted and check would answer True. OpenFGA refuses it.

Instead: Declare the type (type usr, anywhere in the schema), or fix the spelling in the restriction ([user]).

Raises: ShapeNoLongerAccepted (the shape was accepted by version 0.0.4 and earlier).

References between relations

[group#member] where group#member is undeclared

Why: The members of an undeclared relation would be nobody, without a word, so a typo would silently deny access. OpenFGA refuses it.

Instead: Declare it (type group / define member: [user]), or write [group] if a group object itself was meant.

Raises: SchemaError

A computed ref to an undeclared relation

Refused, for example: define viewer: [user] or editor, no editor

Why: An undeclared relation would mean “nobody” without a word, so a misspelled relation name would silently deny access. OpenFGA refuses it.

Instead: Declare it on the same type (define editor: [user]), or fix the spelling.

Raises: SchemaError

An undeclared tupleset

Refused, for example: viewer from parent, no parent

Why: No tuple can be stored on an undeclared relation, so the from would find no parent and mean “nobody” without a word; a typo would silently deny access. OpenFGA refuses it.

Instead: Declare the link on the same type, define parent: [folder].

Raises: SchemaError

A from target declared on none of the tupleset’s types

Refused, for example: viewer from parent, parent: [folder], no folder#viewer

Why: No parent object can have the target relation, so the from would mean “nobody” without a word; a typo would silently deny access. OpenFGA refuses it.

Instead: Declare it on the parent type (type folder / define viewer: [user]), or let the tupleset admit a type that has it.

Raises: SchemaError

A cycle of computed / from-tupleset references

Refused, for example: define a: [user] or b + define b: a

Why: A loop of computed references has no single answer: with define a: [user] or b and define b: a, any set that contains the users stored on a satisfies both definitions, so the result would depend on how an evaluator settles the loop. OpenFGA refuses it.

Instead: None for a pure alias loop — delete one direction. Intended recursion goes through stored tuples, which stays legal: define member: [user, group#member] or define viewer: [user] or viewer from parent.

Raises: SchemaError

Tuplesets (the relation after from)

A tupleset with computed, from, and or but not arms

Refused, for example: parent: [folder] or other, parent: [folder] but not blocked under viewer from parent

Why: from follows the tuples stored on the tupleset relation, never its computed members, so any other arm on that relation would be ignored without a word by every from that uses it. OpenFGA refuses the shape too: a relation used as a tupleset must be a direct relation. Allowed are [folder], [folder, doc] and [folder] or [doc].

Instead: Store the links on a relation made only of type restrictions, listing every type the old relation named, and use that one in the from:

define parent_link: [folder]
define viewer: viewer from parent_link

Raises: SchemaError

A userset restriction on a tupleset

Refused, for example: parent: [folder#member] with viewer from parent

Why: from takes the stored subject’s object as the parent and never looks at its predicate, so a stored folder:f#member would mean just folder:f, and the #member would be dropped without a word. OpenFGA refuses it: tupleset relations must be directly assignable types.

Instead: Store the bare link, and spell the userset reading as its own from. Both answer exactly what the refused shape answered:

define parent: [folder]                # was [folder#member]
define parent_member: member from parent   # what `parent` meant
define viewer: viewer from parent      # unchanged

[folder:*#member] becomes [folder:*] the same way.

Raises: SchemaError

JSON models

Refused by parse_openfga_json(), and by Store when schema= is a dict, while it reads an OpenFGA JSON model. A refused model raises SchemaError, like a refused DSL text.

A schema_version other than "1.1"

Refused, for example: "1.2", or the field left out

Why: Only the 1.1 format is implemented: its directly_related_user_types metadata is where this gets its type restrictions. An unsupported feature is refused, never skipped.

Instead: Supply the model as "schema_version": "1.1", or write it in the DSL.

Raises: SchemaError

Model-level conditions

Refused, for example: a "conditions" object beside "type_definitions"

Why: Neither backend evaluates a condition, and skipping one would let its tuples grant access unconditionally, which is wider access than the model says.

Instead: None: conditions are not supported. Where the condition is a stored fact, model it as a relation, for example define viewer: [user] but not suspended.

Raises: SchemaError

Two type_definitions entries for the same type

Refused, for example: two {"type": "doc", ...} entries

Why: The second entry would replace the first one’s relations without a word, so the store would run a different schema from the one written. The DSL refuses a second type block the same way.

Instead: Merge both entries’ relations and metadata into one type definition.

Raises: SchemaError

. in a declared relation name

Refused, for example: a "can.view" key under "relations"

Why: Names containing . belong to the compiler’s internal relations (<relation>.<index>). The DSL refuses them too.

Instead: Use _: can_view, not can.view.

Raises: SchemaError

Type definitions none of which has a relation

Refused, for example: [{"type": "user"}], or "relations": {} on every type

Why: It is the same empty schema as a model with no type_definitions: a store would save it as its permanent schema, refuse every write, and the store id would be lost.

Instead: Give some type a relation, for example:

{"type": "doc",
 "relations": {"viewer": {"this": {}}},
 "metadata": {"relations": {"viewer":
   {"directly_related_user_types": [{"type": "user"}]}}}}

Raises: SchemaError

A model with no type_definitions

Refused, for example: the field absent, null or []

Why: It is an empty schema. A store would save it as its permanent schema and then refuse every write, and since a store cannot be dropped, the store id would be lost.

Instead: List the types, for example:

"type_definitions": [
  {"type": "user"},
  {"type": "doc",
   "relations": {"viewer": {"this": {}}},
   "metadata": {"relations": {"viewer":
     {"directly_related_user_types": [{"type": "user"}]}}}}]

Raises: SchemaError

A field the OpenFGA model format defines as an object, given as some other JSON kind

Refused, for example: the model itself as null or a list, a type definition as a string, "relations": ["viewer"], a computedUserset body as a bare string

Why: The model cannot be read as written. The error names the field, so the mistake can be found.

Instead: The object form, for example {"type": "doc", "relations": {"viewer": {"computedUserset": {"relation": "owner"}}}}.

Raises: SchemaError

A field the OpenFGA model format defines as an array, given as some other JSON kind

Refused, for example: "type_definitions": "user", "child": null, "directly_related_user_types": "user"

Why: The model cannot be read as written, and a string in place of an array would be read as a list of its characters.

Instead: The array form, for example "directly_related_user_types": [{"type": "user"}].

Raises: SchemaError

A required string field that is missing or not a string

Refused, for example: a type definition with no "type", a computedUserset with no "relation", a tupleToUserset with no "tupleset" relation

Why: The model cannot be read without it. The error names the field.

Instead: Give the field, for example {"type": "doc"} or {"computedUserset": {"relation": "owner"}}.

Raises: SchemaError

A JSON object naming the same key twice

Refused, for example: two "viewer" relations, two "schema_version" fields

Why: A JSON reader keeps the last value without a word, so the store would run a schema nobody wrote as such. The DSL refuses a second define viewer the same way.

Instead: One entry per key. Merge two definitions of a relation into one, for example:

"viewer": {"union": {"child": [
  {"this": {}},
  {"computedUserset": {"relation": "owner"}}]}}

Raises: SchemaError

"wildcard" set to anything but {} or null

Refused, for example: false, 0, "", {"enabled": false}

Why: A wildcard restriction grants access to every subject of the type, and these values read as “not a wildcard”. OpenFGA never writes them, so any reading would be a guess, and the wrong guess grants public access.

Instead: {"type": "user", "wildcard": {}} for [user:*]; leave the key out for [user].

Raises: SchemaError

A JSON model whose DSL rendering is a different schema

Refused, for example: a name holding ], ,, a line break or a space, such as a restriction {"type": "user,group"}

Why: A JSON model is stored as its DSL rendering, so the store would run a schema the JSON never declared, and could admit writes on a relation it never had. The name checks usually refuse such a model first, with a more specific message; this check is the last guard.

Instead: Keep every name inside the identifier charset, for example {"type": "user"}.

Raises: SchemaError

A conditional type restriction

Refused, for example: {"type": "user", "condition": "in_office"}

Why: Conditions are not supported, and dropping one would make the restriction unconditional, which is wider access than the model says.

Instead: None. Remove condition only if the unconditional grant is what you mean, or model the condition as a relation ([user] but not suspended).

Raises: SchemaError

An unknown rewrite operator

Refused, for example: a misspelt key such as computedUserSet

Why: Skipping an unknown node would drop an arm of the relation without a word. An unsupported feature is refused, never skipped.

Instead: None. Use this, computedUserset, tupleToUserset, union, intersection or difference.

Raises: SchemaError

Object-wildcard shapes

The object_wildcard_shapes argument is checked against the schema it comes with, by parse_openfga_schema(), Store and SetEngine alike.

An object_wildcard_shapes entry that is not a pair of strings

Refused, for example: "doc:viewer", ("doc",), ("doc", "viewer", "x")

Why: Read as a pair, a two-character string would split into a one-letter type and relation, and other values would fail later with an error that does not name the entry. Neither is what the caller meant.

Instead: A set of (object_type, relation) tuples, for example object_wildcard_shapes={("doc", "viewer")}.

Raises: ShapeNoLongerAccepted (the shape was accepted by version 0.0.5 and earlier).

An object_wildcard_shapes entry naming an undeclared type

Refused, for example: ("nosuch", "viewer")

Why: No nosuch:* object can ever be written, so the entry would do nothing while the caller believes an object wildcard is enabled: a typo that silently denies.

Instead: Name a type the schema declares, ("doc", "viewer") for type doc, or drop the entry; dropping it changes no answer.

Raises: ShapeNoLongerAccepted (the shape was accepted by version 0.0.5 and earlier).

An object_wildcard_shapes entry naming a relation the type does not declare

Refused, for example: ("doc", "nosuchrel"), or a name containing . such as ("doc", "viewer.0")

Why: No grant on doc:* can ever be written to that relation, so the entry would do nothing. A name containing . is never a declared relation.

Instead: Name a relation the type declares (define viewer: ... gives ("doc", "viewer")), or drop the entry.

Raises: ShapeNoLongerAccepted (the shape was accepted by version 0.0.5 and earlier).

Shapes the graph index cannot compile

The schema is valid, but the graph index cannot serve it. parse_openfga_schema() and Store raise these, because both build the graph index’s rules; a standalone SetEngine runs every one of these schemas except a shape that is wildcarded on both sides, which both backends refuse. Three entries are reached only through lower-level calls: enable_boolean=False passed to parse_openfga_schema() or compile_ruleset(), and a schema tree built by hand and passed to compile_ruleset().

and or but not compiled with enable_boolean=False

Refused, for example: parse_openfga_schema(schema, enable_boolean=False) or compile_ruleset(ast, schema_info, enable_boolean=False)

Why: That flag asks for the plain rule set only, which cannot express and or but not.

Instead: Compile with the default, enable_boolean=True.

Raises: UnsupportedByGraphIndex

A from in a plain relation that reaches a relation using and or but not, in a schema tree built by hand

Refused, for example: the parsed tree of define parent: [folder] and define reader: viewer from parent on doc, with define viewer: [user] but not banned on folder, after deleting its ("doc", "parent") entry and passing it to compile_ruleset

Why: Compiled as a plain rule, the from would give the graph index different answers from the set engine. A schema text never gets here: the parser refuses the undeclared tupleset, and an accepted schema of this shape compiles correctly.

Instead: Write the schema as text and parse it, with the tupleset declared as a direct relation:

define parent: [folder]
define reader: viewer from parent

Raises: UnsupportedByGraphIndex

A tupleset with computed, from, and or but not arms, in a schema tree built by hand

Why: from follows the tuples stored on the tupleset relation, never its computed members, so any other arm would be ignored without a word. In a schema text the parser refuses this shape first; see Tuplesets.

Instead: Store the links on a direct relation and use that one in the from:

define parent_link: [folder]
define viewer: viewer from parent_link

Raises: UnsupportedByGraphIndex

A shape wildcarded on both sides

Refused, for example: [group:*#member] in a restriction while ("group", "member") is also an object-wildcard shape

Why: A wildcard write on such a shape would make the graph index refuse every later ordinary write of that shape, so neither backend runs the schema. Neither form exists in OpenFGA.

Instead: Drop one of the two. Either write [group#member] instead of [group:*#member] (closest legal form: it covers only the groups written, not every group), or remove the shape from object_wildcard_shapes. The shape can also arrive through a from, so the declared shape to remove may be the one the from reads.

Raises: DoublyBridgedShapeError

An object-wildcard shape on a relation that uses and or but not

Refused, for example: ("doc", "viewer") with define viewer: [user] but not banned

Why: The graph index cannot keep a grant on every object of a type for a relation that uses and or but not.

Instead: None in the graph index. Drop the shape from object_wildcard_shapes and grant on concrete objects (this covers only the objects written, not every object).

Raises: UnsupportedByGraphIndex

An object-wildcard shape naming one of the compiler’s internal relations

Refused, for example: ("doc", "viewer.0")

Why: Names containing . belong to the compiler’s internal relations and are never declared by a schema. In practice the check described under Object-wildcard shapes refuses such a name first.

Instead: Name the declared relation, ("doc", "viewer"), subject to the refusal above.

Raises: UnsupportedByGraphIndex

An object-wildcard shape that the rewrite rules carry into a relation that uses and or but not

Refused, for example: ("doc", "editor") with define viewer: editor but not banned

Why: The graph index cannot carry a grant on every object into a relation that uses and or but not.

Instead: None. Drop the shape, or drop the arm of the and / but not relation that reads the wildcarded relation (that changes its answers).

Raises: UnsupportedByGraphIndex

An object-wildcard shape on the tupleset of a from inside a relation that uses and or but not

Refused, for example: ("doc", "parent") with define viewer: (viewer from parent) but not banned

Why: That relation reads the stored parent tuples directly, so a doc:* parent tuple would be invisible to it: wrong denials, with nothing to report them.

Instead: Drop the shape and write one concrete parent tuple per object, folder:f parent doc:d; this covers only the objects written.

Raises: UnsupportedByGraphIndex

An object-wildcard shape on the target of a from inside a relation that uses and or but not

Refused, for example: ("folder", "viewer") with define viewer: (viewer from parent) but not banned on doc

Why: That relation reads the parents’ concrete grants and never sees a grant on every folder, so it would deny wrongly.

Instead: Drop the shape and grant on concrete folders, user:alice viewer folder:f; this covers only the folders written.

Raises: UnsupportedByGraphIndex

A star tupleset [folder:*] whose from target uses and or but not

Refused, for example: define parent: [folder, folder:*] and define viewer: viewer from parent on doc, with define viewer: [user] but not banned on folder

Why: It amounts to a wildcard userset over a relation that uses and or but not, which the graph index cannot evaluate.

Instead: define parent: [folder] and one parent tuple per folder (closest legal form: it covers only the folders written).

Raises: UnsupportedByGraphIndex

A wildcard userset over a relation that uses and or but not

Refused, for example: [group:*#member] with define member: [user] but not banned on group

Why: “The members of every group” over such a relation is a set the graph index cannot evaluate.

Instead: [group#member] with one tuple per group (closest legal form: it covers only the groups written), or make group#member a plain relation.

Raises: UnsupportedByGraphIndex

Relations that use and or but not and depend on themselves

Refused, for example: define member: [user, group#member] but not banned, where the recursion runs through the type restriction group#member

Why: The graph index evaluates relations that use and or but not in dependency order, and a relation that depends on itself has no place in that order. A standalone set engine evaluates the schema. A loop through the right-hand side of a but not is refused earlier, when the schema is parsed (see “Operators” above).

Instead: Recurse on a plain relation and apply the operator on top:

define member_base: [user, group#member_base]
define member: member_base but not banned

This is not equivalent: banned is subtracted once, at the group queried, not at every level of nesting. Excluding at every level has no form the graph index accepts.

Raises: CyclicDerivedDependency

Set engine

Refused by a standalone SetEngine.

A direct set-engine write on a store id that a Store owns

Refused, for example: SetEngine.add_tuple or remove_tuple on an id with a saved schema

Why: The write would change the stored tuples with no tuple-log row, so the graph index, replicas and at_least tokens would never see it while lag() reports 0. An unlogged removal would leave the grant allowed by Store.check, and the store could then no longer revoke it.

Instead: Write through Store.add_tuple / Store.remove_tuple. For a standalone set engine, use a store id no Store owns.

Raises: UnloggedWriteRefused

A shape wildcarded on both sides, in a standalone set engine

Refused, for example: [group:*#member] while ("group", "member") is also an object-wildcard shape

Why: The same refusal as under “Shapes the graph index cannot compile” above. The set engine runs the other shapes listed there, but refuses this one too, so that both backends refuse it alike.

Instead: Drop one of the two, as described there.

Raises: DoublyBridgedShapeError

Opening a store

Refused by Store when it opens.

Opening a Store on a store id whose tuples were written without the tuple log

Refused, for example: tuples written with SetEngine.add_tuple on store id "s1", then Store(session, "s1", schema=schema)

Why: A standalone set engine writes tuples without the tuple log. A new store’s graph index is built from the tuple log, so those tuples would be invisible to it: check would answer False where the set engine answers True, and removing one would be reported as corruption.

Instead: Open it with Store.adopt(session, store_id, schema=schema), which builds the index from the stored tuples; leave schema= out if the store already has a saved schema.

Raises: UnloggedTuplesPresent

Graph index maintenance

Refused by WildcardIndex.remove_node(), part of the low-level graph index API. A Store has no call that removes a node.

Removing a node whose type and relation the schema’s rewrites copy tuples to or from

Refused, for example: on define viewer: editor, removing doc:x#editor

Why: The write path stores a copy of each such tuple on another node, and remove_node deletes one node’s edges without running the rewrites, so the copies would outlive their originals. In the example, the editors of doc:x would stay viewers.

Instead: Remove the node’s tuples through the write path: route each one through RuleSet.apply() and remove every edge it yields with WildcardIndex.remove_tuple(); on a schema that uses and or but not, then call DeltaProcessor.run_cascade() in the same transaction.

Raises: AdmissionRejected