MCPcopy Create free account
hub / github.com/hashintel/hash / create_entity

Method create_entity

libs/@local/graph/store/src/entity/store.rs:700–711  ·  view source on GitHub ↗

Creates a new [`Entity`]. # Errors: - if the [`EntityType`] doesn't exist - if the [`PropertyObjectWithMetadata`] is not valid with respect to the specified [`EntityType`] - if the account referred to by `web_id` does not exist - if an [`EntityUuid`] was supplied and already exists in the store [`EntityType`]: type_system::ontology::entity_type::EntityType

(
        &mut self,
        actor_id: ActorEntityUuid,
        params: CreateEntityParams,
    )

Source from the content-addressed store, hash-verified

698 ///
699 /// [`EntityType`]: type_system::ontology::entity_type::EntityType
700 fn create_entity(
701 &mut self,
702 actor_id: ActorEntityUuid,
703 params: CreateEntityParams,
704 ) -> impl Future<Output = Result<Entity, Report<InsertionError>>> + Send {
705 self.create_entities(actor_id, vec![params])
706 .map_ok(|mut entities| {
707 let entity = entities.pop().expect("Expected a single entity");
708 assert!(entities.is_empty(), "Expected a single entity");
709 entity
710 })
711 }
712
713 /// Creates new [`Entities`][Entity].
714 fn create_entities(

Callers 15

insertFunction · 0.80
initial_personFunction · 0.80
create_multiFunction · 0.80
summary_aggregationsFunction · 0.80
initial_draftFunction · 0.80
no_initial_draftFunction · 0.80
multiple_draftsFunction · 0.80
insertFunction · 0.80
queryFunction · 0.80
updateFunction · 0.80
properties_addFunction · 0.80

Implementers 3

lib.rstests/graph/integration/postgres/lib.r
store.rslibs/@local/graph/type-fetcher/src/sto
mod.rslibs/@local/graph/postgres-store/src/s

Calls 3

popMethod · 0.65
create_entitiesMethod · 0.45
expectMethod · 0.45

Tested by 10

create_entityFunction · 0.64
seed_dataFunction · 0.64
create_personFunction · 0.64
create_linkFunction · 0.64
entity_reuse_after_eraseFunction · 0.64
published_entityFunction · 0.64
cross_web_batchFunction · 0.64