Re: Graph Merging Algorithms and JSON-LD Schemas

If you want automated consistency check, have a look at shacl. It lets you
formally define and verify desired shape of the resulting graph after
merge. For instance, the rule sh:maxCount 1 ; set on property will ensure
that it can't have two different values.

On Sat, Feb 28, 2026, 01:33 Adam Sobieski <adamsobieski@hotmail.com> wrote:

> JSON-LD Community Group,
>
> With respect to merging JSON-LD documents, two at a time, should JSON-LD
> schemas be able to express per-property rules or hints to override default
> merging-algorithm behaviors?
>
> In many cases, properties each having a single value could be merged into
> arrays with two elements. In many cases, values and arrays could be
> concatenated, treating values as singleton arrays. In many cases, arrays
> could be simply concatenated.
>
> For some Boolean properties, however, developers might want to be able to
> indicate that these properties' values could only be merged if two
> documents' values were identical, to avoid a property having both a "true"
> and "false" value in a merge result. One might want to be able to define,
> using JSON-LD schema, that a merging algorithm should throw an error if two
> distinct values were being merged for a certain property.
>
> What do you think about being able to specify per-property rules or hints
> for JSON-LD graph-merging algorithms, being able to override default
> algorithm behavior, being able to indicate if and when to throw errors,
> using JSON-LD schemas?
>
>
> Best regards,
> Adam Sobieski
>
> P.S.: Motivating use cases include developers being able to provide inline
> or URL-addressed JSON-LD data in security-related (e.g.,
> access-control-related) attributes, annotations, and decorators on
> functions and methods. As envisioned, JSON-LD content could be merged
> together from multiple decorators' metadata, into the resultant metadata
> for a function or method...
>
> @mcp_tool('foo')
> @metadata(fetch('https://example.org/security/category-1.jsonld'))
> @metadata(fetch('https://example.org/security/resource-use-3.jsonld'))
> foo(...)
> {
>     ...
> }
>
>

Received on Saturday, 28 February 2026 03:20:20 UTC