Rendering types for a predicate - view-a-LOD/Valeros GitHub Wiki

![400](https://raw.githubusercontent.com/wiki/view-a-LOD/Valeros_Files/Pasted image 20240709095119.png)

If you want to render certain objects as types, e.g., for the rdf:type predicate, you can add a NodeTypeComponent entry to the renderComponents/[RenderMode.ByPredicate] field in config/settings.ts:

[RenderMode.ByPredicate]: [{
    component: NodeTypeComponent,
    predicates: [
        'http://www.w3.org/1999/02/22-rdf-syntax-ns#type',
        'https://schema.org/additionalType',
        'http://www.wikidata.org/entity/P31',
    ],
    requiresExplicitRendering: true,
}],

[!NOTE]
The NodeTypeComponent is not a 'regular' predicate render component (see Rendering custom components for a predicate), but used elsewhere throughout the codebase as well. Because of this, its input properties do not match the expected default data structure, which means we need to explicitly define how to pass data to it in the NodeTableCellComponent, which is where all predicate render components are rendered by default. To show that this component requires explicit manual configuration, we use the requiresExplicitRendering field.