Skip to main content

QueryPattern

Enum QueryPattern 

Source
pub enum QueryPattern {
    Isa {
        binding: BindingId,
        include_subtypes: bool,
        type_id: TypeId,
    },
    Has {
        attribute: BindingId,
        attribute_id: AttributeId,
        owner: BindingId,
    },
    Links {
        players: Vec<AssertionRolePlayer>,
        relation: BindingId,
        relation_id: TypeId,
    },
    Value {
        comparator: ValueComparator,
        left: QueryOperand,
        right: QueryOperand,
    },
    Or {
        branches: Vec<Vec<QueryPattern>>,
    },
    Not {
        patterns: Vec<QueryPattern>,
    },
    Try {
        patterns: Vec<QueryPattern>,
    },
    Reachable {
        min_depth: u8,
        max_depth: u8,
        relation: TypeId,
        role_from: RoleId,
        role_to: RoleId,
        source: BindingId,
        target: BindingId,
    },
    FunctionCall {
        arguments: Vec<QueryOperand>,
        assigned: BindingId,
        function: FunctionId,
    },
}
Expand description

The closed typed pattern algebra of the first public vocabulary.

Exactly the V1-parity graph shapes: typed isa with optional subtype inclusion, effective-ownership has, role-qualified links, typed value comparison, and negation over a closed conjunction. No variant accepts an arbitrary TypeQL fragment.

Variants§

§

Isa

Constrain a binding to one schema type, optionally including subtypes.

Fields

§binding: BindingId

The constrained binding.

§include_subtypes: bool

Whether transitive subtypes are admitted.

§type_id: TypeId

The exact schema type.

§

Has

Bind an owned attribute through an effective ownership.

Fields

§attribute: BindingId

The bound attribute instance.

§attribute_id: AttributeId

The exact attribute type.

§owner: BindingId

The owning binding.

Bind a relation and role-qualified players.

Fields

§players: Vec<AssertionRolePlayer>

Role-qualified player bindings.

§relation: BindingId

The bound relation instance.

§relation_id: TypeId

The exact relation type.

§

Value

Compare two exact typed scalar operands.

Fields

§comparator: ValueComparator

The closed comparator.

§left: QueryOperand

The left operand.

§right: QueryOperand

The right operand.

§

Or

Require at least one child pattern.

A binding is positively established after this pattern only when every branch establishes it. Branch-local bindings never leak into the outer row environment.

Fields

§branches: Vec<Vec<QueryPattern>>

Non-empty alternative conjunctions in source order.

§

Not

Negate a closed nested conjunction.

Fields

§patterns: Vec<QueryPattern>

The negated conjunction.

§

Try

Optionally match a nested conjunction without filtering rows.

Bindings established only inside the body survive as optional: rows where the body matched carry them, other rows carry an explicit absence. The first optional vocabulary admits isa, has, links, and value comparisons in the body, at the root conjunction only.

Fields

§patterns: Vec<QueryPattern>

The optional conjunction.

§

Reachable

Existential bounded reachability along one role-directed relation.

Holds when the target is reachable from the source in min_depth..=max_depth hops, each hop one relation instance from the role_from player to the role_to player. A zero-hop branch is exact concept identity. Positive branches are finite directed walks: repeated vertices or relation instances are admitted, so cycles cannot make execution unbounded. Proof-path identity is existential and never enters the selected row. Lowering unrolls every admitted length provider-side, never by repeated client queries.

Fields

§min_depth: u8

The inclusive minimum hop count. Zero admits source/target identity.

§max_depth: u8

The inclusive finite maximum hop count.

§relation: TypeId

The exact relation type of every hop.

§role_from: RoleId

The role the hop starts from.

§role_to: RoleId

The role the hop arrives at.

§source: BindingId

The established start binding.

§target: BindingId

The established end binding.

§

FunctionCall

Assign one scalar schema-function result to a binding.

The first function vocabulary admits scalar, non-optional returns only; tuple and stream returns stay reserved behind later capabilities.

Fields

§arguments: Vec<QueryOperand>

Ordered call arguments.

§assigned: BindingId

The binding assigned from the scalar return.

§function: FunctionId

The exact schema function identity.

Trait Implementations§

Source§

impl Clone for QueryPattern

Source§

fn clone(&self) -> QueryPattern

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QueryPattern

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for QueryPattern

Source§

impl PartialEq for QueryPattern

Source§

fn eq(&self, other: &QueryPattern) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for QueryPattern

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for QueryPattern

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.