Re: RDF Shapes has published shacl (Shapes Constraint Language) draft

Hi,

Am 21.03.2015 um 13:59 schrieb Dietrich Schulten:

> 
> - in a given @context, all values of sh:member can be either individuals
> (values which are URIs) or literals (values which are plain strings,
> numbers, etc.), depending on whether or not sh:member is defined as
> "@type":"@vocab"
> 
> - the same applies to sh:defaultValue: the defaultValue can either be a
> literal or an individual within the same @context, but not both
> 

Tomasz helped me with this. When I say in the @context that sh:member is
"@type":"@vocab", all sh:member will be interpreted as linked data names
in the current vocab, *unless* I make them explicit value nodes.

That way I can have both type-casted IRIs and literals in one resource.
A set of allowed members with "aliased" IRIs:

"sh:allowedValues": {
  "@type": "sh:Set",
  "sh:member": [
    "ORDER_PROCESSING",
    "ORDER_DELIVERED"
  ]
}

becomes

"http://www.w3.org/ns/shacl#allowedValues": {
  "@type": "http://www.w3.org/ns/shacl#Set",
  "http://www.w3.org/ns/shacl#member": [
    { "@id": "http://schema.org/OrderProcessing" },
    { "@id": "http://schema.org/OrderDelivered" }
  ]
}

whereas

"sh:allowedValues": {
  "@type": "sh:Set",
  "sh:member": [
    { "@value": "1" },
    { "@value": "2" },
    { "@value": "3" },
    { "@value": "4" },
    { "@value": "5" },
  ]
}

becomes

"http://www.w3.org/ns/shacl#allowedValues": {
  "@type": "http://www.w3.org/ns/shacl#Set",
  "http://www.w3.org/ns/shacl#member": [
    "1",
    "2",
    "3",
    "4",
    "5"
  ]
}

See http://tinyurl.com/ml3mnwr for a complete example how both are used
in one json-ld file sharing one @context.

Best regards,
Dietrich

Received on Sunday, 22 March 2015 16:25:36 UTC