Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Use-case : define node labels #31

@WilliamChelman

Description

@WilliamChelman

In either context of searching for a node, displaying it in a tree, an autocomplete, or wherever other case. We should be able to define the logic in which the label of a given node is determined or computed.

Simple property at the sh:PropertyShape level

At its simplest, a property shape could be defined as being used for defining the label of the node. Not advising a particular nomenclature just yet, but it could be defined as such:

<prefLabel>
  a sh:PropertyShape ;
  sh:path skos:prefLabel ;
  sh:datatype rdf:langString ; 
  shui:purpose shui:DefaultLabelPurpose ;
.

A boolean might be enough, but I do like the idea of defining purposes/use-cases for shapes in general (not only linked to labelling, I might created a dedicated issue for that). We could imagine other labelling purposes like shui:AutocompleteLabelPurpose, shui:SearchLabelPurpose, shui:TreeLabelPurpose and so on, depending on what we feel might make sense.

"Templating" at the sh:NodeShape level

The previous proposition would likely work for most cases, but what about label composition? For example, we might want to concatenate, for a given skos:Concept, its skos:prefLabel and the skos:prefLabel of all its "broader chain". For such more complex cases, being able to make use of a sparql query to build the label triples would be a good option:

<Concept>
  a sh:NodeShape ;
  sh:targetClass skos:Concept ;
  shui:labelQuery """a spaqrl query that returns labels"""
.

Wrapping things all together

Defining labelling logic at 2 possible different levels might be both counter-intuitive and hard to follow, so maybe have everything at the sh:NodeShape level instead?

<Concept>
  a sh:NodeShape ;
  sh:targetClass skos:Concept ;
  shui:labelDefinition [ 
    shui:purpose shui:DefaultLabelPurpose ;
    shui:propertyForLabel skos:prefLabel ;
  ]
  shui:labelDefinition [ 
    shui:purpose shui:SearchLabelPurpose ;
    shui:queryForLabel """my awesome SPARQL query""" ;
  ]
.

But I'll stop there for now, as we first need to decide it this feature makes sense in shacl-ui or not 😅

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