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:
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?
In my experience, the expectation for labels is that they also work in the other direction, e.g. for auto-complete purposes. Do you have thoughts on how this could work if labels are dynamically created?
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
levelAt 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:
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
levelThe 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
, itsskos:prefLabel
and theskos: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: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?But I'll stop there for now, as we first need to decide it this feature makes sense in shacl-ui or not 😅