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

[Draw] Also display cardinalities for the same namespace #32

Closed JohannesLipp closed 2 years ago

JohannesLipp commented 3 years ago

Expected behavior: When declaring minCount and maxCount, they are included as cardinalities in the output PNG, despite of their namespaces.

Actual behavior: These cardinalities are only displayed for external namespaces (i.e., via [1..2] at the edges to those classes), but not for the same namespace (i.e., they are simply listed without cardinalities in the same box). Can you please fix/add this? Thank you so much!

Cardinalities are note displayed for the same namespace: SHACL input (with minCount and maxCount): image

PNG output (no cardinalities displayed): image

When using other namespaces, the cardinalities are displayed at the edges towards those classes: image

tfrancart commented 3 years ago

Could you post here a minimal SHACL file to reproduce the behavior ? I cannot reproduce the problem - see for example the included shape i nthe catalog "OpenArchaeo Shapes". Thanks, this would be helpful

tfrancart commented 3 years ago

This could be because your prefix contains an hyphen. Can you try with a prefix "gaxcor" instead of "gax-core" ?

JAs2701 commented 3 years ago

Hello @JohannesLipp , We tried with the following SHACL file and cannot reproduce the issue. Can you provide a test file that demonstrates the behavior you see ? Thank you

SHACL input

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix gax-core: <http://www.w3.org/2001/XMLSchema#> .
@prefix gax-asset: <http://www.w3.org/2001/XMLSchema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

gax-asset:MinimumAssetShape a sh:NodeShape ;
sh:targetClass gax-asset:Asset ;
sh:property [sh:path gax-core:hasName ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ] ;
sh:property [sh:path dct:description ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype rdfs:Literal ] ;
sh:property [sh:path gax-core:ownedBy ;
    sh:minCount 1;
    sh:datatype foaf:Person ] ;
.

PNG output Demo-Shacl_cardinalities

Best Regard

moosmannp commented 3 years ago

Hello, @tfrancart and @JAs2701, thanks for your quick responses. I'm a collegue of @JohannesLipp and just tried to reproduce the stated behaviour. When using the web application we get the correct output, yet when creating the .png file using the command line, the cardinalities are not shown. Maybe we are missing something in the command? This is the command line we use: java -jar shacl-play-app-0.4-onejar.jar draw -i shapeFile.ttl -o shapeFile.png

tfrancart commented 3 years ago

Hi, yes the release is not in synch with the web application, I will fix that

tfrancart commented 2 years ago

Ne release 0.5 has been published, can you try it and close the ticket if it fixes the issue ? Thanks

JohannesLipp commented 2 years ago

Thank you so much! @moosmannp could you please verify the new release? Thank you!

moosmannp commented 2 years ago

@tfrancart Thanks a lot! Works fine now! @JohannesLipp Please close the ticket, thanks.