Skip to content

SHACL Inference Rules - Use Case: consistent language tag handling for SKOS labels #298

Open
@robert-david

Description

@robert-david

SKOS concepts use labels as a textual representation. These labels can be used for concept annotations in documents, where they are textually matched to terms in the text. In this use case, it is important to have a clear definition of languages and every label should define the language as a tag so that it is only matched in documents of the same language. If a label has no tag, it can be added (inferred) based on a default language, which can be defined for a specific use case.

Data graph:

@prefix ex: <http://example.com/ns#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

ex:concept1 a skos:Concept ;
    skos:prefLabel "animals" ;
    skos:altLabel "fauna"@en .

Shapes graph:

@prefix ex: <http://example.com/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

ex:ConceptShape a sh:NodeShape ;
    sh:targetClass skos:Concept ;
    sh:property [
        sh:path skos:prefLabel ;
        sh:languageIn ( "en" ) ;
    ] .

Activity

added
InferencingFor SHACL 1.2 Inferencing spec.
UCRUse Cases and Requirements
on Mar 4, 2025
ajnelson-nist

ajnelson-nist commented on Mar 4, 2025

@ajnelson-nist
Contributor

@robert-david - Thank you for sending this. Would you mind using triple-backticks to syntax-highlight your Turtle? E.g., substituting characters:

'''turtle
ex:A
a rdfs:Class .
'''

afs

afs commented on Mar 4, 2025

@afs
Contributor

This is doubly important because @Prefix is a real github id; @base is a github org.

Please use PREFIX - it's safer.

tpluscode

tpluscode commented on Mar 4, 2025

@tpluscode
Contributor

I just added wrapped the turtle in code blocks

VladimirAlexiev

VladimirAlexiev commented on Apr 10, 2025

@VladimirAlexiev
Contributor

hi @robert-david in this case do you want to check the lang en or infer the lang en?

A related checking case: EuroVoc is uniformly translated in something like 25 languages.
Thus each concept should have prefLabel in all these languages.
This is unlike most other thesauri (eg Getty AAT) that have only occasional translations.

TallTed

TallTed commented on Apr 10, 2025

@TallTed
Member

Tangential: @ajnelson-nist — Re: #298 (comment), note that you can codefence with triple-tilde (~~~) when the code you want to fence itself includes triple-backtick-fenced blocks, a la —

```turtle
ex:A
a rdfs:Class .
```
ajnelson-nist

ajnelson-nist commented on Apr 10, 2025

@ajnelson-nist
Contributor

Oh neat! Thank you, @TallTed !

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

    InferencingFor SHACL 1.2 Inferencing spec.UCRUse Cases and Requirements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      SHACL Inference Rules - Use Case: consistent language tag handling for SKOS labels · Issue #298 · w3c/data-shapes