Skip to content

False-positive ERROR: PART_OF + INCLUDES inverse check is entity-scoped, but spec §10 defines it as pair-scoped #14

Open

Description

@d-damba

Summary

The validator at entitymap.org/validate rejects — as an error, not a warning — any entity that declares PART_OF and INCLUDES toward different target entities, treating them as implicit-inverse duplicates.

Per the spec's own validation contract (§10) and the predicate documentation (§7.1, §7.5, predicate reference), the prohibition applies only to declaring both directions between the same pair of entities. The check appears to test for co-occurrence of the two predicates within one entity's relations array without comparing targets. Because the finding is classified as an error, fully conformant maps are marked Invalid — must fix before publishing.

Minimal reproduction

Paste the JSON below into the validator. e_001 relates to two different entities, one direction each — the pair (e_001, e_002) carries only PART_OF, and the pair (e_001, e_003) carries only INCLUDES. No entity pair in the map carries both directions of any relation.

Expected: no inverse-pair finding.

Actual (verbatim):

Invalid — 1 error found · Pasted JSON · EntityMap v1.0 · 3 entities · 3 chunks

✗ Both "PART_OF" and "INCLUDES" declared on "Widget Engine" — implicit inverses, declare only one direction
entities[0] (Widget Engine).relations
Fix: Remove "INCLUDES" — it is the implicit inverse of "PART_OF".

{
  "version": "1.0",
  "schema": "https://entitymap.org/spec/v1.0",
  "publisher": { "name": "Example Co", "url": "https://example.com/" },
  "generated": "2026-07-04T12:00:00Z",
  "verificationStatus": "self-declared",
  "entities": [
    {
      "entityId": "e_001",
      "@type": "SoftwareProduct",
      "name": "Widget Engine",
      "description": "A component of the Example Platform that contains the Widget Renderer.",
      "hasChunks": [
        {
          "chunkId": "c_001",
          "text": "The Widget Engine ships inside the Example Platform and contains the Widget Renderer.",
          "sourceUrl": "https://example.com/widget-engine",
          "pageTitle": "Widget Engine",
          "publisher": "Example Co"
        }
      ],
      "relations": [
        { "predicate": "PART_OF", "targetId": "e_002", "targetName": "Example Platform" },
        { "predicate": "INCLUDES", "targetId": "e_003", "targetName": "Widget Renderer" }
      ]
    },
    {
      "entityId": "e_002",
      "@type": "Platform",
      "name": "Example Platform",
      "description": "The platform the Widget Engine is part of.",
      "hasChunks": [
        {
          "chunkId": "c_002",
          "text": "The Example Platform bundles several engines.",
          "sourceUrl": "https://example.com/platform",
          "pageTitle": "Example Platform",
          "publisher": "Example Co"
        }
      ]
    },
    {
      "entityId": "e_003",
      "@type": "SoftwareProduct",
      "name": "Widget Renderer",
      "description": "A renderer contained within the Widget Engine.",
      "hasChunks": [
        {
          "chunkId": "c_003",
          "text": "The Widget Renderer draws widgets on screen.",
          "sourceUrl": "https://example.com/renderer",
          "pageTitle": "Widget Renderer",
          "publisher": "Example Co"
        }
      ]
    }
  ]
}

What the spec says

§10 (Validation) — the spec's own list of what the validator errors on — scopes this rule to the pair:

Both directions of PART_OF/INCLUDES declared between the same entity pair.

Every other inverse rule in §10 is scoped the same way ("IMPROVES and DEGRADES, or ENABLES and PREVENTS, declared between the same entity pair"; "OFFERS and PRODUCED_BY declared between the same entity pair in either direction"), so entity-level exclusivity is not documented anywhere in the spec.

The rest of the spec is consistent with §10:

  • §7.1 (Tier 1 — Hard predicates): "Inverses are implicit — never declare both directions of PART_OF/INCLUDES."
  • §7.5 (Direction discipline and forbidden forms): "EntityMap predicates are directional and inverses are implicit — for each pair of entities, declare the relation in exactly one direction." §7.5's own remedy for inverse needs is "swap subject and target and use the standard predicate instead" — i.e., the spec's model is a pair-scoped direction choice, not banning a predicate from an entity outright.
  • Predicate reference, intro: "never declare both directions of a relationship pair (e.g. PART_OF and INCLUDES) between the same two entities."
  • Predicate reference, INCLUDES: "Inverse of PART_OF — never declare both directions between the same pair."

Why entity-scoping breaks real maps

Any middle node of a containment hierarchy legitimately carries both predicates: it is PART_OF something bigger and it INCLUDES smaller components (Platform ⊃ Engine ⊃ Renderer). Under the current check, INCLUDES becomes unusable on any entity that is also PART_OF anything — a constraint that appears nowhere in the spec. And because the finding is an error, such maps are marked Invalid outright.

The message's suggested fix makes this concrete: "Remove INCLUDES" would delete true, non-redundant relations (in the real generated map where we first hit this, three of them), losing information rather than removing a duplicate.

Suggested fix

Scope the inverse-pair check to the unordered entity pair, matching §10: flag PART_OF/INCLUDES (and the other implicit-inverse pairs, e.g. OFFERS/PRODUCED_BY) only when both directions are declared between the same two entities.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions