Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

further improvements to SHACL diagram #116

Open
VladimirAlexiev opened this issue Dec 22, 2023 · 1 comment
Open

further improvements to SHACL diagram #116

VladimirAlexiev opened this issue Dec 22, 2023 · 1 comment

Comments

@VladimirAlexiev
Copy link

Thanks for fixing #94 !

  • We'll explore adding such diagrams to SHACL generated from our Semantic Objects (SOML).
  • You can compare to diagrams generated from SOML, eg see https://bsdd.ontotext.com/:
    • PlantUML Overview Diagram: png or svg
    • PlantUML Full Diagram: png or svg

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

  • 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?
  • this expresses "there are 2 fixed values of rdf:type":
rdf:type [2..2] = org:Site
rdf:type = locn:Address

but I find it a bit confusing visually. I think this is better:

rdf:type [2..2] = org:Site, locn:Address

But if there are many types, that could get too long... So maybe as a compromise:

rdf:type [2..2] = org:Site
rdf:type [2..2] = locn:Address
  • 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] ?
  • 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

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

@tfrancart
Copy link
Contributor

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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants