sparna-git / shacl-play

SHACL validation UI, SHACL documentation generator, SHACL generator from RDF.
http://shacl-play.sparna.fr
GNU Lesser General Public License v3.0
24 stars 15 forks source link

further improvements to SHACL diagram #116

Open VladimirAlexiev opened 6 months ago

VladimirAlexiev commented 6 months ago

Thanks for fixing https://github.com/sparna-git/shacl-play/issues/94 !

Here are some more ideas for improvement (based on the euBusinessGraph diagram):

@tfrancart thanks for your excellent work and have a great holiday season!!

tfrancart commented 6 months ago

Hello @VladimirAlexiev and thank you for your very encouraging and positive comment

At the documentation page you have "Diagrams" in plural: do you use sh:group or some other mechanism to decide how many diagrams to make, and which shapes to include?

See https://shacl-play.sparna.fr/play/draw#custom-nodeShapes. We use a foaf:depiction property on NodeShapes to give the URI of a diagram, with its title + description, in which we want the NodeShape to be included. See this complete example illustrating an output, generated from this SHACL file (diagrams resources are at the end of the file). Also illustrates how to play with colors.

this expresses "there are 2 fixed values of rdf:type": (...)

I find your SHACL a bit strange. You have 2 property shapes for rdf:type :

ebgsh:Address  a        sh:NodeShape ;
        sh:property     [ sh:hasValue  org:Site ;
                          sh:maxCount  2 ;
                          sh:minCount  2 ;
                          sh:path      rdf:type
                        ] ;
        sh:property     [ sh:hasValue  locn:Address ;
                          sh:path      rdf:type
                        ] ;

I would have expected the following, with a single property shape using sh:in

ebgsh:Address  a        sh:NodeShape ;
        sh:property     [ 
                          sh:in  (org:Site, locn:Address) ;
                          sh:maxCount  2 ;
                          sh:minCount  2 ;
                          sh:path      rdf:type
                        ] ;

there are many fields without a type annotation, eg locn:fullAddress [0..1]. But on the doc page it shows that you recognize the two types: locn:fullAddress : xsd:string or rdf:langString. So could you depict this as locn:fullAddress : xsd:string, rdf:langString [0..1] ?

Indeed the HTML table documentation generation is currently smarter than the diagrams with respect to sh:or. I will see how to improve this;

Could you add IRI as "type annotation"? Eg I wondered what these two are, until I remembered (one points to Concept of a particular ConceptScheme but I don't remember why I didn't try to reflect this; the other is a "free" IRI like mailto:someone@example.com). So they should become rov:orgType : IRI [0..1] schema:email : IRI

Yes, I think we wanted to keep the boxes in the diagram compact and readable. We'll see if/how this can be improved.

Thank you for your constructive comments, and stay tuned for more fun with SHACL :-)