Skip to content

Metadata-schema extension mechanism #850

@dennisvang

Description

@dennisvang

In SHACL we can re-use node shapes by basing a sh:NodeShape on one or more other node shapes, with the help of sh:node.

For example:

@prefix ex: <http://example.org/ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:BaseShape1 a sh:NodeShape ;
    sh:targetClass ex:Base ;
    sh:property [
        sh:path ex:baseProperty1 ;
        sh:minCount 1 ;
    ] .


ex:BaseShape2 a sh:NodeShape ;
    sh:targetClass ex:Base ;
    sh:property [
        sh:path ex:baseProperty2 ;
        sh:minCount 1 ;
    ] .


ex:ExtendedShape a sh:NodeShape ;
    sh:targetClass ex:Extended ;
    sh:node ex:BaseShape1 ;
    sh:node ex:BaseShape2 ;
    sh:property [
        sh:path ex:extraProperty ;
        sh:minCount 1 ;
    ] .

(a similar thing can be done with sh:property and sh:PropertyShape)

However, in the FDP, the SHACL above does not work.

Instead, we need to add base shapes via the extends property in the JSON body that is posted to the FDP API. This is rendered in the client using a dropdown:

Image

Not sure why schema-extension is implemented this way (maybe just to enable the use of a dropdown in the client), but the fact that the SHACL above does not work in the FDP is inconvenient. The extension mechanism is quite obscure.

Extending shapes via sh:node should also be supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementExisting functionality that can be improved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions