rdfjs / shacl-ui

SHACL-driven UIs
https://rdf.js.org/shacl-ui/
11 stars 2 forks source link

Use-case : associating an icon to Shapes #27

Open tfrancart opened 9 months ago

tfrancart commented 9 months ago

See #16 for the complete story.

I need to associate an icon to node shapes, (could also be to property shapes).

Note : the ability to associate an icon code (e.g. "fad fa-user") from an icon library such as fontawesome would also be nice.

Currently I use a custom property (http://data.sparna.fr/ontologies/volipi/index-en.html#iconName) for the icon name, then default to another property to read an icon image (http://data.sparna.fr/ontologies/volipi/index-en.html#icon)

bergos commented 9 months ago

@tfrancart can you please provide an example given as Turtle? Maybe you can also give more context based on that example. I think that would be useful for further discussions.

tfrancart commented 9 months ago

Associating a FontAwesome icon code to a NodeShape :

ex:PersonShape a sh:NodeShape ;
xxxx:iconName "fad fa-user" ;
.

or using a URL :

ex:PersonShape a sh:NodeShape ;
xxxx:icon <https://upload.wikimedia.org/wikipedia/commons/8/8e/Font_Awesome_5_solid_user.svg> ;
.

At property shape level

ex:PersonShape a sh:NodeShape ;
sh:property [
  sh:path foaf:name ;
  xxxx:icon <https://upload.wikimedia.org/wikipedia/commons/d/db/Hello_my_name_is_sticker.svg> ;
]
.