question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to Document Properties and Cardinalities Defined in SHACL Shapes?

See original GitHub issue

Hi there

First of all: nice tool!

I have the following use case: I define SHACL Shapes to define a subset of schema.org types (classes) and properties (following https://datashapes.org/schema).

What I get looks like this: Thing_class

Thing_shape

In the addition to the SHACL shapes, I added a few RDF(S) definitions to the graph:

    {
 
    Shapes (ThingShape, CreativeWorkShape) ...
  
    },
    {
      "@id": "schema:Thing",
      "@type": "rdfs:Class"
    },
    {
      "@id": "schema:name",
      "@type": "rdf:Property",
      "schema:domainIncludes": {
        "@id": "schema:Thing"
      },
      "schema:rangeIncludes": {
        "@id": "xsd:string"
      }
    },
    {
      "@id": "schema:CreativeWork",
      "@type": "rdfs:Class",
      "rdfs:subClassOf": {
        "@id": "schema:Thing"
      }
    }

Then I do: ontospy gendocs graph.json, then option 2 (Html multi page)

Question: Is there a way to display the properties, their ranges and cardinalities that are defined in the SHACL shapes along with the class? So far, the properties only show up if they are defined along with schema:domainIncludes (which is somehow redundant because this is also stated in the shapes).

Ontospy already recognises the relation between the shape and its target class so I wonder if it could include more information from the shape.

Thanks a lot!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:23 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lambdamusiccommented, Dec 22, 2021

Hi Tobias, thanks for contributing. I’m happy to discuss more, in the new year.

FYI right now there is already an active PR that is intended to add various functionalities for SHACL processing. That might address some of your requirements - so feel free to take a look and comment if you like.

In general, I’d rather finish up integrating that code, before adding more SHACL support.

0reactions
tobiasschweizercommented, Jul 29, 2022

@ajnelson-nist Thanks for your message.

Yes, that sounds very systematical and allows us to do one step at a time, not getting wound up in SHACL’s complexity from the beginning.

In September, we could try working on this and split the tasks a bit once we are sure about the basic setup.

Have a good summer!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shapes Constraint Language (SHACL) - W3C
This document defines the SHACL Shapes Constraint Language, a language for validating RDF graphs against a set of conditions.
Read more >
SHACL - Validating RDF Data
Table 5.5 defines the cardinality constraint component parameters in SHACL. The default cardinality in SHACL for property shapes is {0, unbounded } ....
Read more >
An Overview of SHACL Shapes Constraint Language - YouTube
SHACL ( SHAPES Constraint Language) is a powerful, recently released W3C standard for data modeling, ontology design, data validation, ...
Read more >
Learning SHACL shapes from knowledge graphs - IOS Press
Typically, SHACL shapes are manually-specified. ... In addition, we learn cardinality constraints that can express, for example, ...
Read more >
Design reusable SHACL shapes and implement a linked data ...
Further the shape defines 2 constraints on the property ex:name for which: the cardinality must be minimum 1 (that is a way to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found