Re: Labels for literals in sh:in enumeration

Hello Miika,

you can have it like
sh:in ( 1 333 true "string" "lang string"@en "2"^^xsd:unsignedInteger ex:A )
and SHACL will check if your value is in this list

if your rdf nodes in the sh:in list are valid, i.e. there is no
"a"^^xsd:int SHACL engnes (the ones based on SPARQL at least) will work
correctly

On Wed, Sep 14, 2016 at 9:01 AM, Miika Alonen <miika.alonen@csc.fi> wrote:

> Hi all,
>
> What would be the best way to include labels to sh:in for literals? Using
> literals instead of resources is reasonable in some use cases.
>
> For example you might want to use literals for HTML colors and labels for
> the drop down menu:
>
> ex:InExampleShape
>  a sh:Shape ;
>  sh:targetNode ex:RainbowPony ;
>  sh:property [
>   sh:predicate ex:htmlColor ;
>   sh:in ('#FDD7E4 <http://www.computerhope.com/cgi-bin/htmlcolor.pl?c=FDD7E4>' '#800080 <http://www.computerhope.com/cgi-bin/htmlcolor.pl?c=800080>') ;
>  ] .
>
> instead of:
>
> sh:in ( ex:Pink ex:Purple ) ...
> ... and something like ... ex:Pink rdf:value '#FDD7E4 <http://www.computerhope.com/cgi-bin/htmlcolor.pl?c=FDD7E4>' .
>
> There is of course many ways to model this but in case you need to use
> literals for simplicity the could be something like enumNames that is
> proposed to JSON Schema v5: https://github.com/json-
> schema/json-schema/wiki/enumNames-(v5-proposal)
>
> Best Regards,
> Miika Alonen
>
> CSC - IT Center for Science
> miika.alonen@csc.fi
>
>


-- 
Dimitris Kontokostas
Department of Computer Science, University of Leipzig & DBpedia Association
Projects: http://dbpedia.org, http://rdfunit.aksw.org,
http://aligned-project.eu
Homepage: http://aksw.org/DimitrisKontokostas
Research Group: AKSW/KILT http://aksw.org/Groups/KILT

Received on Wednesday, 14 September 2016 07:41:56 UTC