@inrupt/solid-client
    Preparing search index...

    Function buildThing

    Create or modify a [[Thing]], setting multiple properties in a single expresssion.

    For example, you can create a new Thing and initialise several properties as follows:

    const me = buildThing()
      .addUrl(rdf.type, schema.Person)
      .addStringNoLocale(schema.givenName, "Vincent")
      .build();
    

    Take note of the final call to .build() to obtain the actual Thing.

    Optionally pass an existing [[Thing]] to modify the properties of. If left empty, buildThing will initialise a new Thing.

    a [[ThingBuilder]], a Fluent API that allows you to set multiple properties in a single expression.

    1.9.0

    • Modify a [[Thing]], setting multiple properties in a single expresssion.

      For example, you can initialise several properties of a given Thing as follows:

      const me = buildThing(createThing({ name: "profile-vincent" }))
        .addUrl(rdf.type, schema.Person)
        .addStringNoLocale(schema.givenName, "Vincent")
        .build();
      

      Take note of the final call to .build() to obtain the actual Thing.

      Parameters

      Returns ThingBuilder<ThingLocal>

      a [[ThingBuilder]], a Fluent API that allows you to set multiple properties in a single expression.

      1.9.0

    • Modify a [[Thing]], setting multiple properties in a single expresssion.

      For example, you can initialise several properties of a given Thing as follows:

      const me = buildThing(createThing({ url: "https://example.pod/profile#vincent" }))
        .addUrl(rdf.type, schema.Person)
        .addStringNoLocale(schema.givenName, "Vincent")
        .build();
      

      Take note of the final call to .build() to obtain the actual Thing.

      Parameters

      Returns ThingBuilder<ThingPersisted>

      a [[ThingBuilder]], a Fluent API that allows you to set multiple properties in a single expression.

      1.9.0

    • Create a [[Thing]], setting multiple properties in a single expresssion.

      For example, you can create a new Thing and initialise several properties as follows:

      const me = buildThing({ name: "profile-vincent" })
        .addUrl(rdf.type, schema.Person)
        .addStringNoLocale(schema.givenName, "Vincent")
        .build();
      

      Take note of the final call to .build() to obtain the actual Thing.

      Parameters

      Returns ThingBuilder<ThingLocal>

      a [[ThingBuilder]], a Fluent API that allows you to set multiple properties in a single expression.

      1.9.0

    • Create a [[Thing]], setting multiple properties in a single expresssion.

      For example, you can create a new Thing and initialise several properties as follows:

      const me = buildThing({ url: "https://example.pod/profile#vincent" })
        .addUrl(rdf.type, schema.Person)
        .addStringNoLocale(schema.givenName, "Vincent")
        .build();
      

      Take note of the final call to .build() to obtain the actual Thing.

      Parameters

      • init: CreateThingPersistedOptions

        Optionally pass an existing [[Thing]] to modify the properties of. If left empty, buildThing will initialise a new Thing.

      Returns ThingBuilder<ThingPersisted>

      a [[ThingBuilder]], a Fluent API that allows you to set multiple properties in a single expression.

      1.9.0

    • Create a [[Thing]], setting multiple properties in a single expresssion.

      For example, you can create a new Thing and initialise several properties as follows:

      const me = buildThing()
        .addUrl(rdf.type, schema.Person)
        .addStringNoLocale(schema.givenName, "Vincent")
        .build();
      

      Take note of the final call to .build() to obtain the actual Thing.

      Returns ThingBuilder<ThingLocal>

      a [[ThingBuilder]], a Fluent API that allows you to set multiple properties in a single expression.

      1.9.0