diff --git a/libs/@local/graph/migrations/graph-migrations/v010__query/down.sql b/libs/@local/graph/migrations/graph-migrations/v010__query/down.sql new file mode 100644 index 00000000000..6624e7c954f --- /dev/null +++ b/libs/@local/graph/migrations/graph-migrations/v010__query/down.sql @@ -0,0 +1 @@ +DROP TYPE CONTINUATION; diff --git a/libs/@local/graph/migrations/graph-migrations/v010__query/mod.rs b/libs/@local/graph/migrations/graph-migrations/v010__query/mod.rs new file mode 100644 index 00000000000..ef889d4e2ba --- /dev/null +++ b/libs/@local/graph/migrations/graph-migrations/v010__query/mod.rs @@ -0,0 +1,43 @@ +use error_stack::Report; +use hash_graph_migrations::{Context, Migration}; +use tokio_postgres::Client; +use tracing::Instrument as _; + +pub struct Query; + +impl Migration for Query { + type Context = Client; + type Error = tokio_postgres::Error; + + async fn up( + self, + context: &mut ::Transaction<'_>, + ) -> Result<(), Report> { + context + .simple_query(include_str!("up.sql")) + .instrument(tracing::info_span!( + "BATCH", + otel.kind = "client", + db.system = "postgresql", + peer.service = "Postgres", + )) + .await?; + Ok(()) + } + + async fn down( + self, + context: &mut ::Transaction<'_>, + ) -> Result<(), Report> { + context + .simple_query(include_str!("down.sql")) + .instrument(tracing::info_span!( + "BATCH", + otel.kind = "client", + db.system = "postgresql", + peer.service = "Postgres", + )) + .await?; + Ok(()) + } +} diff --git a/libs/@local/graph/migrations/graph-migrations/v010__query/up.sql b/libs/@local/graph/migrations/graph-migrations/v010__query/up.sql new file mode 100644 index 00000000000..a44ec06b328 --- /dev/null +++ b/libs/@local/graph/migrations/graph-migrations/v010__query/up.sql @@ -0,0 +1 @@ +CREATE TYPE continuation AS (filter boolean, block int, locals int [], values jsonb []); diff --git a/libs/@local/graph/postgres-store/postgres_migrations/V49__query.sql b/libs/@local/graph/postgres-store/postgres_migrations/V49__query.sql new file mode 100644 index 00000000000..a7c40941b25 --- /dev/null +++ b/libs/@local/graph/postgres-store/postgres_migrations/V49__query.sql @@ -0,0 +1 @@ +CREATE TYPE continuation AS (filter boolean, block int, locals int[], values jsonb[]); diff --git a/libs/@local/graph/postgres-store/src/store/mod.rs b/libs/@local/graph/postgres-store/src/store/mod.rs index ecb8d00a5cc..c7c32581581 100644 --- a/libs/@local/graph/postgres-store/src/store/mod.rs +++ b/libs/@local/graph/postgres-store/src/store/mod.rs @@ -3,7 +3,7 @@ pub mod error; mod config; mod validation; -pub(crate) mod postgres; +pub mod postgres; pub use self::{ config::{DatabaseConnectionInfo, DatabasePoolConfig, DatabaseType}, diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/compile.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/compile.rs index 5bda409b63c..a8ea98f3bbf 100644 --- a/libs/@local/graph/postgres-store/src/store/postgres/query/compile.rs +++ b/libs/@local/graph/postgres-store/src/store/postgres/query/compile.rs @@ -18,8 +18,9 @@ use type_system::knowledge::Entity; use super::expression::{JoinType, TableName, TableReference}; use crate::store::postgres::query::{ - Alias, Column, Distinctness, EqualityOperator, Expression, Function, PostgresQueryPath, - PostgresRecord, SelectExpression, SelectStatement, Table, Transpile as _, WindowStatement, + Alias, Column, Distinctness, EqualityOperator, Expression, Function, Identifier, + PostgresQueryPath, PostgresRecord, SelectExpression, SelectStatement, Table, Transpile as _, + WindowStatement, expression::{FromItem, GroupByExpression, PostgresType}, table::{ DataTypeEmbeddings, DatabaseColumn as _, EntityEditions, EntityEmbeddings, @@ -440,7 +441,7 @@ impl<'p, 'q: 'p, R: PostgresRecord> SelectCompiler<'p, 'q, R> { .map(|filter| self.compile_filter(filter)) .collect::>()?, ), - Filter::Not(filter) => Expression::not(self.compile_filter(filter)?), + Filter::Not(filter) => self.compile_filter(filter)?.not(), Filter::Equal(lhs, rhs) => Expression::equal( self.compile_filter_expression(lhs).0, self.compile_filter_expression(rhs).0, @@ -616,7 +617,7 @@ impl<'p, 'q: 'p, R: PostgresRecord> SelectCompiler<'p, 'q, R> { parameter_expression, )), )), - alias: Some("distance"), + alias: Some(Identifier::from("distance")), })) .collect(), ) @@ -744,7 +745,7 @@ impl<'p, 'q: 'p, R: PostgresRecord> SelectCompiler<'p, 'q, R> { Column::OntologyIds(OntologyIds::BaseUrl).aliased(alias), )), ), - alias: Some("latest_version"), + alias: Some(Identifier::from("latest_version")), }, ]) .from( diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs index 19abb85f7c8..38b7cdf10e4 100644 --- a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs +++ b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs @@ -4,7 +4,7 @@ use core::fmt::{ use hash_graph_store::filter::PathToken; -use super::ColumnReference; +use super::{ColumnName, ColumnReference}; use crate::store::postgres::query::{ SelectStatement, Table, Transpile, WindowStatement, expression::{ @@ -17,6 +17,7 @@ use crate::store::postgres::query::{ pub enum Function { Min(Box), Max(Box), + JsonAgg(Box), JsonExtractText(Box), JsonExtractAsText(Box, PathToken<'static>), JsonExtractPath(Vec), @@ -33,7 +34,7 @@ pub enum Function { }, Lower(Box), Upper(Box), - Unnest(Box), + Unnest(Vec), Now, } @@ -54,6 +55,11 @@ impl Transpile for Function { expression.transpile(fmt)?; fmt.write_char(')') } + Self::JsonAgg(expression) => { + fmt.write_str("jsonb_agg(")?; + expression.transpile(fmt)?; + fmt.write_char(')') + } Self::JsonExtractPath(paths) => { fmt.write_str("jsonb_extract_path(")?; for (i, expression) in paths.iter().enumerate() { @@ -118,7 +124,15 @@ impl Transpile for Function { } Self::Unnest(expression) => { fmt.write_str("UNNEST(")?; - expression.transpile(fmt)?; + + for (index, element) in expression.iter().enumerate() { + if index > 0 { + fmt.write_str(", ")?; + } + + element.transpile(fmt)?; + } + fmt.write_char(')') } Self::JsonPathQueryFirst(target, path) => { @@ -149,8 +163,10 @@ impl Transpile for Function { #[derive(Debug, Clone, PartialEq, Eq)] pub enum Constant { + Null, Boolean(bool), - UnsignedInteger(u32), + U32(u32), + U128(u128), /// The JSON `null` literal, distinct from SQL `NULL`. /// /// Transpiles to `'null'::jsonb`. @@ -165,15 +181,17 @@ impl From for Constant { impl From for Constant { fn from(value: u32) -> Self { - Self::UnsignedInteger(value) + Self::U32(value) } } impl Transpile for Constant { fn transpile(&self, fmt: &mut fmt::Formatter) -> fmt::Result { match self { + Self::Null => write!(fmt, "NULL"), Self::Boolean(value) => fmt.write_str(if *value { "TRUE" } else { "FALSE" }), - Self::UnsignedInteger(number) => fmt::Display::fmt(number, fmt), + Self::U32(number) => fmt::Display::fmt(number, fmt), + Self::U128(number) => fmt::Display::fmt(number, fmt), Self::JsonNull => fmt.write_str("'null'::jsonb"), } } @@ -184,7 +202,12 @@ pub enum PostgresType { Array(Box), Row(Table), Text, + JsonB, JsonPath, + Continuation, + Numeric, + Int, + BigInt, } impl Transpile for PostgresType { @@ -196,7 +219,12 @@ impl Transpile for PostgresType { } Self::Row(table) => table.transpile(fmt), Self::Text => fmt.write_str("text"), + Self::JsonB => fmt.write_str("jsonb"), Self::JsonPath => fmt.write_str("jsonpath"), + Self::Continuation => fmt.write_str("continuation"), + Self::Numeric => fmt.write_str("numeric"), + Self::Int => fmt.write_str("int"), + Self::BigInt => fmt.write_str("bigint"), } } } @@ -223,6 +251,27 @@ pub enum Expression { Function(Function), Window(Box, WindowStatement), Cast(Box, PostgresType), + /// Composite field access - extracts a named field from a composite/row type value. + /// + /// Transpiles to `()."field"` in PostgreSQL. This is the SQL standard mechanism + /// for decomposing composite types (created via `ROW(...)::type` or returned from + /// subqueries) into individual field values. + /// + /// Distinct from [`ColumnReference`], which resolves a column name within a table's + /// namespace. `FieldAccess` operates on a runtime composite *value*. + /// + /// Corresponds to `A_Indirection` in PostgreSQL's parse tree and + /// `CompoundFieldAccess` in sqlparser-rs. + /// + /// # Example SQL + /// ```sql + /// (f0.c).filter + /// (ROW(1, 'hello')::my_type).name + /// ``` + FieldAccess { + expr: Box, + field: ColumnName<'static>, + }, /// Row expansion - expands a composite type into its constituent columns. /// /// Transpiles to `(expression).*` in PostgreSQL, which is used to expand @@ -265,6 +314,7 @@ pub enum Expression { } /// Convenience constructors for condition variants to avoid `Box::new()` boilerplate. +#[expect(clippy::should_implement_trait)] impl Expression { #[must_use] pub const fn all(conditions: Vec) -> Self { @@ -283,10 +333,10 @@ impl Expression { } #[must_use] - pub fn not(inner: Self) -> Self { + pub fn not(self) -> Self { Self::Unary(UnaryExpression { op: UnaryOperator::Not, - expr: Box::new(inner), + expr: Box::new(self), }) } @@ -494,8 +544,8 @@ impl Expression { } #[must_use] - pub fn grouped(inner: Self) -> Self { - Self::Grouped(Box::new(inner)) + pub fn grouped(self) -> Self { + Self::Grouped(Box::new(self)) } #[must_use] @@ -512,12 +562,23 @@ impl Expression { pub fn contains_segment(lhs: Self, rhs: Self) -> Self { Self::ContainsSegment(Box::new(lhs), Box::new(rhs)) } + + #[must_use] + pub fn cast(self, r#type: PostgresType) -> Self { + Self::Cast(Box::new(self), r#type) + } } impl Transpile for Expression { fn transpile(&self, fmt: &mut fmt::Formatter) -> fmt::Result { match self { // --- Value expressions --- + Self::FieldAccess { expr, field } => { + fmt.write_char('(')?; + expr.transpile(fmt)?; + fmt.write_str(").")?; + field.transpile(fmt) + } Self::ColumnReference(column) => column.transpile(fmt), Self::Parameter(index) => write!(fmt, "${index}"), Self::Constant(constant) => constant.transpile(fmt), @@ -627,7 +688,8 @@ mod tests { use super::*; use crate::store::postgres::query::{ - Alias, PostgresQueryPath as _, SelectCompiler, test_helper::max_version_expression, + Alias, Identifier, PostgresQueryPath as _, SelectCompiler, + test_helper::max_version_expression, }; #[test] @@ -739,6 +801,97 @@ mod tests { assert_eq!(empty_array.transpile_to_string(), "ARRAY[]::text[]"); } + #[test] + fn transpile_null_constant() { + assert_eq!( + Expression::Constant(Constant::Null).transpile_to_string(), + "NULL" + ); + } + + #[test] + fn transpile_u128_constant() { + assert_eq!( + Expression::Constant(Constant::U128(0xFFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF)) + .transpile_to_string(), + "340282366920938463463374607431768211455" + ); + } + + #[test] + fn transpile_json_agg() { + assert_eq!( + Expression::Function(Function::JsonAgg(Box::new(Expression::Parameter(1)))) + .transpile_to_string(), + "jsonb_agg($1)" + ); + } + + #[test] + fn transpile_unnest_multiple() { + assert_eq!( + Expression::Function(Function::Unnest(vec![ + Expression::Parameter(1), + Expression::Parameter(2), + Expression::Parameter(3), + ])) + .transpile_to_string(), + "UNNEST($1, $2, $3)" + ); + } + + #[test] + fn transpile_field_access() { + assert_eq!( + Expression::FieldAccess { + expr: Box::new(Expression::Parameter(1)), + field: ColumnName::from(Identifier::from("filter")), + } + .transpile_to_string(), + r#"($1)."filter""# + ); + } + + #[test] + fn transpile_is_not_false() { + assert_eq!( + Expression::Unary(UnaryExpression { + op: UnaryOperator::IsNotFalse, + expr: Box::new(Expression::Parameter(1)), + }) + .transpile_to_string(), + "$1 IS NOT FALSE" + ); + } + + #[test] + fn transpile_cast_types() { + assert_eq!( + Expression::Parameter(1) + .cast(PostgresType::JsonB) + .transpile_to_string(), + "($1::jsonb)" + ); + assert_eq!( + Expression::Parameter(1) + .cast(PostgresType::Numeric) + .transpile_to_string(), + "($1::numeric)" + ); + assert_eq!( + Expression::Parameter(1) + .cast(PostgresType::Int) + .transpile_to_string(), + "($1::int)" + ); + assert_eq!( + Expression::Parameter(1) + .cast(PostgresType::BigInt) + .transpile_to_string(), + "($1::bigint)" + ); + } + fn test_condition<'p, 'f: 'p>( filter: &'f Filter<'p, DataTypeWithMetadata>, rendered: &'static str, diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/from_item.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/from_item.rs index ec93ebcc8f5..740b535a155 100644 --- a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/from_item.rs +++ b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/from_item.rs @@ -343,6 +343,7 @@ impl<'id> FromItem<'id> { } /// Creates a NATURAL JOIN using matching column names. + #[must_use] pub fn natural_join(self, r#type: JoinType, from: impl Into) -> Self { Self::NaturalJoin { left: Box::new(self), @@ -352,6 +353,7 @@ impl<'id> FromItem<'id> { } /// Creates a CROSS JOIN (cartesian product). + #[must_use] pub fn cross_join(self, from: impl Into) -> Self { Self::CrossJoin { left: Box::new(self), @@ -1040,9 +1042,9 @@ mod tests { fn transpile_function() { // Function without alias assert_eq!( - FromItem::function(Function::Unnest(Box::new(Expression::ColumnReference( + FromItem::function(Function::Unnest(vec![Expression::ColumnReference( Column::DataTypes(DataTypes::OntologyId).into() - ),))) + ),])) .build() .transpile_to_string(), r#"UNNEST("data_types"."ontology_id")"# @@ -1050,9 +1052,9 @@ mod tests { // Function with alias assert_eq!( - FromItem::function(Function::Unnest(Box::new(Expression::ColumnReference( + FromItem::function(Function::Unnest(vec![Expression::ColumnReference( Column::DataTypes(DataTypes::OntologyId).into() - ),))) + ),])) .alias(TableReference { schema: None, name: TableName::from("ids"), @@ -1066,9 +1068,9 @@ mod tests { #[test] fn transpile_function_with_column_aliases() { - let from_item = FromItem::function(Function::Unnest(Box::new( - Expression::ColumnReference(Column::DataTypes(DataTypes::OntologyId).into()), - ))) + let from_item = FromItem::function(Function::Unnest(vec![Expression::ColumnReference( + Column::DataTypes(DataTypes::OntologyId).into(), + )])) .alias(TableReference { schema: None, name: TableName::from("ids"), @@ -1085,9 +1087,9 @@ mod tests { #[test] fn transpile_function_with_ordinality() { - let from_item = FromItem::function(Function::Unnest(Box::new( - Expression::ColumnReference(Column::DataTypes(DataTypes::OntologyId).into()), - ))) + let from_item = FromItem::function(Function::Unnest(vec![Expression::ColumnReference( + Column::DataTypes(DataTypes::OntologyId).into(), + )])) .with_ordinality(true) .build(); @@ -1099,9 +1101,9 @@ mod tests { #[test] fn transpile_function_with_ordinality_and_alias() { - let from_item = FromItem::function(Function::Unnest(Box::new( - Expression::ColumnReference(Column::DataTypes(DataTypes::OntologyId).into()), - ))) + let from_item = FromItem::function(Function::Unnest(vec![Expression::ColumnReference( + Column::DataTypes(DataTypes::OntologyId).into(), + )])) .with_ordinality(true) .alias(TableReference { schema: None, @@ -1128,9 +1130,9 @@ mod tests { assert_eq!( base.join( JoinType::LeftOuter, - FromItem::function(Function::Unnest(Box::new(Expression::ColumnReference( + FromItem::function(Function::Unnest(vec![Expression::ColumnReference( Column::DataTypes(DataTypes::OntologyId).into(), - )))) + )])) .alias(TableReference { schema: None, name: TableName::from("unnested_ids"), diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/mod.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/mod.rs index e3dd609b30a..5a8ff813dc8 100644 --- a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/mod.rs +++ b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/mod.rs @@ -18,8 +18,12 @@ pub use self::{ binary::{BinaryExpression, BinaryOperator}, column_reference::{ColumnName, ColumnReference}, conditional::{Constant, EqualityOperator, Expression, Function, PostgresType}, - from_item::FromItem, + from_item::{ + FromItem, FromItemFunctionBuilder, FromItemJoinBuilder, FromItemSubqueryBuilder, + FromItemTableBuilder, + }, group_by_clause::GroupByExpression, + identifier::Identifier, join_type::JoinType, order_clause::OrderByExpression, select_clause::SelectExpression, diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/select_clause.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/select_clause.rs index da95651a13a..04ba303c66e 100644 --- a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/select_clause.rs +++ b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/select_clause.rs @@ -1,6 +1,6 @@ use core::fmt::{self, Write as _}; -use super::TableReference; +use super::{TableReference, identifier::Identifier}; use crate::store::postgres::query::{Expression, Transpile}; /// A SELECT clause item. @@ -14,7 +14,7 @@ pub enum SelectExpression { /// Transpiles to: `expression` or `expression AS "alias"`. Expression { expression: Expression, - alias: Option<&'static str>, + alias: Option>, }, /// Asterisk wildcard selecting all columns. /// @@ -29,7 +29,8 @@ impl Transpile for SelectExpression { Self::Expression { expression, alias } => { expression.transpile(fmt)?; if let Some(alias) = alias { - write!(fmt, r#" AS "{alias}""#)?; + fmt.write_str(" AS ")?; + alias.transpile(fmt)?; } Ok(()) } @@ -97,7 +98,7 @@ mod tests { }) )) ), - alias: Some("latest_version") + alias: Some(Identifier::from("latest_version")) } .transpile_to_string(), r#"MAX("ontology_ids_1_2_3"."version") OVER (PARTITION BY "ontology_ids_1_2_3"."base_url") AS "latest_version""# diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/unary.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/unary.rs index 9eca8bb4e7a..1c36949320c 100644 --- a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/unary.rs +++ b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/unary.rs @@ -16,6 +16,8 @@ pub enum UnaryOperator { Negate, /// `~` BitwiseNot, + /// ` IS NOT FALSE` + IsNotFalse, } #[derive(Debug, Clone, PartialEq)] @@ -55,6 +57,10 @@ impl Transpile for UnaryExpression { self.expr.transpile(fmt)?; fmt.write_char(')') } + UnaryOperator::IsNotFalse => { + self.expr.transpile(fmt)?; + fmt.write_str(" IS NOT FALSE") + } } } } diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/with_clause.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/with_clause.rs index 407c16b57b2..7ba2ed157bd 100644 --- a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/with_clause.rs +++ b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/with_clause.rs @@ -57,7 +57,7 @@ impl Transpile for WithExpression { mod tests { use super::*; use crate::store::postgres::query::{ - Alias, SelectExpression, SelectStatement, + Alias, Identifier, SelectExpression, SelectStatement, expression::FromItem, test_helper::{max_version_expression, trim_whitespace}, }; @@ -74,7 +74,7 @@ mod tests { SelectExpression::Asterisk(None), SelectExpression::Expression { expression: max_version_expression(), - alias: Some("latest_version"), + alias: Some(Identifier::from("latest_version")), }, ]) .from( diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/mod.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/mod.rs index 11ec1956bf8..fc20c4f8ed6 100644 --- a/libs/@local/graph/postgres-store/src/store/postgres/query/mod.rs +++ b/libs/@local/graph/postgres-store/src/store/postgres/query/mod.rs @@ -10,7 +10,7 @@ mod expression; mod property_type; pub(crate) mod rows; mod statement; -pub(crate) mod table; +pub mod table; use core::{ convert::identity, @@ -31,8 +31,11 @@ use type_system::knowledge::{Entity, PropertyValue}; pub use self::{ compile::{SelectCompiler, SelectCompilerError}, expression::{ - Constant, EqualityOperator, Expression, Function, SelectExpression, WhereExpression, - WithExpression, + BinaryExpression, BinaryOperator, ColumnName, ColumnReference, Constant, EqualityOperator, + Expression, FromItem, FromItemFunctionBuilder, FromItemJoinBuilder, + FromItemSubqueryBuilder, FromItemTableBuilder, Function, Identifier, JoinType, + PostgresType, SelectExpression, TableName, TableReference, UnaryExpression, UnaryOperator, + VariadicExpression, WhereExpression, WithExpression, }, statement::{ Distinctness, InsertStatementBuilder, SelectStatement, Statement, WindowStatement, diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/statement/insert.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/statement/insert.rs index f1816aabf50..bbc39ad0dfc 100644 --- a/libs/@local/graph/postgres-store/src/store/postgres/query/statement/insert.rs +++ b/libs/@local/graph/postgres-store/src/store/postgres/query/statement/insert.rs @@ -164,12 +164,12 @@ impl<'p> InsertStatementBuilder<'p> { values: InsertValueItem::Query(Box::new( SelectStatement::builder() .selects(vec![SelectExpression::Asterisk(None)]) - .from(FromItem::function(Function::Unnest(Box::new( + .from(FromItem::function(Function::Unnest(vec![ Expression::Cast( Box::new(Expression::Parameter(1)), PostgresType::Array(Box::new(PostgresType::Row(table))), ), - )))) + ]))) .build(), )), }, diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/statement/select.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/statement/select.rs index 3f10b19f70c..c0888403e1b 100644 --- a/libs/@local/graph/postgres-store/src/store/postgres/query/statement/select.rs +++ b/libs/@local/graph/postgres-store/src/store/postgres/query/statement/select.rs @@ -22,6 +22,7 @@ pub struct SelectStatement { #[builder(default)] pub group_by_expression: GroupByExpression, pub limit: Option, + pub offset: Option, } #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -82,6 +83,11 @@ impl Transpile for SelectStatement { write!(fmt, "LIMIT {limit}")?; } + if let Some(offset) = self.offset { + fmt.write_char('\n')?; + write!(fmt, "OFFSET {offset}")?; + } + Ok(()) } } @@ -117,7 +123,8 @@ mod tests { use uuid::Uuid; use crate::store::postgres::query::{ - Distinctness, PostgresRecord, SelectCompiler, test_helper::trim_whitespace, + Distinctness, PostgresRecord, SelectCompiler, SelectExpression, SelectStatement, + Transpile as _, test_helper::trim_whitespace, }; #[track_caller] @@ -1280,6 +1287,20 @@ mod tests { ); } + #[test] + fn transpile_offset() { + let statement = SelectStatement::builder() + .selects(vec![SelectExpression::Asterisk(None)]) + .limit(10) + .offset(20) + .build(); + + assert_eq!( + trim_whitespace(&statement.transpile_to_string()), + "SELECT * LIMIT 10 OFFSET 20" + ); + } + mod predefined { use type_system::{ knowledge::entity::id::{EntityId, EntityUuid}, diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/table.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/table.rs index 8e3b708eb2b..e5e76391404 100644 --- a/libs/@local/graph/postgres-store/src/store/postgres/query/table.rs +++ b/libs/@local/graph/postgres-store/src/store/postgres/query/table.rs @@ -833,6 +833,7 @@ pub enum EntityTemporalMetadata { } impl EntityTemporalMetadata { + #[must_use] pub const fn from_time_axis(time_axis: TimeAxis) -> Self { match time_axis { TimeAxis::DecisionTime => Self::DecisionTime, @@ -1888,12 +1889,14 @@ pub enum ForeignKeyReference { } impl ForeignKeyReference { + #[must_use] pub const fn join_type(self) -> JoinType { match self { Self::Single { join_type, .. } | Self::Double { join_type, .. } => join_type, } } + #[must_use] pub const fn table(self) -> Table { match self { Self::Single { join, .. } => join.table(), @@ -1925,6 +1928,7 @@ impl ForeignKeyReference { } } + #[must_use] pub fn conditions(self, on_alias: Alias, join_alias: Alias) -> Vec { match self { Self::Single { @@ -2168,9 +2172,7 @@ impl Relation { Expression::ColumnReference( column.aliased(table.alias.unwrap_or_default()), ), - Expression::Constant(Constant::UnsignedInteger( - inheritance_depth, - )), + Expression::Constant(Constant::U32(inheritance_depth)), )] }) }) diff --git a/libs/@local/hashql/core/src/id/mod.rs b/libs/@local/hashql/core/src/id/mod.rs index 333dc42c41b..9248e4b0b4a 100644 --- a/libs/@local/hashql/core/src/id/mod.rs +++ b/libs/@local/hashql/core/src/id/mod.rs @@ -2,6 +2,7 @@ mod array; pub mod bit_vec; mod index; mod slice; +pub mod snapshot_vec; mod union_find; mod vec; @@ -16,7 +17,8 @@ use ::core::sync::atomic; pub use hashql_macros::{Id, define_id as newtype}; pub use self::{ - array::IdArray, index::IntoSliceIndex, slice::IdSlice, union_find::IdUnionFind, vec::IdVec, + array::IdArray, index::IntoSliceIndex, slice::IdSlice, snapshot_vec::IdSnapshotVec, + union_find::IdUnionFind, vec::IdVec, }; /// Represents errors that can occur when converting values to an [`Id`]. @@ -432,6 +434,7 @@ macro_rules! newtype_collections { ($vis:vis type $name:ident* from $id:ty) => { $vis type ${concat($name, Slice)} = $crate::id::IdSlice<$id, T>; $vis type ${concat($name, Vec)} = $crate::id::IdVec<$id, T, A>; + $vis type ${concat($name, SnapshotVec)} = $crate::id::IdSnapshotVec<$id, T, S, A>; $vis type ${concat($name, UnionFind)} = $crate::id::IdUnionFind<$id, A>; $vis type ${concat($name, Set)} = $crate::collections::FastHashSet<$id, A>; diff --git a/libs/@local/hashql/core/src/id/snapshot_vec.rs b/libs/@local/hashql/core/src/id/snapshot_vec.rs new file mode 100644 index 00000000000..8f4324b8745 --- /dev/null +++ b/libs/@local/hashql/core/src/id/snapshot_vec.rs @@ -0,0 +1,800 @@ +//! Snapshot-capable vector with typed ID indexing. +//! +//! Provides [`IdSnapshotVec`], which combines the typed indexing of [`IdVec`] with transactional +//! snapshot/rollback support. Mutations are tracked automatically when a snapshot is active and +//! can be undone by rolling back to a previous [`Snapshot`]. +//! +//! # Examples +//! +//! ``` +//! use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; +//! +//! newtype!(struct NodeId(u32 is 0..=1000)); +//! +//! let mut vec = IdSnapshotVec::::new(); +//! let first = vec.push("hello"); +//! let second = vec.push("world"); +//! +//! let snapshot = vec.snapshot(); +//! vec.push("extra"); +//! vec.set(first, "replaced"); +//! assert_eq!(vec.len(), 3); +//! assert_eq!(vec[first], "replaced"); +//! +//! vec.rollback_to(snapshot); +//! assert_eq!(vec.len(), 2); +//! assert_eq!(vec[first], "hello"); +//! assert_eq!(vec[second], "world"); +//! ``` +//! +//! [`IdVec`]: super::IdVec + +use alloc::{alloc::Global, vec}; +use core::{ + alloc::Allocator, + borrow::Borrow, + fmt::{self, Debug}, + hash::{Hash, Hasher}, + mem, + ops::Deref, +}; + +use super::{Id, IdVec, slice::IdSlice}; + +/// Defines how custom mutations are undone during rollback. +/// +/// Built-in implementations: +/// - [`AppendOnly`]: no custom deltas, only push/pop/set tracking. +/// +/// Implement this trait to support custom undo actions recorded via +/// [`IdSnapshotVec::record`]. +pub trait UndoStrategy { + /// The undo record stored when [`IdSnapshotVec::record`] is called. + type Delta; + + /// Applies a [`Delta`](Self::Delta) to the backing storage, restoring previous state. + fn reverse(values: &mut IdVec, delta: Self::Delta); +} + +/// No custom undo actions. Only push/pop/set operations are tracked. +/// +/// This is the default [`UndoStrategy`] for [`IdSnapshotVec`]. +pub struct AppendOnly; + +impl UndoStrategy for AppendOnly { + type Delta = (); + + fn reverse(_: &mut IdVec, (): ()) {} +} + +enum LogEntry, A: Allocator = Global> { + Push, + Pop(T), + Set(I, T), + Clear(IdVec), + Delta(S::Delta), +} + +struct Log, A: Allocator = Global> { + tape: Vec, A>, + open: usize, +} + +impl> Log { + const fn new() -> Self { + Self { + tape: Vec::new(), + open: 0, + } + } +} + +impl, A: Allocator> Log { + const fn new_in(alloc: A) -> Self { + Self { + tape: Vec::new_in(alloc), + open: 0, + } + } + + const fn recording(&self) -> bool { + self.open > 0 + } + + const fn start(&mut self) -> Snapshot { + self.open += 1; + Snapshot { + tape_len: self.tape.len(), + } + } + + #[expect(clippy::needless_pass_by_value)] + fn rollback(&mut self, snapshot: Snapshot, container: &mut IdVec) + where + I: Id, + { + self.assert(&snapshot); + self.open -= 1; + + while self.tape.len() > snapshot.tape_len { + let entry = self.tape.pop().expect("tape length verified by loop guard"); + + match entry { + LogEntry::Push => { + container + .pop() + .expect("Push log entry implies non-empty vec"); + } + LogEntry::Pop(value) => { + container.push(value); + } + LogEntry::Clear(previous) => { + *container = previous; + } + LogEntry::Set(index, old_value) => { + container[index] = old_value; + } + LogEntry::Delta(delta) => { + S::reverse(container, delta); + } + } + } + } + + #[expect(clippy::needless_pass_by_value)] + fn commit(&mut self, snapshot: Snapshot) { + self.assert(&snapshot); + self.open -= 1; + + if self.open == 0 { + self.tape.clear(); + } + } + + fn assert(&self, snapshot: &Snapshot) { + assert!( + self.tape.len() >= snapshot.tape_len, + "snapshot tape_len exceeds current tape length" + ); + assert!(self.open > 0, "no open snapshot to commit or rollback"); + } +} + +/// Opaque snapshot token for [`IdSnapshotVec`]. +/// +/// Must be consumed by [`IdSnapshotVec::rollback_to`] or [`IdSnapshotVec::commit`] in stack +/// (LIFO) order. Dropping a `Snapshot` without consuming it will not undo changes, but +/// subsequent snapshot operations may panic. +pub struct Snapshot { + tape_len: usize, +} + +/// A snapshot-capable vector that uses typed IDs for indexing. +/// +/// Combines the typed indexing of [`IdVec`] with transactional snapshot/rollback support. +/// Mutations via [`push`], [`pop`], and [`set`] are tracked automatically when a snapshot is +/// active. On rollback, all changes since the snapshot are undone in reverse order. +/// +/// Custom undo actions can be recorded via [`record`] when using a non-default [`UndoStrategy`]. +/// +/// The API is not complete by design, new methods will be added as needed. +/// +/// [`push`]: IdSnapshotVec::push +/// [`pop`]: IdSnapshotVec::pop +/// [`set`]: IdSnapshotVec::set +/// [`record`]: IdSnapshotVec::record +pub struct IdSnapshotVec = AppendOnly, A: Allocator = Global> { + inner: IdVec, + log: Log, +} + +#[coverage(off)] +impl IdSnapshotVec +where + I: Id, +{ + /// No allocation is performed until elements are pushed. + #[inline] + #[must_use] + pub const fn new() -> Self { + Self { + inner: IdVec::new(), + log: Log::new(), + } + } + + /// Pre-allocates storage for at least `capacity` elements. The undo log is not + /// pre-allocated. + #[inline] + #[must_use] + pub fn with_capacity(capacity: usize) -> Self { + Self { + inner: IdVec::with_capacity(capacity), + log: Log::new(), + } + } +} + +#[coverage(off)] +impl IdSnapshotVec +where + I: Id, +{ + /// Wraps an existing [`IdVec`] with snapshot/rollback support. + /// + /// The elements already in `inner` are retained. No snapshot is active initially. + /// + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, IdVec, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct NodeId(u32 is 0..=1000)); + /// + /// let mut plain = IdVec::::new(); + /// plain.push(10); + /// plain.push(20); + /// + /// let mut vec = IdSnapshotVec::from_vec(plain); + /// assert_eq!(vec.len(), 2); + /// + /// let snap = vec.snapshot(); + /// vec.push(30); + /// vec.rollback_to(snap); + /// assert_eq!(vec.len(), 2); + /// ``` + #[inline] + pub fn from_vec(inner: IdVec) -> Self + where + A: Clone, + { + Self { + log: Log::new_in(inner.allocator().clone()), + inner, + } + } +} + +#[coverage(off)] +impl, A: Allocator> IdSnapshotVec +where + I: Id, +{ + /// Both the backing storage and the undo log are allocated in `alloc`. + #[inline] + pub fn new_in(alloc: A) -> Self + where + A: Clone, + { + Self { + inner: IdVec::new_in(alloc.clone()), + log: Log::new_in(alloc), + } + } + + /// Appends `value` and returns the assigned ID. Tracked for rollback when a snapshot is + /// active. + /// + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct NodeId(u32 is 0..=1000)); + /// + /// let mut vec = IdSnapshotVec::::new(); + /// let first = vec.push("kept"); + /// + /// let snap = vec.snapshot(); + /// vec.push("temporary"); + /// assert_eq!(vec.len(), 2); + /// + /// vec.rollback_to(snap); + /// assert_eq!(vec.len(), 1); + /// assert_eq!(vec[first], "kept"); + /// ``` + #[inline] + pub fn push(&mut self, value: T) -> I { + if self.log.recording() { + self.log.tape.push(LogEntry::Push); + } + + self.inner.push(value) + } + + /// Removes and returns the last element. Tracked for rollback when a snapshot is active. + /// + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct NodeId(u32 is 0..=1000)); + /// + /// let mut vec = IdSnapshotVec::::new(); + /// vec.push(10); + /// vec.push(20); + /// + /// let snap = vec.snapshot(); + /// assert_eq!(vec.pop(), Some(20)); + /// assert_eq!(vec.len(), 1); + /// + /// vec.rollback_to(snap); + /// assert_eq!(vec.len(), 2); + /// assert_eq!(vec[NodeId::new(1)], 20); + /// ``` + #[inline] + pub fn pop(&mut self) -> Option + where + T: Clone, + { + let value = self.inner.pop()?; + + if self.log.recording() { + self.log.tape.push(LogEntry::Pop(value.clone())); + } + + Some(value) + } + + /// Replaces the element at `index` and returns the old value. Tracked for rollback when a + /// snapshot is active. + /// + /// # Panics + /// + /// Panics if `index` is out of bounds. + /// + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct NodeId(u32 is 0..=1000)); + /// + /// let mut vec = IdSnapshotVec::::new(); + /// let id = vec.push("original"); + /// + /// let snap = vec.snapshot(); + /// let old = vec.set(id, "replaced"); + /// assert_eq!(old, "original"); + /// assert_eq!(vec[id], "replaced"); + /// + /// vec.rollback_to(snap); + /// assert_eq!(vec[id], "original"); + /// ``` + #[inline] + pub fn set(&mut self, index: I, value: T) -> T + where + T: Clone, + { + let previous = mem::replace(&mut self.inner[index], value); + + if self.log.recording() { + self.log.tape.push(LogEntry::Set(index, previous.clone())); + } + + previous + } + + /// Applies `op` to the element at `index` in-place. Tracked for rollback when a snapshot + /// is active. + /// + /// # Panics + /// + /// Panics if `index` is out of bounds. + /// + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct NodeId(u32 is 0..=1000)); + /// + /// let mut vec = IdSnapshotVec::::new(); + /// let id = vec.push("hello".to_string()); + /// + /// let snap = vec.snapshot(); + /// vec.update(id, |value| value.push_str(" world")); + /// assert_eq!(vec[id], "hello world"); + /// + /// vec.rollback_to(snap); + /// assert_eq!(vec[id], "hello"); + /// ``` + #[inline] + pub fn update(&mut self, index: I, op: impl FnOnce(&mut T)) + where + T: Clone, + { + if self.log.recording() { + self.log + .tape + .push(LogEntry::Set(index, self.inner[index].clone())); + } + + op(&mut self.inner[index]); + } + + /// Records a custom undo delta. + /// + /// When the current snapshot is rolled back, [`UndoStrategy::reverse`] will be called with + /// this delta. Has no effect if no snapshot is active. + #[inline] + pub fn record(&mut self, delta: S::Delta) { + if self.log.recording() { + self.log.tape.push(LogEntry::Delta(delta)); + } + } + + /// Reserves capacity for at least `additional` more elements in the backing storage. + #[inline] + pub fn reserve(&mut self, additional: usize) { + self.inner.reserve(additional); + } + + /// Removes all elements. Tracked for rollback when a snapshot is active. + /// + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct NodeId(u32 is 0..=1000)); + /// + /// let mut vec = IdSnapshotVec::::new(); + /// vec.push(1); + /// vec.push(2); + /// vec.push(3); + /// + /// let snap = vec.snapshot(); + /// vec.clear(); + /// assert!(vec.is_empty()); + /// + /// vec.rollback_to(snap); + /// assert_eq!(vec.len(), 3); + /// assert_eq!(vec[NodeId::new(2)], 3); + /// ``` + pub fn clear(&mut self) + where + A: Clone, + { + if !self.log.recording() { + self.inner.clear(); + return; + } + + let replacement = + IdVec::with_capacity_in(self.inner.raw.capacity(), self.inner.allocator().clone()); + let previous = mem::replace(&mut self.inner, replacement); + + self.log.tape.push(LogEntry::Clear(previous)); + } + + /// Begins a new snapshot. + /// + /// All mutations after this call can be undone by passing the returned [`Snapshot`] to + /// [`rollback_to`], or kept by passing it to [`commit`]. Snapshots may be nested but must + /// be consumed in stack (LIFO) order. + /// + /// [`rollback_to`]: IdSnapshotVec::rollback_to + /// [`commit`]: IdSnapshotVec::commit + /// + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct NodeId(u32 is 0..=1000)); + /// + /// let mut vec = IdSnapshotVec::::new(); + /// vec.push(1); + /// + /// let snap = vec.snapshot(); + /// vec.push(2); + /// vec.push(3); + /// assert_eq!(vec.len(), 3); + /// + /// vec.rollback_to(snap); + /// assert_eq!(vec.len(), 1); + /// ``` + #[inline] + pub const fn snapshot(&mut self) -> Snapshot { + self.log.start() + } + + /// Undoes all changes made since `snapshot` was created. + /// + /// Changes are undone in reverse order: pushes are popped, pops are re-pushed, and sets + /// restore their previous values. + /// + /// # Panics + /// + /// Panics if `snapshot` is consumed out of stack order. + /// + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct NodeId(u32 is 0..=1000)); + /// + /// let mut vec = IdSnapshotVec::::new(); + /// let id = vec.push(100); + /// + /// let snap = vec.snapshot(); + /// vec.set(id, 999); + /// vec.push(200); + /// vec.push(300); + /// + /// // All three mutations are undone at once. + /// vec.rollback_to(snap); + /// assert_eq!(vec.len(), 1); + /// assert_eq!(vec[id], 100); + /// ``` + #[inline] + pub fn rollback_to(&mut self, snapshot: Snapshot) { + self.log.rollback(snapshot, &mut self.inner); + } + + /// Keeps all changes made since `snapshot` was created. + /// + /// If this is the outermost snapshot, the undo log is cleared. Otherwise, the entries remain + /// available for an outer rollback. + /// + /// # Panics + /// + /// Panics if `snapshot` is consumed out of stack order. + /// + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct NodeId(u32 is 0..=1000)); + /// + /// let mut vec = IdSnapshotVec::::new(); + /// vec.push(1); + /// + /// let outer = vec.snapshot(); + /// vec.push(2); + /// + /// let inner = vec.snapshot(); + /// vec.push(3); + /// vec.commit(inner); // keeps `3`, but outer snapshot can still undo it + /// + /// vec.rollback_to(outer); + /// assert_eq!(vec.len(), 1); + /// assert_eq!(vec[NodeId::new(0)], 1); + /// ``` + #[inline] + pub fn commit(&mut self, snapshot: Snapshot) { + self.log.commit(snapshot); + } + + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct NodeId(u32 is 0..=1000)); + /// + /// let mut vec = IdSnapshotVec::::new(); + /// vec.push(10); + /// vec.push(20); + /// + /// let slice = vec.as_slice(); + /// assert_eq!(slice[NodeId::new(0)], 10); + /// assert_eq!(slice.len(), 2); + /// ``` + #[inline] + #[must_use] + pub fn as_slice(&self) -> &IdSlice { + &self.inner + } +} + +/// Map-like APIs for `IdSnapshotVec>`. +#[coverage(off)] +impl>, A: Allocator> IdSnapshotVec, S, A> +where + I: Id, +{ + /// Extends the vector with `None` until it can hold `index`. Each appended element is + /// individually tracked for rollback, so the extension is fully reversible. + /// + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct MyId(u32 is 0..=100)); + /// + /// let mut vec = IdSnapshotVec::>::new(); + /// + /// let snap = vec.snapshot(); + /// vec.fill_until(MyId::new(3)); + /// assert_eq!(vec.len(), 4); + /// assert!(vec[MyId::new(0)].is_none()); + /// + /// vec.rollback_to(snap); + /// assert!(vec.is_empty()); + /// ``` + pub fn fill_until(&mut self, index: I) { + let new_length = index.as_usize() + 1; + + while self.inner.len() < new_length { + self.push(None); + } + } + + /// Inserts a value at the given ID index, expanding the vector with `None` if necessary. + /// + /// All extensions and the replacement are tracked for rollback. + /// + /// # Examples + /// + /// ``` + /// use hashql_core::id::{Id as _, newtype, snapshot_vec::IdSnapshotVec}; + /// + /// newtype!(struct MyId(u32 is 0..=100)); + /// + /// let mut vec = IdSnapshotVec::>::new(); + /// + /// let snap = vec.snapshot(); + /// vec.insert(MyId::new(2), "hello".to_string()); + /// assert_eq!(vec.len(), 3); + /// assert_eq!(vec[MyId::new(2)].as_deref(), Some("hello")); + /// + /// vec.rollback_to(snap); + /// assert!(vec.is_empty()); + /// ``` + pub fn insert(&mut self, index: I, value: T) -> Option + where + T: Clone, + { + self.fill_until(index); + + self.set(index, Some(value)) + } +} + +impl> Default for IdSnapshotVec +where + I: Id, +{ + #[inline] + fn default() -> Self { + Self { + inner: IdVec::new(), + log: Log::new(), + } + } +} + +impl, A: Allocator> Deref for IdSnapshotVec +where + I: Id, +{ + type Target = IdSlice; + + #[inline] + fn deref(&self) -> &Self::Target { + &self.inner + } +} + +impl, A: Allocator> Borrow> for IdSnapshotVec +where + I: Id, +{ + #[inline] + fn borrow(&self) -> &IdSlice { + self + } +} + +impl, A: Allocator> IntoIterator for IdSnapshotVec +where + I: Id, +{ + type IntoIter = vec::IntoIter; + type Item = T; + + #[inline] + fn into_iter(self) -> Self::IntoIter { + self.inner.into_iter() + } +} + +impl, A: Allocator> PartialEq for IdSnapshotVec +where + T: PartialEq, +{ + #[inline] + fn eq(&self, other: &Self) -> bool { + self.inner == other.inner + } +} + +impl, A: Allocator> Eq for IdSnapshotVec where T: Eq {} + +impl, A: Allocator> Hash for IdSnapshotVec +where + T: Hash, +{ + #[inline] + fn hash(&self, state: &mut H) { + self.inner.hash(state); + } +} + +impl, A: Allocator> Debug for IdSnapshotVec +where + T: Debug, +{ + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + Debug::fmt(&self.inner, fmt) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + crate::id::newtype!(#[id(crate = crate)] struct TestId(u32 is 0..=1000)); + + #[test] + fn nested_snapshots() { + let mut vec = IdSnapshotVec::::new(); + vec.push(1); + + let outer = vec.snapshot(); + vec.push(2); + + let inner = vec.snapshot(); + vec.push(3); + vec.set(TestId::new(0), 99); + assert_eq!(vec.len(), 3); + + vec.rollback_to(inner); + assert_eq!(vec.len(), 2); + assert_eq!(vec[TestId::new(0)], 1); + assert_eq!(vec[TestId::new(1)], 2); + + vec.rollback_to(outer); + assert_eq!(vec.len(), 1); + assert_eq!(vec[TestId::new(0)], 1); + } + + #[test] + fn no_snapshot_no_tracking() { + let mut vec = IdSnapshotVec::::new(); + vec.push(1); + vec.push(2); + vec.set(TestId::new(0), 99); + + assert_eq!(vec.log.tape.len(), 0); + } + + #[test] + #[should_panic(expected = "no open snapshot")] + fn double_commit_panics() { + let mut vec = IdSnapshotVec::::new(); + let snap = vec.snapshot(); + vec.commit(snap); + + vec.commit(Snapshot { tape_len: 0 }); + } + + #[test] + fn empty_snapshot_roundtrip() { + let mut vec = IdSnapshotVec::::new(); + + let snap = vec.snapshot(); + vec.rollback_to(snap); + assert!(vec.is_empty()); + + let snap = vec.snapshot(); + vec.commit(snap); + assert!(vec.is_empty()); + } +} diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/entity.rs b/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/entity.rs index cf430046c71..375c4591b76 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/entity.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/entity.rs @@ -11,6 +11,7 @@ pub(in crate::module::std_lib) struct Entity { _dependencies: ( std_lib::core::uuid::Uuid, std_lib::graph::types::principal::actor_group::web::Web, + std_lib::graph::types::ontology::Ontology, ), } @@ -21,6 +22,7 @@ impl<'heap> StandardLibraryModule<'heap> for Entity { heap.intern_symbol("entity") } + #[expect(clippy::too_many_lines)] fn define(lib: &mut StandardLibrary<'_, 'heap>) -> ModuleDef<'heap> { let mut def = ModuleDef::new(); let heap = lib.heap; @@ -86,12 +88,162 @@ impl<'heap> StandardLibraryModule<'heap> for Entity { ItemDef::newtype(lib.ty.env, entity_record_id_ty, &[]), ); - // newtype LinkData = (left_entity_id: EntityId, right_entity_id: EntityId) + // newtype TemporalInterval = Unknown + // + // Opaque wrapper for `LeftClosedTemporalInterval`. The internal structure (start bound, + // end bound) is not exposed to the HashQL type system; the placement resolver only needs + // the field name prefix (`temporal_versioning.decision_time`). + let temporal_interval_ty = lib.ty.opaque( + "::graph::types::knowledge::entity::TemporalInterval", + lib.ty.unknown(), + ); + def.push( + heap.intern_symbol("TemporalInterval"), + ItemDef::newtype(lib.ty.env, temporal_interval_ty, &[]), + ); + + // newtype EntityTemporalMetadata = ( + // decision_time: TemporalInterval, + // transaction_time: TemporalInterval, + // ) + let temporal_metadata_ty = lib.ty.opaque( + "::graph::types::knowledge::entity::EntityTemporalMetadata", + lib.ty.r#struct([ + ("decision_time", temporal_interval_ty), + ("transaction_time", temporal_interval_ty), + ]), + ); + def.push( + heap.intern_symbol("EntityTemporalMetadata"), + ItemDef::newtype(lib.ty.env, temporal_metadata_ty, &[]), + ); + + // newtype Confidence = Number + let confidence_ty = lib.ty.opaque( + "::graph::types::knowledge::entity::Confidence", + lib.ty.number(), + ); + def.push( + heap.intern_symbol("Confidence"), + ItemDef::newtype(lib.ty.env, confidence_ty, &[]), + ); + + // newtype InferredEntityProvenance = Unknown + // + // JSONB blob in `entity_ids.provenance`. Contains `created_by_id`, + // `created_at_transaction_time`, `created_at_decision_time`, and optional + // `first_non_draft_created_at_*` timestamps. + let inferred_provenance_ty = lib.ty.opaque( + "::graph::types::knowledge::entity::InferredEntityProvenance", + lib.ty.unknown(), + ); + def.push( + heap.intern_symbol("InferredEntityProvenance"), + ItemDef::newtype(lib.ty.env, inferred_provenance_ty, &[]), + ); + + // newtype EntityEditionProvenance = Unknown + // + // JSONB blob in `entity_editions.provenance`. Contains `created_by_id`, + // optional `archived_by_id`, `actor_type`, `OriginProvenance`, and + // `Vec`. + let edition_provenance_ty = lib.ty.opaque( + "::graph::types::knowledge::entity::EntityEditionProvenance", + lib.ty.unknown(), + ); + def.push( + heap.intern_symbol("EntityEditionProvenance"), + ItemDef::newtype(lib.ty.env, edition_provenance_ty, &[]), + ); + + // newtype EntityProvenance = ( + // inferred: InferredEntityProvenance, + // edition: EntityEditionProvenance, + // ) + let entity_provenance_ty = lib.ty.opaque( + "::graph::types::knowledge::entity::EntityProvenance", + lib.ty.r#struct([ + ("inferred", inferred_provenance_ty), + ("edition", edition_provenance_ty), + ]), + ); + def.push( + heap.intern_symbol("EntityProvenance"), + ItemDef::newtype(lib.ty.env, entity_provenance_ty, &[]), + ); + + // newtype PropertyProvenance = Unknown + // + // JSONB blob on entity edges (`entity_edge.provenance`). Just + // `Vec`. + let property_provenance_ty = lib.ty.opaque( + "::graph::types::knowledge::entity::PropertyProvenance", + lib.ty.unknown(), + ); + def.push( + heap.intern_symbol("PropertyProvenance"), + ItemDef::newtype(lib.ty.env, property_provenance_ty, &[]), + ); + + // newtype PropertyObjectMetadata = Unknown + // + // JSONB blob in `entity_editions.property_metadata`. Contains per-property-key + // metadata (confidence, provenance) rather than property values. + let property_object_metadata_ty = lib.ty.opaque( + "::graph::types::knowledge::entity::PropertyObjectMetadata", + lib.ty.unknown(), + ); + def.push( + heap.intern_symbol("PropertyObjectMetadata"), + ItemDef::newtype(lib.ty.env, property_object_metadata_ty, &[]), + ); + + // newtype EntityMetadata = ( + // record_id: EntityRecordId, + // temporal_versioning: EntityTemporalMetadata, + // entity_type_ids: List, + // archived: Boolean, + // provenance: EntityProvenance, + // confidence: Option, + // properties: PropertyObjectMetadata, + // ) + let versioned_url = lib + .manifest::() + .expect_newtype(heap.intern_symbol("VersionedUrl")); + let entity_metadata_ty = lib.ty.opaque( + "::graph::types::knowledge::entity::EntityMetadata", + lib.ty.r#struct([ + ("record_id", entity_record_id_ty), + ("temporal_versioning", temporal_metadata_ty), + ("entity_type_ids", lib.ty.list(versioned_url.id)), + ("archived", lib.ty.boolean()), + ("provenance", entity_provenance_ty), + ("confidence", option(lib, confidence_ty)), + ("properties", property_object_metadata_ty), + ]), + ); + def.push( + heap.intern_symbol("EntityMetadata"), + ItemDef::newtype(lib.ty.env, entity_metadata_ty, &[]), + ); + + // newtype LinkData = ( + // left_entity_id: EntityId, + // right_entity_id: EntityId, + // left_entity_confidence: Option, + // left_entity_provenance: PropertyProvenance, + // right_entity_confidence: Option, + // right_entity_provenance: PropertyProvenance, + // ) let link_data_ty = lib.ty.opaque( "::graph::types::knowledge::entity::LinkData", lib.ty.r#struct([ ("left_entity_id", entity_id_ty), ("right_entity_id", entity_id_ty), + ("left_entity_confidence", option(lib, confidence_ty)), + ("left_entity_provenance", property_provenance_ty), + ("right_entity_confidence", option(lib, confidence_ty)), + ("right_entity_provenance", property_provenance_ty), ]), ); def.push( @@ -99,7 +251,26 @@ impl<'heap> StandardLibraryModule<'heap> for Entity { ItemDef::newtype(lib.ty.env, link_data_ty, &[]), ); - // newtype Entity = (id: EntityRecordId, properties: T, link_data: Option) + // newtype EntityEncodings = (vectors: Unknown) + // + // The graph API doesn't expose encodings yet, but the storage layer already has + // them. The `?` inner type is correct; the encoding format is opaque to the + // type system. + let encodings_ty = lib.ty.opaque( + "::graph::types::knowledge::entity::EntityEncodings", + lib.ty.r#struct([("vectors", lib.ty.unknown())]), + ); + def.push( + heap.intern_symbol("EntityEncodings"), + ItemDef::newtype(lib.ty.env, encodings_ty, &[]), + ); + + // newtype Entity = ( + // properties: T, + // link_data: Option, + // metadata: EntityMetadata, + // encodings: EntityEncodings, + // ) let t_arg = lib.ty.fresh_argument("T"); let t_ref = lib.ty.hydrate_argument(t_arg); let t_param = lib.ty.param(t_arg); @@ -108,9 +279,10 @@ impl<'heap> StandardLibraryModule<'heap> for Entity { lib.ty.opaque( sym::path::Entity, lib.ty.r#struct([ - ("id", entity_record_id_ty), ("properties", t_param), ("link_data", option(lib, link_data_ty)), + ("metadata", entity_metadata_ty), + ("encodings", encodings_ty), ]), ), ); diff --git a/libs/@local/hashql/core/src/symbol/sym.rs b/libs/@local/hashql/core/src/symbol/sym.rs index 388b5a4c65e..4bc9c4fe5b5 100644 --- a/libs/@local/hashql/core/src/symbol/sym.rs +++ b/libs/@local/hashql/core/src/symbol/sym.rs @@ -55,6 +55,8 @@ hashql_macros::define_symbols! { left_entity_confidence, left_entity_id, left_entity_provenance, + left_entity_uuid, + left_entity_web_id, link_data, List, lt, @@ -74,7 +76,10 @@ hashql_macros::define_symbols! { or, pow, properties, + property_metadata, provenance, + provenance_edition, + provenance_inferred, provided, r#as: "as", r#as_force: "as!", @@ -96,6 +101,8 @@ hashql_macros::define_symbols! { right_entity_confidence, right_entity_id, right_entity_provenance, + right_entity_uuid, + right_entity_web_id, Some, special_form, String, diff --git a/libs/@local/hashql/eval/src/error.rs b/libs/@local/hashql/eval/src/error.rs index 842514a9420..9ebf5fbb811 100644 --- a/libs/@local/hashql/eval/src/error.rs +++ b/libs/@local/hashql/eval/src/error.rs @@ -1,9 +1,14 @@ use alloc::borrow::Cow; -use hashql_diagnostics::category::DiagnosticCategory; +use hashql_core::span::SpanId; +use hashql_diagnostics::{Diagnostic, DiagnosticIssues, Severity, category::DiagnosticCategory}; +#[cfg(feature = "graph")] use crate::graph::error::GraphCompilerDiagnosticCategory; +pub type EvalDiagnostic = Diagnostic; +pub type EvalDiagnosticIssues = DiagnosticIssues; + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum EvalDiagnosticCategory { #[cfg(feature = "graph")] diff --git a/libs/@local/hashql/eval/src/graph/read/error.rs b/libs/@local/hashql/eval/src/graph/read/error.rs index 43b4da821a1..49377a8be2c 100644 --- a/libs/@local/hashql/eval/src/graph/read/error.rs +++ b/libs/@local/hashql/eval/src/graph/read/error.rs @@ -195,7 +195,8 @@ pub(super) fn path_conversion_error( diagnostic.add_message(Message::help( "Filter expressions can only query against simple scalar properties that map to database \ columns, not complex objects. Use individual properties of the object instead (e.g., \ - `entity.id.entity_uuid` instead of `entity.id`).", + `entity.metadata.record_id.entity_id.entity_uuid` instead of \ + `entity.metadata.record_id`).", )); diagnostic.add_message(Message::note( diff --git a/libs/@local/hashql/eval/src/graph/read/path.rs b/libs/@local/hashql/eval/src/graph/read/path.rs index 810fb4e4477..67438f24c3e 100644 --- a/libs/@local/hashql/eval/src/graph/read/path.rs +++ b/libs/@local/hashql/eval/src/graph/read/path.rs @@ -129,7 +129,7 @@ impl<'heap> PartialQueryPath<'heap> for PartialEntityIdQueryPath { #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub(crate) enum PartialEntityRecordIdPath { EntityId(Option), - EntityEditionId, + EditionId, } impl<'heap> PartialQueryPath<'heap> for PartialEntityRecordIdPath { @@ -138,7 +138,7 @@ impl<'heap> PartialQueryPath<'heap> for PartialEntityRecordIdPath { fn from_field(_: &'heap Heap, field: Symbol<'heap>) -> Option { match field.as_constant()? { sym::entity_id::CONST => Some(Self::EntityId(None)), - sym::entity_edition_id::CONST => Some(Self::EntityEditionId), + sym::edition_id::CONST => Some(Self::EditionId), _ => None, } } @@ -149,7 +149,7 @@ impl<'heap> PartialQueryPath<'heap> for PartialEntityRecordIdPath { .map(Some) .map(Self::EntityId) .map_err(Self::EntityId), - Self::EntityEditionId => Err(self), + Self::EditionId => Err(self), } } @@ -163,7 +163,7 @@ impl<'heap> PartialQueryPath<'heap> for PartialEntityRecordIdPath { .map(Some) .map(Self::EntityId) .map_err(Self::EntityId), - Self::EntityEditionId => Err(self), + Self::EditionId => Err(self), } } @@ -171,7 +171,7 @@ impl<'heap> PartialQueryPath<'heap> for PartialEntityRecordIdPath { match self { Self::EntityId(Some(partial)) => partial.finish(), Self::EntityId(None) => None, - Self::EntityEditionId => Some(EntityQueryPath::EditionId), + Self::EditionId => Some(EntityQueryPath::EditionId), } } } @@ -180,6 +180,10 @@ impl<'heap> PartialQueryPath<'heap> for PartialEntityRecordIdPath { pub(crate) enum PartialLinkDataPath { LeftEntityId(Option), RightEntityId(Option), + LeftEntityConfidence, + LeftEntityProvenance, + RightEntityConfidence, + RightEntityProvenance, } impl<'heap> PartialQueryPath<'heap> for PartialLinkDataPath { @@ -189,6 +193,10 @@ impl<'heap> PartialQueryPath<'heap> for PartialLinkDataPath { match field.as_constant()? { sym::left_entity_id::CONST => Some(Self::LeftEntityId(None)), sym::right_entity_id::CONST => Some(Self::RightEntityId(None)), + sym::left_entity_confidence::CONST => Some(Self::LeftEntityConfidence), + sym::left_entity_provenance::CONST => Some(Self::LeftEntityProvenance), + sym::right_entity_confidence::CONST => Some(Self::RightEntityConfidence), + sym::right_entity_provenance::CONST => Some(Self::RightEntityProvenance), _ => None, } } @@ -203,6 +211,10 @@ impl<'heap> PartialQueryPath<'heap> for PartialLinkDataPath { .map(Some) .map(Self::RightEntityId) .map_err(Self::RightEntityId), + Self::LeftEntityConfidence + | Self::LeftEntityProvenance + | Self::RightEntityConfidence + | Self::RightEntityProvenance => Err(self), } } @@ -220,6 +232,10 @@ impl<'heap> PartialQueryPath<'heap> for PartialLinkDataPath { .map(Some) .map(Self::RightEntityId) .map_err(Self::RightEntityId), + Self::LeftEntityConfidence + | Self::LeftEntityProvenance + | Self::RightEntityConfidence + | Self::RightEntityProvenance => Err(self), } } @@ -239,6 +255,11 @@ impl<'heap> PartialQueryPath<'heap> for PartialLinkDataPath { direction: EdgeDirection::Outgoing, }), Self::RightEntityId(None) => None, + + Self::LeftEntityConfidence => Some(EntityQueryPath::LeftEntityConfidence), + Self::LeftEntityProvenance => Some(EntityQueryPath::LeftEntityProvenance), + Self::RightEntityConfidence => Some(EntityQueryPath::RightEntityConfidence), + Self::RightEntityProvenance => Some(EntityQueryPath::RightEntityProvenance), } } } @@ -292,11 +313,206 @@ impl<'heap> PartialQueryPath<'heap> for JsonPath<'heap> { } } +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub(crate) enum PartialEntityMetadataPath<'heap> { + RecordId(Option), + TemporalVersioning(Option), + Archived, + Confidence, + EntityTypeIds, + Provenance(Option>), + Properties(Option>), +} + +impl<'heap> PartialQueryPath<'heap> for PartialEntityMetadataPath<'heap> { + type QueryPath = EntityQueryPath<'heap>; + + fn from_field(_: &'heap Heap, field: Symbol<'heap>) -> Option { + match field.as_constant()? { + sym::record_id::CONST => Some(Self::RecordId(None)), + sym::temporal_versioning::CONST => Some(Self::TemporalVersioning(None)), + sym::archived::CONST => Some(Self::Archived), + sym::confidence::CONST => Some(Self::Confidence), + sym::entity_type_ids::CONST => Some(Self::EntityTypeIds), + sym::provenance::CONST => Some(Self::Provenance(None)), + sym::properties::CONST => Some(Self::Properties(None)), + _ => None, + } + } + + fn access_field(self, heap: &'heap Heap, field: Symbol<'heap>) -> Result { + match self { + Self::RecordId(path) => traverse_into_field(path, heap, field) + .map(Some) + .map(Self::RecordId) + .map_err(Self::RecordId), + Self::TemporalVersioning(path) => traverse_into_field(path, heap, field) + .map(Some) + .map(Self::TemporalVersioning) + .map_err(Self::TemporalVersioning), + Self::Provenance(path) => traverse_into_field(path, heap, field) + .map(Some) + .map(Self::Provenance) + .map_err(Self::Provenance), + Self::Properties(path) => traverse_into_field(path, heap, field) + .map(Some) + .map(Self::Properties) + .map_err(Self::Properties), + Self::Archived | Self::Confidence | Self::EntityTypeIds => Err(self), + } + } + + fn from_index(_: &'heap Heap, _: Cow<'_, Value<'heap>>) -> Option { + None + } + + fn access_index(self, heap: &'heap Heap, index: Cow<'_, Value<'heap>>) -> Result { + match self { + Self::RecordId(path) => traverse_into_index(path, heap, index) + .map(Some) + .map(Self::RecordId) + .map_err(Self::RecordId), + Self::Properties(path) => traverse_into_index(path, heap, index) + .map(Some) + .map(Self::Properties) + .map_err(Self::Properties), + Self::TemporalVersioning(_) + | Self::Archived + | Self::Confidence + | Self::EntityTypeIds + | Self::Provenance(_) => Err(self), + } + } + + #[expect(clippy::match_same_arms, reason = "readability")] + fn finish(self) -> Option { + match self { + Self::RecordId(Some(partial)) => partial.finish(), + Self::RecordId(None) => None, + + Self::TemporalVersioning(Some(partial)) => partial.finish(), + Self::TemporalVersioning(None) => None, + + Self::Archived => Some(EntityQueryPath::Archived), + Self::Confidence => Some(EntityQueryPath::EntityConfidence), + Self::EntityTypeIds => Some(EntityQueryPath::EntityTypeEdge { + edge_kind: hash_graph_store::subgraph::edges::SharedEdgeKind::IsOfType, + path: hash_graph_store::entity_type::EntityTypeQueryPath::VersionedUrl, + inheritance_depth: Some(0), + }), + + Self::Provenance(Some(partial)) => partial.finish(), + Self::Provenance(None) => None, + + Self::Properties(Some(partial)) => { + Some(EntityQueryPath::PropertyMetadata(Some(partial.finish()?))) + } + Self::Properties(None) => Some(EntityQueryPath::PropertyMetadata(None)), + } + } +} + +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub(crate) enum PartialTemporalVersioningPath { + DecisionTime, + TransactionTime, +} + +impl<'heap> PartialQueryPath<'heap> for PartialTemporalVersioningPath { + type QueryPath = EntityQueryPath<'heap>; + + fn from_field(_: &'heap Heap, field: Symbol<'heap>) -> Option { + match field.as_constant()? { + sym::decision_time::CONST => Some(Self::DecisionTime), + sym::transaction_time::CONST => Some(Self::TransactionTime), + _ => None, + } + } + + fn access_field(self, _: &'heap Heap, _: Symbol<'heap>) -> Result { + Err(self) + } + + fn from_index(_: &'heap Heap, _: Cow<'_, Value<'heap>>) -> Option { + None + } + + fn access_index(self, _: &'heap Heap, _: Cow<'_, Value<'heap>>) -> Result { + Err(self) + } + + fn finish(self) -> Option { + match self { + Self::DecisionTime => Some(EntityQueryPath::DecisionTime), + Self::TransactionTime => Some(EntityQueryPath::TransactionTime), + } + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub(crate) enum PartialEntityProvenancePath<'heap> { + Inferred(Option>), + Edition(Option>), +} + +impl<'heap> PartialQueryPath<'heap> for PartialEntityProvenancePath<'heap> { + type QueryPath = EntityQueryPath<'heap>; + + fn from_field(_: &'heap Heap, field: Symbol<'heap>) -> Option { + match field.as_constant()? { + sym::inferred::CONST => Some(Self::Inferred(None)), + sym::edition::CONST => Some(Self::Edition(None)), + _ => None, + } + } + + fn access_field(self, heap: &'heap Heap, field: Symbol<'heap>) -> Result { + match self { + Self::Inferred(path) => traverse_into_field(path, heap, field) + .map(Some) + .map(Self::Inferred) + .map_err(Self::Inferred), + Self::Edition(path) => traverse_into_field(path, heap, field) + .map(Some) + .map(Self::Edition) + .map_err(Self::Edition), + } + } + + fn from_index(_: &'heap Heap, _: Cow<'_, Value<'heap>>) -> Option { + None + } + + fn access_index(self, heap: &'heap Heap, index: Cow<'_, Value<'heap>>) -> Result { + match self { + Self::Inferred(path) => traverse_into_index(path, heap, index) + .map(Some) + .map(Self::Inferred) + .map_err(Self::Inferred), + Self::Edition(path) => traverse_into_index(path, heap, index) + .map(Some) + .map(Self::Edition) + .map_err(Self::Edition), + } + } + + fn finish(self) -> Option { + match self { + Self::Inferred(path) => { + Some(EntityQueryPath::Provenance(path.and_then(JsonPath::finish))) + } + Self::Edition(path) => Some(EntityQueryPath::EditionProvenance( + path.and_then(JsonPath::finish), + )), + } + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub(crate) enum PartialEntityQueryPath<'heap> { - Id(Option), Properties(Option>), LinkData(Option), + Metadata(Option>), } impl<'heap> PartialQueryPath<'heap> for PartialEntityQueryPath<'heap> { @@ -304,19 +520,15 @@ impl<'heap> PartialQueryPath<'heap> for PartialEntityQueryPath<'heap> { fn from_field(_: &'heap Heap, field: Symbol<'heap>) -> Option { match field.as_constant()? { - sym::id::CONST => Some(PartialEntityQueryPath::Id(None)), - sym::properties::CONST => Some(PartialEntityQueryPath::Properties(None)), - sym::link_data::CONST => Some(PartialEntityQueryPath::LinkData(None)), + sym::properties::CONST => Some(Self::Properties(None)), + sym::link_data::CONST => Some(Self::LinkData(None)), + sym::metadata::CONST => Some(Self::Metadata(None)), _ => None, } } fn access_field(self, heap: &'heap Heap, field: Symbol<'heap>) -> Result { match self { - Self::Id(path) => traverse_into_field(path, heap, field) - .map(Some) - .map(Self::Id) - .map_err(Self::Id), Self::Properties(path) => traverse_into_field(path, heap, field) .map(Some) .map(Self::Properties) @@ -325,6 +537,10 @@ impl<'heap> PartialQueryPath<'heap> for PartialEntityQueryPath<'heap> { .map(Some) .map(Self::LinkData) .map_err(Self::LinkData), + Self::Metadata(path) => traverse_into_field(path, heap, field) + .map(Some) + .map(Self::Metadata) + .map_err(Self::Metadata), } } @@ -334,10 +550,6 @@ impl<'heap> PartialQueryPath<'heap> for PartialEntityQueryPath<'heap> { fn access_index(self, heap: &'heap Heap, index: Cow>) -> Result { match self { - Self::Id(path) => traverse_into_index(path, heap, index) - .map(Some) - .map(Self::Id) - .map_err(Self::Id), Self::Properties(path) => traverse_into_index(path, heap, index) .map(Some) .map(Self::Properties) @@ -346,15 +558,16 @@ impl<'heap> PartialQueryPath<'heap> for PartialEntityQueryPath<'heap> { .map(Some) .map(Self::LinkData) .map_err(Self::LinkData), + Self::Metadata(path) => traverse_into_index(path, heap, index) + .map(Some) + .map(Self::Metadata) + .map_err(Self::Metadata), } } #[expect(clippy::match_same_arms, reason = "readability")] fn finish(self) -> Option { match self { - Self::Id(Some(partial)) => partial.finish(), - Self::Id(None) => None, - Self::Properties(Some(partial)) => { Some(EntityQueryPath::Properties(Some(partial.finish()?))) } @@ -362,6 +575,9 @@ impl<'heap> PartialQueryPath<'heap> for PartialEntityQueryPath<'heap> { Self::LinkData(Some(partial)) => partial.finish(), Self::LinkData(None) => None, + + Self::Metadata(Some(partial)) => partial.finish(), + Self::Metadata(None) => None, } } } diff --git a/libs/@local/hashql/eval/src/lib.rs b/libs/@local/hashql/eval/src/lib.rs index 7ecc2466f40..dce737dd692 100644 --- a/libs/@local/hashql/eval/src/lib.rs +++ b/libs/@local/hashql/eval/src/lib.rs @@ -12,6 +12,10 @@ // Library Features iterator_try_collect, + assert_matches, + allocator_api, + iter_array_chunks, + maybe_uninit_fill )] extern crate alloc; diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/call-identity.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/call-identity.jsonc index 5f03a108dde..da4ef0a50ea 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/call-identity.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/call-identity.jsonc @@ -7,7 +7,7 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - ["identity", "vertex.id.entity_id.entity_uuid"], + ["identity", "vertex.metadata.record_id.entity_id.entity_uuid"], //~^ ERROR Function call not supported here ["::graph::types::knowledge::entity::EntityUuid", ["::core::uuid::Uuid", { "#literal": "e2851dbb-7376-4959-9bca-f72cafc4448f" }] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/call-identity.stderr b/libs/@local/hashql/eval/tests/ui/graph/read/entity/call-identity.stderr index dfea41d94bb..0a9deb20c50 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/call-identity.stderr +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/call-identity.stderr @@ -1,8 +1,8 @@ error[graph-read-compiler::call-unsupported]: Function calls not supported ╭▸ 9 │ ┌ ["==", -10 │ │ ["identity", "vertex.id.entity_id.entity_uuid"], - │ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Function call not supported here +10 │ │ ["identity", "vertex.metadata.record_id.entity_id.entity_uuid"], + │ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Function call not supported here 11 │ │ //~^ ERROR Function call not supported here 12 │ │ ["::graph::types::knowledge::entity::EntityUuid", ‡ │ diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/complex-object-error.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/complex-object-error.jsonc index 5969abcb774..80b483e8e82 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/complex-object-error.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/complex-object-error.jsonc @@ -6,9 +6,9 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - "vertex.id.entity_id", + "vertex.metadata.record_id.entity_id", //~^ ERROR Cannot query against this complex object - "vertex.id.entity_id" + "vertex.metadata.record_id.entity_id" //~^ ERROR Cannot query against this complex object ] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/complex-object-error.stderr b/libs/@local/hashql/eval/tests/ui/graph/read/entity/complex-object-error.stderr index d8b93f7c86c..b687aef6b27 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/complex-object-error.stderr +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/complex-object-error.stderr @@ -1,27 +1,27 @@ error[graph-read-compiler::path-conversion]: Cannot query against complex object ╭▸ 8 │ ┌ ["==", - 9 │ │ "vertex.id.entity_id", + 9 │ │ "vertex.metadata.record_id.entity_id", 10 │ │ //~^ ERROR Cannot query against this complex object -11 │ │ "vertex.id.entity_id" - │ │ ━━━━━━━━━━━━━━━━━━━ Cannot query against this complex object +11 │ │ "vertex.metadata.record_id.entity_id" + │ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Cannot query against this complex object 12 │ │ //~^ ERROR Cannot query against this complex object 13 │ │ ] │ └───────┘ ... within this filter expression │ - ├ help: Filter expressions can only query against simple scalar properties that map to database columns, not complex objects. Use individual properties of the object instead (e.g., `entity.id.entity_uuid` instead of `entity.id`). + ├ help: Filter expressions can only query against simple scalar properties that map to database columns, not complex objects. Use individual properties of the object instead (e.g., `entity.metadata.record_id.entity_id.entity_uuid` instead of `entity.metadata.record_id`). ╰ note: This is a temporary limitation of the current query compiler. Support for querying against complex objects in filter expressions is being tracked in https://linear.app/hash/issue/H-4911/hashql-allow-for-querying-against-complex-objects. error[graph-read-compiler::path-conversion]: Cannot query against complex object ╭▸ 8 │ ┌ ["==", - 9 │ │ "vertex.id.entity_id", - │ │ ━━━━━━━━━━━━━━━━━━━ Cannot query against this complex object + 9 │ │ "vertex.metadata.record_id.entity_id", + │ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Cannot query against this complex object 10 │ │ //~^ ERROR Cannot query against this complex object -11 │ │ "vertex.id.entity_id" +11 │ │ "vertex.metadata.record_id.entity_id" 12 │ │ //~^ ERROR Cannot query against this complex object 13 │ │ ] │ └───────┘ ... within this filter expression │ - ├ help: Filter expressions can only query against simple scalar properties that map to database columns, not complex objects. Use individual properties of the object instead (e.g., `entity.id.entity_uuid` instead of `entity.id`). + ├ help: Filter expressions can only query against simple scalar properties that map to database columns, not complex objects. Use individual properties of the object instead (e.g., `entity.metadata.record_id.entity_id.entity_uuid` instead of `entity.metadata.record_id`). ╰ note: This is a temporary limitation of the current query compiler. Support for querying against complex objects in filter expressions is being tracked in https://linear.app/hash/issue/H-4911/hashql-allow-for-querying-against-complex-objects. \ No newline at end of file diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/computed-path-indexing-error.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/computed-path-indexing-error.jsonc index 4074f79a828..e83632c772f 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/computed-path-indexing-error.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/computed-path-indexing-error.jsonc @@ -9,7 +9,7 @@ {"#literal": 2}, ["[]", ["input", "user_ids", "Dict<::graph::types::knowledge::entity::EntityUuid, Integer>"], - "vertex.id.entity_id.entity_uuid" + "vertex.metadata.record_id.entity_id.entity_uuid" //~^ ERROR Cannot use computed value as index ] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/computed-path-indexing-error.stderr b/libs/@local/hashql/eval/tests/ui/graph/read/entity/computed-path-indexing-error.stderr index c4d7408a4e7..015461c77a9 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/computed-path-indexing-error.stderr +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/computed-path-indexing-error.stderr @@ -5,8 +5,8 @@ error[graph-read-compiler::path-indexing-unsupported]: Indexing through traversa 10 │ │ ["[]", 11 │ │ ["input", "user_ids", "Dict<::graph::types::knowledge::entity::EntityUuid, Integer>"], │ │ ───────────────────────────────────────────────────────────────────────────────────── ... when indexing this value -12 │ │ "vertex.id.entity_id.entity_uuid" - │ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Cannot use computed value as index +12 │ │ "vertex.metadata.record_id.entity_id.entity_uuid" + │ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Cannot use computed value as index ‡ │ 15 │ │ ] │ └───────┘ ... within this filter expression diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-key.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-key.jsonc index eed6ef65564..c786bbcd1d4 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-key.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-key.jsonc @@ -7,11 +7,11 @@ ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", ["[]", - {"#dict": [["vertex.id.entity_id.entity_uuid", {"#literal": "a"}]]}, + {"#dict": [["vertex.metadata.record_id.entity_id.entity_uuid", {"#literal": "a"}]]}, //~^ ERROR path expressions are not supported in data constructs ["::graph::types::knowledge::entity::EntityUuid", ["::core::uuid::Uuid", {"#literal": "a"}]] ], - "vertex.id.entity_id.entity_uuid" + "vertex.metadata.record_id.entity_id.entity_uuid" ] ] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-key.stderr b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-key.stderr index 00ac468efe8..10261ec0ebd 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-key.stderr +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-key.stderr @@ -1,6 +1,6 @@ error[graph-read-compiler::path-in-data-construct-unsupported]: Path in data construct unsupported ╭▸ -10 │ {"#dict": [["vertex.id.entity_id.entity_uuid", {"#literal": "a"}]]}, +10 │ {"#dict": [["vertex.metadata.record_id.entity_id.entity_uuid", {"#literal": "a"}]]}, │ ━━━━━━ path expressions are not supported in data constructs │ ├ help: rewrite the logic to avoid path expressions in data constructs diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-value.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-value.jsonc index 3c248f2f3ee..2cd2be12596 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-value.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-value.jsonc @@ -6,9 +6,9 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - ["[]", {"#dict": {"a": "vertex.id.entity_id.entity_uuid"}}, {"#literal": "a"}], + ["[]", {"#dict": {"a": "vertex.metadata.record_id.entity_id.entity_uuid"}}, {"#literal": "a"}], //~^ ERROR path expressions are not supported in data constructs - "vertex.id.entity_id.entity_uuid" + "vertex.metadata.record_id.entity_id.entity_uuid" ] ] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-value.stderr b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-value.stderr index e79aadd0b9e..a8b654b103d 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-value.stderr +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-dict-value.stderr @@ -1,6 +1,6 @@ error[graph-read-compiler::path-in-data-construct-unsupported]: Path in data construct unsupported ╭▸ -9 │ ["[]", {"#dict": {"a": "vertex.id.entity_id.entity_uuid"}}, {"#literal": "a"}], +9 │ ["[]", {"#dict": {"a": "vertex.metadata.record_id.entity_id.entity_uuid"}}, {"#literal": "a"}], │ ━━━━━━ path expressions are not supported in data constructs │ ├ help: rewrite the logic to avoid path expressions in data constructs diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-list.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-list.jsonc index 6e37a12cd46..2d2bbcc8f44 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-list.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-list.jsonc @@ -6,9 +6,9 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - ["[]", {"#list": ["vertex.id.entity_id.entity_uuid"]}, { "#literal": 0 }], + ["[]", {"#list": ["vertex.metadata.record_id.entity_id.entity_uuid"]}, { "#literal": 0 }], //~^ ERROR path expressions are not supported in data constructs - "vertex.id.entity_id.entity_uuid" + "vertex.metadata.record_id.entity_id.entity_uuid" ] ] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-list.stderr b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-list.stderr index a6782779487..e731890cd1d 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-list.stderr +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-list.stderr @@ -1,6 +1,6 @@ error[graph-read-compiler::path-in-data-construct-unsupported]: Path in data construct unsupported ╭▸ -9 │ ["[]", {"#list": ["vertex.id.entity_id.entity_uuid"]}, { "#literal": 0 }], +9 │ ["[]", {"#list": ["vertex.metadata.record_id.entity_id.entity_uuid"]}, { "#literal": 0 }], │ ━━━━━━ path expressions are not supported in data constructs │ ├ help: rewrite the logic to avoid path expressions in data constructs diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct-entry.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct-entry.jsonc index 06eaf371813..94e53df9623 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct-entry.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct-entry.jsonc @@ -6,9 +6,9 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - [".", [".", [".", [".", {"#struct": {"a": "vertex"}}, "a"], "id"], "entity_id"], "entity_uuid"], + [".", [".", [".", [".", [".", {"#struct": {"a": "vertex"}}, "a"], "metadata"], "record_id"], "entity_id"], "entity_uuid"], //~^ ERROR path expressions are not supported in data constructs - "vertex.id.entity_id.entity_uuid" + "vertex.metadata.record_id.entity_id.entity_uuid" ] ] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct-entry.stderr b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct-entry.stderr index 813de056a19..88ba6294db9 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct-entry.stderr +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct-entry.stderr @@ -1,7 +1,7 @@ error[graph-read-compiler::path-in-data-construct-unsupported]: Path in data construct unsupported ╭▸ -9 │ [".", [".", [".", [".", {"#struct": {"a": "vertex"}}, "a"], "id"], "entity_id"], "entity_uuid"], - │ ━━━━━━ path expressions are not supported in data constructs +9 │ [".", [".", [".", [".", [".", {"#struct": {"a": "vertex"}}, "a"], "metadata"], "record_id"], "entity_id"], "entity_uuid"], + │ ━━━━━━ path expressions are not supported in data constructs │ ├ help: rewrite the logic to avoid path expressions in data constructs ╰ note: path expressions within complex data constructs (tuples, lists, dictionaries, structs) are not supported by the current query compiler. This is a fundamental limitation that will be addressed in the next-generation compiler \ No newline at end of file diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct.jsonc index 36ac708a8cc..f186112f0ba 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct.jsonc @@ -6,9 +6,9 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - [".", {"#struct": {"a": "vertex.id.entity_id.entity_uuid"}}, "a"], + [".", {"#struct": {"a": "vertex.metadata.record_id.entity_id.entity_uuid"}}, "a"], //~^ ERROR path expressions are not supported in data constructs - "vertex.id.entity_id.entity_uuid" + "vertex.metadata.record_id.entity_id.entity_uuid" ] ] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct.stderr b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct.stderr index 116474425d2..84a2454f9b8 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct.stderr +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-struct.stderr @@ -1,6 +1,6 @@ error[graph-read-compiler::path-in-data-construct-unsupported]: Path in data construct unsupported ╭▸ -9 │ [".", {"#struct": {"a": "vertex.id.entity_id.entity_uuid"}}, "a"], +9 │ [".", {"#struct": {"a": "vertex.metadata.record_id.entity_id.entity_uuid"}}, "a"], │ ━━━━━━ path expressions are not supported in data constructs │ ├ help: rewrite the logic to avoid path expressions in data constructs diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-tuple.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-tuple.jsonc index de69481da9b..17f8a7020b0 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-tuple.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-tuple.jsonc @@ -6,9 +6,9 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - [".", {"#tuple": ["vertex.id.entity_id.entity_uuid"]}, { "#literal": 0 }], + [".", {"#tuple": ["vertex.metadata.record_id.entity_id.entity_uuid"]}, { "#literal": 0 }], //~^ ERROR path expressions are not supported in data constructs - "vertex.id.entity_id.entity_uuid" + "vertex.metadata.record_id.entity_id.entity_uuid" ] ] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-tuple.stderr b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-tuple.stderr index 49c2ebd1e3d..9db41195e8a 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-tuple.stderr +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/field-in-tuple.stderr @@ -1,6 +1,6 @@ error[graph-read-compiler::path-in-data-construct-unsupported]: Path in data construct unsupported ╭▸ -9 │ [".", {"#tuple": ["vertex.id.entity_id.entity_uuid"]}, { "#literal": 0 }], +9 │ [".", {"#tuple": ["vertex.metadata.record_id.entity_id.entity_uuid"]}, { "#literal": 0 }], │ ━━━━━━ path expressions are not supported in data constructs │ ├ help: rewrite the logic to avoid path expressions in data constructs diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/if-filter-expr.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/if-filter-expr.jsonc index 9c5f5e6a50a..7d315f85b3b 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/if-filter-expr.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/if-filter-expr.jsonc @@ -6,10 +6,10 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", ["if", {"#literal": true}, - "vertex.id.entity_id.entity_uuid", - "vertex.id.entity_id.entity_uuid" + "vertex.metadata.record_id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid" ] //~^ ERROR conditional expressions are not supported in filter contexts ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/if-filter-expr.stderr b/libs/@local/hashql/eval/tests/ui/graph/read/entity/if-filter-expr.stderr index a8978757bbd..81a40f482bf 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/if-filter-expr.stderr +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/if-filter-expr.stderr @@ -1,8 +1,8 @@ error[graph-read-compiler::branch-unsupported]: Branch construct unsupported ╭▸ 10 │ ┏ ["if", {"#literal": true}, -11 │ ┃ "vertex.id.entity_id.entity_uuid", -12 │ ┃ "vertex.id.entity_id.entity_uuid" +11 │ ┃ "vertex.metadata.record_id.entity_id.entity_uuid", +12 │ ┃ "vertex.metadata.record_id.entity_id.entity_uuid" 13 │ ┃ ] │ ┗━━━━━━━━━┛ conditional expressions are not supported in filter contexts │ diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-field-access.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-field-access.jsonc index 1372a05fcab..f3db5ecb0a8 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-field-access.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-field-access.jsonc @@ -6,7 +6,7 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", [".", ["input", "user", {"#struct": {"id": "::graph::types::knowledge::entity::EntityUuid"}}], "id" diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-field-access.stdout b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-field-access.stdout index 943a1ccac1a..6178ff59e34 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-field-access.stdout +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-field-access.stdout @@ -11,7 +11,7 @@ let %1 = thunk -> %10 = ::graph::head::entities(%8) |> ::graph::body::filter((vertex:0: Entity): Boolean -> let %9 = %2(), - %3 = vertex:0.id.entity_id.entity_uuid == %9.id + %3 = vertex:0.metadata.record_id.entity_id.entity_uuid == %9.id in %3 ) diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-index-access.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-index-access.jsonc index 696cc74c49d..712ef64ec5f 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-index-access.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-index-access.jsonc @@ -6,7 +6,7 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - ["as", "vertex.id.entity_id.entity_uuid", ["|", "::graph::types::knowledge::entity::EntityUuid", "Null"]], + ["as", "vertex.metadata.record_id.entity_id.entity_uuid", ["|", "::graph::types::knowledge::entity::EntityUuid", "Null"]], ["[]", ["input", "user_ids", "List<::graph::types::knowledge::entity::EntityUuid>"], {"#literal": 0} diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-index-access.stdout b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-index-access.stdout index 3bfe82ebbe6..0a130839985 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-index-access.stdout +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-index-access.stdout @@ -13,7 +13,7 @@ let %1 = thunk -> |> ::graph::body::filter((vertex:0: Entity): Boolean -> let %10 = %2(), %11 = %3(), - %4 = vertex:0.id.entity_id.entity_uuid == %10[%11] + %4 = vertex:0.metadata.record_id.entity_id.entity_uuid == %10[%11] in %4 ) diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-parameter.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-parameter.jsonc index aee748ce402..bed43bfc8c7 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-parameter.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-parameter.jsonc @@ -6,7 +6,7 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", ["input", "user_id", "::graph::types::knowledge::entity::EntityUuid"] ] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-parameter.stdout b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-parameter.stdout index 7fb1ed624df..ac94cedaa27 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-parameter.stdout +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/input-parameter.stdout @@ -11,7 +11,7 @@ let %1 = thunk -> %10 = ::graph::head::entities(%8) |> ::graph::body::filter((vertex:0: Entity): Boolean -> let %9 = %2(), - %3 = vertex:0.id.entity_id.entity_uuid == %9 + %3 = vertex:0.metadata.record_id.entity_id.entity_uuid == %9 in %3 ) diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/invalid-field-access-error.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/invalid-field-access-error.jsonc index 229ccff7bd6..f2c414dce7f 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/invalid-field-access-error.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/invalid-field-access-error.jsonc @@ -6,7 +6,7 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", // This is one of the few times where we can actually test if we hit a compiler error, // because we don't typecheck the input in this test (yet) [".", diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/invalid-vertex-query.stderr b/libs/@local/hashql/eval/tests/ui/graph/read/entity/invalid-vertex-query.stderr index b27bc51299a..eb695967950 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/invalid-vertex-query.stderr +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/invalid-vertex-query.stderr @@ -9,7 +9,7 @@ error[graph-read-compiler::path-conversion]: Cannot query against complex object 13 │ │ ] │ └───────┘ ... within this filter expression │ - ├ help: Filter expressions can only query against simple scalar properties that map to database columns, not complex objects. Use individual properties of the object instead (e.g., `entity.id.entity_uuid` instead of `entity.id`). + ├ help: Filter expressions can only query against simple scalar properties that map to database columns, not complex objects. Use individual properties of the object instead (e.g., `entity.metadata.record_id.entity_id.entity_uuid` instead of `entity.metadata.record_id`). ╰ note: This is a temporary limitation of the current query compiler. Support for querying against complex objects in filter expressions is being tracked in https://linear.app/hash/issue/H-4911/hashql-allow-for-querying-against-complex-objects. error[graph-read-compiler::path-conversion]: Cannot query against complex object @@ -23,5 +23,5 @@ error[graph-read-compiler::path-conversion]: Cannot query against complex object 13 │ │ ] │ └───────┘ ... within this filter expression │ - ├ help: Filter expressions can only query against simple scalar properties that map to database columns, not complex objects. Use individual properties of the object instead (e.g., `entity.id.entity_uuid` instead of `entity.id`). + ├ help: Filter expressions can only query against simple scalar properties that map to database columns, not complex objects. Use individual properties of the object instead (e.g., `entity.metadata.record_id.entity_id.entity_uuid` instead of `entity.metadata.record_id`). ╰ note: This is a temporary limitation of the current query compiler. Support for querying against complex objects in filter expressions is being tracked in https://linear.app/hash/issue/H-4911/hashql-allow-for-querying-against-complex-objects. \ No newline at end of file diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-expression.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-expression.jsonc index 18ad33cb2da..cf5b08a6089 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-expression.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-expression.jsonc @@ -6,7 +6,7 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - ["let", "foo", "vertex.id.entity_id.entity_uuid", "foo"], + ["let", "foo", "vertex.metadata.record_id.entity_id.entity_uuid", "foo"], ["::graph::types::knowledge::entity::EntityUuid", ["::core::uuid::Uuid", { "#literal": "e2851dbb-7376-4959-9bca-f72cafc4448f" }] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-expression.stdout b/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-expression.stdout index b9a1fdb38bb..87d6d875e58 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-expression.stdout +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-expression.stdout @@ -23,7 +23,7 @@ let %2 = thunk -> let %18 = %2(), %20 = ::graph::head::entities(%18) |> ::graph::body::filter((vertex:0: Entity): Boolean -> - let foo:0 = vertex:0.id.entity_id.entity_uuid, + let foo:0 = vertex:0.metadata.record_id.entity_id.entity_uuid, %19 = %6(), %7 = foo:0 == %19 in diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-propagation.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-propagation.jsonc index 932413bbc22..354cf51c53e 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-propagation.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-propagation.jsonc @@ -7,7 +7,7 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", ["::graph::types::knowledge::entity::EntityUuid", ["::core::uuid::Uuid", { "#literal": "e2851dbb-7376-4959-9bca-f72cafc4448f" }] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-propagation.stdout b/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-propagation.stdout index eca1e1ec928..84b4980b14f 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-propagation.stdout +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/let-propagation.stdout @@ -25,7 +25,7 @@ let foo:0 = thunk -> 2, %20 = ::graph::head::entities(%18) |> ::graph::body::filter((vertex:0: Entity): Boolean -> let %19 = %6(), - %7 = vertex:0.id.entity_id.entity_uuid == %19 + %7 = vertex:0.metadata.record_id.entity_id.entity_uuid == %19 in %7 ) diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/nested-let-bindings.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/nested-let-bindings.jsonc index a9527dcb012..ecdee9bab95 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/nested-let-bindings.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/nested-let-bindings.jsonc @@ -5,7 +5,7 @@ ["::graph::body::filter", ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", - ["let", "entity_uuid", "vertex.id.entity_id.entity_uuid", + ["let", "entity_uuid", "vertex.metadata.record_id.entity_id.entity_uuid", ["let", "user_id", ["::graph::types::knowledge::entity::EntityUuid", ["::core::uuid::Uuid", { "#literal": "e2851dbb-7376-4959-9bca-f72cafc4448f" }] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/nested-let-bindings.stdout b/libs/@local/hashql/eval/tests/ui/graph/read/entity/nested-let-bindings.stdout index ee07b4783c6..34f7c162b8a 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/nested-let-bindings.stdout +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/nested-let-bindings.stdout @@ -23,7 +23,7 @@ let %3 = thunk -> let %18 = %3(), %20 = ::graph::head::entities(%18) |> ::graph::body::filter((vertex:0: Entity): Boolean -> - let entity_uuid:0 = vertex:0.id.entity_id.entity_uuid, + let entity_uuid:0 = vertex:0.metadata.record_id.entity_id.entity_uuid, %19 = user_id:0(), %7 = entity_uuid:0 == %19 in diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/scalar-property-filter.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/scalar-property-filter.jsonc index 41bed6256ba..c92458fb513 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/scalar-property-filter.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/scalar-property-filter.jsonc @@ -6,7 +6,7 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", ["::graph::types::knowledge::entity::EntityUuid", ["::core::uuid::Uuid", { "#literal": "e2851dbb-7376-4959-9bca-f72cafc4448f" }] ] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/scalar-property-filter.stdout b/libs/@local/hashql/eval/tests/ui/graph/read/entity/scalar-property-filter.stdout index ffe66ef217f..c18b764d780 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/scalar-property-filter.stdout +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/scalar-property-filter.stdout @@ -24,7 +24,7 @@ let %1 = thunk -> %19 = ::graph::head::entities(%17) |> ::graph::body::filter((vertex:0: Entity): Boolean -> let %18 = %5(), - %6 = vertex:0.id.entity_id.entity_uuid == %18 + %6 = vertex:0.metadata.record_id.entity_id.entity_uuid == %18 in %6 ) diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/type-assertion-in-comparison.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/type-assertion-in-comparison.jsonc index 33cc957a3db..31fb7bf9e89 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/type-assertion-in-comparison.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/type-assertion-in-comparison.jsonc @@ -6,7 +6,7 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", ["as", ["::graph::types::knowledge::entity::EntityUuid", ["::core::uuid::Uuid", { "#literal": "e2851dbb-7376-4959-9bca-f72cafc4448f" }] diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/type-assertion-in-comparison.stdout b/libs/@local/hashql/eval/tests/ui/graph/read/entity/type-assertion-in-comparison.stdout index ffe66ef217f..c18b764d780 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/type-assertion-in-comparison.stdout +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/type-assertion-in-comparison.stdout @@ -24,7 +24,7 @@ let %1 = thunk -> %19 = ::graph::head::entities(%17) |> ::graph::body::filter((vertex:0: Entity): Boolean -> let %18 = %5(), - %6 = vertex:0.id.entity_id.entity_uuid == %18 + %6 = vertex:0.metadata.record_id.entity_id.entity_uuid == %18 in %6 ) diff --git a/libs/@local/hashql/eval/tests/ui/graph/read/entity/unsupported-nested-graph-read.jsonc b/libs/@local/hashql/eval/tests/ui/graph/read/entity/unsupported-nested-graph-read.jsonc index fa2e5319382..ec498eb1520 100644 --- a/libs/@local/hashql/eval/tests/ui/graph/read/entity/unsupported-nested-graph-read.jsonc +++ b/libs/@local/hashql/eval/tests/ui/graph/read/entity/unsupported-nested-graph-read.jsonc @@ -7,8 +7,8 @@ ["::graph::head::entities", ["::graph::tmp::decision_time_now"]], ["fn", { "#tuple": [] }, { "#struct": { "vertex": "_" } }, "_", ["==", - "vertex.id.entity_id.entity_uuid", - "vertex.id.entity_id.entity_uuid" + "vertex.metadata.record_id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid" ] ] ]], diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.jsonc b/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.jsonc index 1543881d213..6a3def6a90c 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.jsonc +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.jsonc @@ -12,7 +12,7 @@ "_", [ "==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", [ "::graph::types::knowledge::entity::EntityUuid", [ diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.stdout b/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.stdout index ad286aa092c..15a323ed088 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.stdout @@ -5,7 +5,7 @@ ::graph::head::entities(::graph::tmp::decision_time_now()), (vertex:0: _0): _1 -> ::core::cmp::eq( - vertex:0.id.entity_id.entity_uuid, + vertex:0.metadata.record_id.entity_id.entity_uuid, ::graph::types::knowledge::entity::EntityUuid( ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") ) @@ -20,35 +20,62 @@ ::graph::head::entities(::graph::tmp::decision_time_now()), ( vertex:0: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ): Boolean -> ::core::cmp::eq( - vertex:0.id.entity_id.entity_uuid, + vertex:0.metadata.record_id.entity_id.entity_uuid, ::graph::types::knowledge::entity::EntityUuid( ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") ) @@ -63,35 +90,62 @@ │ ::graph::head::entities(::graph::tmp::decision_time_now()), │ ( │ vertex:0: ::graph::types::knowledge::entity::Entity( -│ id: ::graph::types::knowledge::entity::EntityRecordId( -│ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), -│ entity_id: ::graph::types::knowledge::entity::EntityId( -│ draft_id: ::core::option::None(Null) -│ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), -│ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), -│ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) -│ ) +│ encodings: ::graph::types::knowledge::entity::EntityEncodings( +│ vectors: ? │ ), │ link_data: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::LinkData( +│ left_entity_confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ left_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ), +│ left_entity_provenance: ?, +│ right_entity_confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ right_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) -│ ) +│ ), +│ right_entity_provenance: ? │ )), +│ metadata: ::graph::types::knowledge::entity::EntityMetadata( +│ archived: Boolean, +│ confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), +│ entity_type_ids: List<::graph::types::ontology::VersionedUrl( +│ base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), +│ version: ::graph::ontology::OntologyTypeVersion(String) +│ )>, +│ properties: ?, +│ provenance: ::graph::types::knowledge::entity::EntityProvenance( +│ edition: ?, +│ inferred: ? +│ ), +│ record_id: ::graph::types::knowledge::entity::EntityRecordId( +│ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), +│ entity_id: ::graph::types::knowledge::entity::EntityId( +│ draft_id: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), +│ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), +│ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) +│ ) +│ ), +│ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( +│ decision_time: ?, +│ transaction_time: ? +│ ) +│ ), │ properties: ? │ ) │ ): Boolean -> │ ::core::cmp::eq( -│ vertex:0.id.entity_id.entity_uuid, +│ vertex:0.metadata.record_id.entity_id.entity_uuid, │ ::graph::types::knowledge::entity::EntityUuid( │ ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") │ ) @@ -99,30 +153,55 @@ │ ) │ ) └→ List<::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) - ), + encodings: ::graph::types::knowledge::entity::EntityEncodings(vectors: ?), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? )> @@ -130,59 +209,113 @@ └→ ( ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) ) -> List<::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? )> @@ -190,35 +323,62 @@ │ ::graph::head::entities(::graph::tmp::decision_time_now()), │ ( │ vertex:0: ::graph::types::knowledge::entity::Entity( -│ id: ::graph::types::knowledge::entity::EntityRecordId( -│ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), -│ entity_id: ::graph::types::knowledge::entity::EntityId( -│ draft_id: ::core::option::None(Null) -│ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), -│ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), -│ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) -│ ) +│ encodings: ::graph::types::knowledge::entity::EntityEncodings( +│ vectors: ? │ ), │ link_data: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::LinkData( +│ left_entity_confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ left_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ), +│ left_entity_provenance: ?, +│ right_entity_confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ right_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) -│ ) +│ ), +│ right_entity_provenance: ? │ )), +│ metadata: ::graph::types::knowledge::entity::EntityMetadata( +│ archived: Boolean, +│ confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), +│ entity_type_ids: List<::graph::types::ontology::VersionedUrl( +│ base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), +│ version: ::graph::ontology::OntologyTypeVersion(String) +│ )>, +│ properties: ?, +│ provenance: ::graph::types::knowledge::entity::EntityProvenance( +│ edition: ?, +│ inferred: ? +│ ), +│ record_id: ::graph::types::knowledge::entity::EntityRecordId( +│ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), +│ entity_id: ::graph::types::knowledge::entity::EntityId( +│ draft_id: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), +│ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), +│ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) +│ ) +│ ), +│ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( +│ decision_time: ?, +│ transaction_time: ? +│ ) +│ ), │ properties: ? │ ) │ ): Boolean -> │ ::core::cmp::eq( -│ vertex:0.id.entity_id.entity_uuid, +│ vertex:0.metadata.record_id.entity_id.entity_uuid, │ ::graph::types::knowledge::entity::EntityUuid( │ ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") │ ) @@ -226,30 +386,57 @@ │ ) └→ ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) @@ -258,89 +445,170 @@ └→ ( ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ), ( ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) -> Boolean ) -> ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) @@ -348,30 +616,57 @@ ┌─ ::graph::head::entities(::graph::tmp::decision_time_now()) └→ ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) @@ -380,30 +675,57 @@ └→ (::graph::TimeAxis(:)) -> ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) @@ -416,71 +738,125 @@ ┌─ ( │ vertex:0: ::graph::types::knowledge::entity::Entity( -│ id: ::graph::types::knowledge::entity::EntityRecordId( -│ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), -│ entity_id: ::graph::types::knowledge::entity::EntityId( -│ draft_id: ::core::option::None(Null) -│ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), -│ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), -│ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) -│ ) +│ encodings: ::graph::types::knowledge::entity::EntityEncodings( +│ vectors: ? │ ), │ link_data: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::LinkData( +│ left_entity_confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ left_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ), +│ left_entity_provenance: ?, +│ right_entity_confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ right_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) -│ ) +│ ), +│ right_entity_provenance: ? │ )), +│ metadata: ::graph::types::knowledge::entity::EntityMetadata( +│ archived: Boolean, +│ confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), +│ entity_type_ids: List<::graph::types::ontology::VersionedUrl( +│ base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), +│ version: ::graph::ontology::OntologyTypeVersion(String) +│ )>, +│ properties: ?, +│ provenance: ::graph::types::knowledge::entity::EntityProvenance( +│ edition: ?, +│ inferred: ? +│ ), +│ record_id: ::graph::types::knowledge::entity::EntityRecordId( +│ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), +│ entity_id: ::graph::types::knowledge::entity::EntityId( +│ draft_id: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), +│ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), +│ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) +│ ) +│ ), +│ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( +│ decision_time: ?, +│ transaction_time: ? +│ ) +│ ), │ properties: ? │ ) │ ): Boolean -> │ ::core::cmp::eq( -│ vertex:0.id.entity_id.entity_uuid, +│ vertex:0.metadata.record_id.entity_id.entity_uuid, │ ::graph::types::knowledge::entity::EntityUuid( │ ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") │ ) │ ) └→ ( ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) -> Boolean ┌─ ::core::cmp::eq( -│ vertex:0.id.entity_id.entity_uuid, +│ vertex:0.metadata.record_id.entity_id.entity_uuid, │ ::graph::types::knowledge::entity::EntityUuid( │ ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") │ ) @@ -493,10 +869,10 @@ ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)) ) -> Boolean -┌─ vertex:0.id.entity_id.entity_uuid +┌─ vertex:0.metadata.record_id.entity_id.entity_uuid └→ ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)) -┌─ vertex:0.id.entity_id +┌─ vertex:0.metadata.record_id.entity_id └→ ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), @@ -504,7 +880,7 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) -┌─ vertex:0.id +┌─ vertex:0.metadata.record_id └→ ::graph::types::knowledge::entity::EntityRecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( @@ -515,9 +891,21 @@ ) ) -┌─ vertex:0 -└→ ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( +┌─ vertex:0.metadata +└→ ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -526,21 +914,63 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ) + +┌─ vertex:0 +└→ ::graph::types::knowledge::entity::Entity( + encodings: ::graph::types::knowledge::entity::EntityEncodings(vectors: ?), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.jsonc b/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.jsonc index e98bc6338ed..5774cc1605b 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.jsonc +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.jsonc @@ -10,7 +10,7 @@ "_", [ "==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", [ "::graph::types::knowledge::entity::EntityUuid", [ diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.stdout b/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.stdout index f43f96047a4..0d816e96cc8 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.stdout @@ -4,7 +4,7 @@ ::graph::head::entities(::graph::tmp::decision_time_now()), (vertex:0: _0): _1 -> ::core::cmp::eq( - vertex:0.id.entity_id.entity_uuid, + vertex:0.metadata.record_id.entity_id.entity_uuid, ::graph::types::knowledge::entity::EntityUuid( ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") ) @@ -17,35 +17,62 @@ ::graph::head::entities(::graph::tmp::decision_time_now()), ( vertex:0: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ): Boolean -> ::core::cmp::eq( - vertex:0.id.entity_id.entity_uuid, + vertex:0.metadata.record_id.entity_id.entity_uuid, ::graph::types::knowledge::entity::EntityUuid( ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") ) @@ -58,35 +85,62 @@ │ ::graph::head::entities(::graph::tmp::decision_time_now()), │ ( │ vertex:0: ::graph::types::knowledge::entity::Entity( -│ id: ::graph::types::knowledge::entity::EntityRecordId( -│ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), -│ entity_id: ::graph::types::knowledge::entity::EntityId( -│ draft_id: ::core::option::None(Null) -│ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), -│ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), -│ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) -│ ) +│ encodings: ::graph::types::knowledge::entity::EntityEncodings( +│ vectors: ? │ ), │ link_data: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::LinkData( +│ left_entity_confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ left_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ), +│ left_entity_provenance: ?, +│ right_entity_confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ right_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) -│ ) +│ ), +│ right_entity_provenance: ? │ )), +│ metadata: ::graph::types::knowledge::entity::EntityMetadata( +│ archived: Boolean, +│ confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), +│ entity_type_ids: List<::graph::types::ontology::VersionedUrl( +│ base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), +│ version: ::graph::ontology::OntologyTypeVersion(String) +│ )>, +│ properties: ?, +│ provenance: ::graph::types::knowledge::entity::EntityProvenance( +│ edition: ?, +│ inferred: ? +│ ), +│ record_id: ::graph::types::knowledge::entity::EntityRecordId( +│ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), +│ entity_id: ::graph::types::knowledge::entity::EntityId( +│ draft_id: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), +│ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), +│ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) +│ ) +│ ), +│ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( +│ decision_time: ?, +│ transaction_time: ? +│ ) +│ ), │ properties: ? │ ) │ ): Boolean -> │ ::core::cmp::eq( -│ vertex:0.id.entity_id.entity_uuid, +│ vertex:0.metadata.record_id.entity_id.entity_uuid, │ ::graph::types::knowledge::entity::EntityUuid( │ ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") │ ) @@ -94,30 +148,57 @@ │ ) └→ ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) @@ -126,89 +207,170 @@ └→ ( ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ), ( ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) -> Boolean ) -> ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) @@ -216,30 +378,57 @@ ┌─ ::graph::head::entities(::graph::tmp::decision_time_now()) └→ ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) @@ -248,30 +437,57 @@ └→ (::graph::TimeAxis(:)) -> ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) @@ -284,71 +500,125 @@ ┌─ ( │ vertex:0: ::graph::types::knowledge::entity::Entity( -│ id: ::graph::types::knowledge::entity::EntityRecordId( -│ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), -│ entity_id: ::graph::types::knowledge::entity::EntityId( -│ draft_id: ::core::option::None(Null) -│ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), -│ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), -│ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) -│ ) +│ encodings: ::graph::types::knowledge::entity::EntityEncodings( +│ vectors: ? │ ), │ link_data: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::LinkData( +│ left_entity_confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ left_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ), +│ left_entity_provenance: ?, +│ right_entity_confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ right_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) -│ ) +│ ), +│ right_entity_provenance: ? │ )), +│ metadata: ::graph::types::knowledge::entity::EntityMetadata( +│ archived: Boolean, +│ confidence: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), +│ entity_type_ids: List<::graph::types::ontology::VersionedUrl( +│ base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), +│ version: ::graph::ontology::OntologyTypeVersion(String) +│ )>, +│ properties: ?, +│ provenance: ::graph::types::knowledge::entity::EntityProvenance( +│ edition: ?, +│ inferred: ? +│ ), +│ record_id: ::graph::types::knowledge::entity::EntityRecordId( +│ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), +│ entity_id: ::graph::types::knowledge::entity::EntityId( +│ draft_id: ::core::option::None(Null) +│ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), +│ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), +│ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) +│ ) +│ ), +│ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( +│ decision_time: ?, +│ transaction_time: ? +│ ) +│ ), │ properties: ? │ ) │ ): Boolean -> │ ::core::cmp::eq( -│ vertex:0.id.entity_id.entity_uuid, +│ vertex:0.metadata.record_id.entity_id.entity_uuid, │ ::graph::types::knowledge::entity::EntityUuid( │ ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") │ ) │ ) └→ ( ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) -> Boolean ┌─ ::core::cmp::eq( -│ vertex:0.id.entity_id.entity_uuid, +│ vertex:0.metadata.record_id.entity_id.entity_uuid, │ ::graph::types::knowledge::entity::EntityUuid( │ ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") │ ) @@ -361,10 +631,10 @@ ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)) ) -> Boolean -┌─ vertex:0.id.entity_id.entity_uuid +┌─ vertex:0.metadata.record_id.entity_id.entity_uuid └→ ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)) -┌─ vertex:0.id.entity_id +┌─ vertex:0.metadata.record_id.entity_id └→ ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), @@ -372,7 +642,7 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) -┌─ vertex:0.id +┌─ vertex:0.metadata.record_id └→ ::graph::types::knowledge::entity::EntityRecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( @@ -383,9 +653,21 @@ ) ) -┌─ vertex:0 -└→ ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( +┌─ vertex:0.metadata +└→ ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -394,21 +676,63 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ) + +┌─ vertex:0 +└→ ::graph::types::knowledge::entity::Entity( + encodings: ::graph::types::knowledge::entity::EntityEncodings(vectors: ?), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/minimal-graph.stdout b/libs/@local/hashql/hir/tests/ui/lower/checking/minimal-graph.stdout index 548859ffdef..d34dc296e9b 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/minimal-graph.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/minimal-graph.stdout @@ -16,30 +16,55 @@ │ ::graph::head::entities(::graph::tmp::decision_time_now()) │ ) └→ List<::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) - ), + encodings: ::graph::types::knowledge::entity::EntityEncodings(vectors: ?), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? )> @@ -47,89 +72,170 @@ └→ ( ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) ) -> List<::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? )> ┌─ ::graph::head::entities(::graph::tmp::decision_time_now()) └→ ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) @@ -138,30 +244,57 @@ └→ (::graph::TimeAxis(:)) -> ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ) diff --git a/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/double-hoist-deny.jsonc b/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/double-hoist-deny.jsonc index 23a3ca20ffe..228a6078ee1 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/double-hoist-deny.jsonc +++ b/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/double-hoist-deny.jsonc @@ -36,8 +36,8 @@ "_", [ "==", - "vertex1.id.entity_id.entity_uuid", - "vertex2.id.entity_id.entity_uuid" + "vertex1.metadata.record_id.entity_id.entity_uuid", + "vertex2.metadata.record_id.entity_id.entity_uuid" ] ] ] diff --git a/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/double-hoist-deny.stdout b/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/double-hoist-deny.stdout index ecb3ae8b9f0..ef8b987e611 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/double-hoist-deny.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/double-hoist-deny.stdout @@ -14,8 +14,8 @@ in ), (vertex2:0: _2): _3 -> ::core::cmp::eq( - vertex1:0.id.entity_id.entity_uuid, - vertex2:0.id.entity_id.entity_uuid + vertex1:0.metadata.record_id.entity_id.entity_uuid, + vertex2:0.metadata.record_id.entity_id.entity_uuid ) ) ) @@ -34,7 +34,7 @@ let a:0 = true, |> ::graph::body::filter((vertex1:0: Entity): Boolean -> let c:0 = ::graph::head::entities(%6) |> ::graph::body::filter((vertex2:0: Entity): Boolean -> - let %7 = vertex1:0.id.entity_id.entity_uuid == vertex2:0.id.entity_id.entity_uuid + let %7 = vertex1:0.metadata.record_id.entity_id.entity_uuid == vertex2:0.metadata.record_id.entity_id.entity_uuid in %7 ) diff --git a/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/partial.jsonc b/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/partial.jsonc index a1a68eb158f..babcb005b80 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/partial.jsonc +++ b/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/partial.jsonc @@ -12,7 +12,7 @@ "_", [ "==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", [ "::graph::types::knowledge::entity::EntityUuid", [ diff --git a/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/partial.stdout b/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/partial.stdout index f5276357f96..4bf1d1fb526 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/partial.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/graph-hoisting/partial.stdout @@ -5,7 +5,7 @@ ::graph::head::entities(::graph::tmp::decision_time_now()), (vertex:0: _0): _1 -> ::core::cmp::eq( - vertex:0.id.entity_id.entity_uuid, + vertex:0.metadata.record_id.entity_id.entity_uuid, ::graph::types::knowledge::entity::EntityUuid( ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") ) @@ -22,7 +22,9 @@ let %1 = ::graph::tmp::decision_time_now(), %5 = %4(%3), %7 = ::graph::head::entities(%1) |> ::graph::body::filter((vertex:0: Entity): Boolean -> - let %6 = vertex:0.id.entity_id.entity_uuid == %5 in %6 + let %6 = vertex:0.metadata.record_id.entity_id.entity_uuid == %5 + in + %6 ) |> ::graph::tail::collect in diff --git a/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-custom-collect.stderr b/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-custom-collect.stderr index 28a1fcc8d13..4100f56b8a8 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-custom-collect.stderr +++ b/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-custom-collect.stderr @@ -6,59 +6,113 @@ error[lower::specialization::non-intrinsic-graph-operation]: Non-intrinsic funct ├ help: ( │ graph:0: ::graph::Graph( │ 'marker: ::graph::types::knowledge::entity::Entity( - │ id: ::graph::types::knowledge::entity::EntityRecordId( - │ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - │ entity_id: ::graph::types::knowledge::entity::EntityId( - │ draft_id: ::core::option::None(Null) - │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - │ ) + │ encodings: ::graph::types::knowledge::entity::EntityEncodings( + │ vectors: ? │ ), │ link_data: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + │ left_entity_confidence: ::core::option::None(Null) + │ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ left_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ), + │ left_entity_provenance: ?, + │ right_entity_confidence: ::core::option::None(Null) + │ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ right_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - │ ) + │ ), + │ right_entity_provenance: ? │ )), + │ metadata: ::graph::types::knowledge::entity::EntityMetadata( + │ archived: Boolean, + │ confidence: ::core::option::None(Null) + │ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + │ entity_type_ids: List<::graph::types::ontology::VersionedUrl( + │ base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + │ version: ::graph::ontology::OntologyTypeVersion(String) + │ )>, + │ properties: ?, + │ provenance: ::graph::types::knowledge::entity::EntityProvenance( + │ edition: ?, + │ inferred: ? + │ ), + │ record_id: ::graph::types::knowledge::entity::EntityRecordId( + │ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + │ entity_id: ::graph::types::knowledge::entity::EntityId( + │ draft_id: ::core::option::None(Null) + │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + │ ) + │ ), + │ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + │ decision_time: ?, + │ transaction_time: ? + │ ) + │ ), │ properties: ? │ ) │ ) │ ): ::graph::Graph( │ 'marker: ::graph::types::knowledge::entity::Entity( - │ id: ::graph::types::knowledge::entity::EntityRecordId( - │ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - │ entity_id: ::graph::types::knowledge::entity::EntityId( - │ draft_id: ::core::option::None(Null) - │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - │ ) + │ encodings: ::graph::types::knowledge::entity::EntityEncodings( + │ vectors: ? │ ), │ link_data: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + │ left_entity_confidence: ::core::option::None(Null) + │ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ left_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ), + │ left_entity_provenance: ?, + │ right_entity_confidence: ::core::option::None(Null) + │ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), │ right_entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - │ ) + │ ), + │ right_entity_provenance: ? │ )), + │ metadata: ::graph::types::knowledge::entity::EntityMetadata( + │ archived: Boolean, + │ confidence: ::core::option::None(Null) + │ | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + │ entity_type_ids: List<::graph::types::ontology::VersionedUrl( + │ base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + │ version: ::graph::ontology::OntologyTypeVersion(String) + │ )>, + │ properties: ?, + │ provenance: ::graph::types::knowledge::entity::EntityProvenance( + │ edition: ?, + │ inferred: ? + │ ), + │ record_id: ::graph::types::knowledge::entity::EntityRecordId( + │ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + │ entity_id: ::graph::types::knowledge::entity::EntityId( + │ draft_id: ::core::option::None(Null) + │ | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + │ entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + │ ) + │ ), + │ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + │ decision_time: ?, + │ transaction_time: ? + │ ) + │ ), │ properties: ? │ ) │ ) -> graph:0 is not a valid graph operation. Graph operation chains can only contain intrinsic functions that are part of the HashQL graph API. Higher-order functions (HOFs) and user-defined functions are not supported yet. To track support for user-defined functions see https://linear.app/hash/issue/H-4776/hashql-allow-user-defined-functions-in-graph-pipelines diff --git a/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.jsonc b/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.jsonc index 1543881d213..6a3def6a90c 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.jsonc +++ b/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.jsonc @@ -12,7 +12,7 @@ "_", [ "==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", [ "::graph::types::knowledge::entity::EntityUuid", [ diff --git a/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.stdout b/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.stdout index 34dea127015..70b5b74655a 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.stdout @@ -5,7 +5,7 @@ ::graph::head::entities(::graph::tmp::decision_time_now()), (vertex:0: _0): _1 -> ::core::cmp::eq( - vertex:0.id.entity_id.entity_uuid, + vertex:0.metadata.record_id.entity_id.entity_uuid, ::graph::types::knowledge::entity::EntityUuid( ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") ) @@ -18,34 +18,61 @@ ::graph::head::entities(::graph::tmp::decision_time_now()) |> ::graph::body::filter(( vertex:0: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ): Boolean -> - vertex:0.id.entity_id.entity_uuid == ::graph::types::knowledge::entity::EntityUuid( + vertex:0.metadata.record_id.entity_id.entity_uuid == ::graph::types::knowledge::entity::EntityUuid( ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") ) ) diff --git a/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.jsonc b/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.jsonc index e98bc6338ed..5774cc1605b 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.jsonc +++ b/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.jsonc @@ -10,7 +10,7 @@ "_", [ "==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", [ "::graph::types::knowledge::entity::EntityUuid", [ diff --git a/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.stdout b/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.stdout index 65ca7622920..742855c98c0 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.stdout @@ -4,7 +4,7 @@ ::graph::head::entities(::graph::tmp::decision_time_now()), (vertex:0: _0): _1 -> ::core::cmp::eq( - vertex:0.id.entity_id.entity_uuid, + vertex:0.metadata.record_id.entity_id.entity_uuid, ::graph::types::knowledge::entity::EntityUuid( ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") ) @@ -17,34 +17,61 @@ ::graph::head::entities(::graph::tmp::decision_time_now()), ( vertex:0: ::graph::types::knowledge::entity::Entity( - id: ::graph::types::knowledge::entity::EntityRecordId( - edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), - entity_id: ::graph::types::knowledge::entity::EntityId( - draft_id: ::core::option::None(Null) - | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), - entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), - web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + encodings: ::graph::types::knowledge::entity::EntityEncodings( + vectors: ? ), link_data: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::LinkData( + left_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), left_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ), + left_entity_provenance: ?, + right_entity_confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), right_entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) - ) + ), + right_entity_provenance: ? )), + metadata: ::graph::types::knowledge::entity::EntityMetadata( + archived: Boolean, + confidence: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::Confidence(Number)), + entity_type_ids: List<::graph::types::ontology::VersionedUrl( + base_url: ::graph::types::ontology::BaseUrl(::core::url::Url(String)), + version: ::graph::ontology::OntologyTypeVersion(String) + )>, + properties: ?, + provenance: ::graph::types::knowledge::entity::EntityProvenance( + edition: ?, + inferred: ? + ), + record_id: ::graph::types::knowledge::entity::EntityRecordId( + edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), + entity_id: ::graph::types::knowledge::entity::EntityId( + draft_id: ::core::option::None(Null) + | ::core::option::Some(::graph::types::knowledge::entity::DraftId(::core::uuid::Uuid(String))), + entity_uuid: ::graph::types::knowledge::entity::EntityUuid(::core::uuid::Uuid(String)), + web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) + ) + ), + temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( + decision_time: ?, + transaction_time: ? + ) + ), properties: ? ) ): Boolean -> - vertex:0.id.entity_id.entity_uuid == ::graph::types::knowledge::entity::EntityUuid( + vertex:0.metadata.record_id.entity_id.entity_uuid == ::graph::types::knowledge::entity::EntityUuid( ::core::uuid::Uuid("e2851dbb-7376-4959-9bca-f72cafc4448f") ) ) diff --git a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.jsonc b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.jsonc index ca5c3ce43f9..da71b8f06ab 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.jsonc +++ b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.jsonc @@ -15,7 +15,7 @@ "_", [ "==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", [ "::graph::types::knowledge::entity::EntityUuid", [ diff --git a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.stdout b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.stdout index 639ab3f9cd8..34b1520b153 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.stdout +++ b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.stdout @@ -82,7 +82,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity bb0(): { %2 = apply ({thunk#5} as FnPtr) - %3 = %1.id.entity_id.entity_uuid == %2 + %3 = %1.metadata.record_id.entity_id.entity_uuid == %2 return %3 } @@ -189,7 +189,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity bb0(): { %3 = opaque(::core::uuid::Uuid, "e2851dbb-7376-4959-9bca-f72cafc4448f") %4 = opaque(::graph::types::knowledge::entity::EntityUuid, %3) - %2 = %1.id.entity_id.entity_uuid == %4 + %2 = %1.metadata.record_id.entity_id.entity_uuid == %4 return %2 } @@ -296,7 +296,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity bb0(): { %3 = opaque(::core::uuid::Uuid, "e2851dbb-7376-4959-9bca-f72cafc4448f") %4 = opaque(::graph::types::knowledge::entity::EntityUuid, %3) - %2 = %1.id.entity_id.entity_uuid == %4 + %2 = %1.metadata.record_id.entity_id.entity_uuid == %4 return %2 } diff --git a/libs/@local/hashql/mir/tests/ui/reify/graph-read.jsonc b/libs/@local/hashql/mir/tests/ui/reify/graph-read.jsonc index 96a9c37c0f3..57decdd1e6b 100644 --- a/libs/@local/hashql/mir/tests/ui/reify/graph-read.jsonc +++ b/libs/@local/hashql/mir/tests/ui/reify/graph-read.jsonc @@ -15,7 +15,7 @@ "_", [ "==", - "vertex.id.entity_id.entity_uuid", + "vertex.metadata.record_id.entity_id.entity_uuid", [ "::graph::types::knowledge::entity::EntityUuid", [ diff --git a/libs/@local/hashql/mir/tests/ui/reify/graph-read.stdout b/libs/@local/hashql/mir/tests/ui/reify/graph-read.stdout index f3dd0cdef82..dea77dc30ef 100644 --- a/libs/@local/hashql/mir/tests/ui/reify/graph-read.stdout +++ b/libs/@local/hashql/mir/tests/ui/reify/graph-read.stdout @@ -80,7 +80,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity bb0(): { %2 = apply ({thunk#5} as FnPtr) - %3 = %1.id.entity_id.entity_uuid == %2 + %3 = %1.metadata.record_id.entity_id.entity_uuid == %2 return %3 } diff --git a/tests/graph/benches/graph/scenario/stages/mod.rs b/tests/graph/benches/graph/scenario/stages/mod.rs index 25c9cabc744..a0e68313463 100644 --- a/tests/graph/benches/graph/scenario/stages/mod.rs +++ b/tests/graph/benches/graph/scenario/stages/mod.rs @@ -132,8 +132,7 @@ impl Stage { .await .map(|result| json!(result)) .change_context(StageError), - Self::QueryEntitiesByUser(stage) => stage - .execute(runner) + Self::QueryEntitiesByUser(stage) => Box::pin(stage.execute(runner)) .await .map(|result| json!(result)) .change_context(StageError),