Re: role syntax and role instance - help needed

On 05/03/2013 04:38 PM, Marian, Radu wrote:
> I am new to JSON-LD but trying (hard) to make sense out of it.  I
> have the following ontology model:
> 
> https://www.oasis-open.org/committees/download.php/49053/entitlement.ontology.png

Ok.

> Below is how I represent the syntax of Role – pretty much following
> Role to Task to Resource and Action relationships.  I may be doing 
> something wrong…. Do I need to use @type instead?  My other question
> is that I would like to create a Role instance json-ld but struggling
> how would I express it…. Roles do not have a meaning instead they
> inherit the meaning from Task (i.e. use Tasks description to provide
> a Role description).

I think you may be conflating data model validation with data model
expression. Data model validation is often performed at the application
layer. Data model expression can be performed by JSON-LD.

You seem to be trying to write the context as if it was the thing that
is used to validate the Entitlement Ontology that you link to. That is
not the purpose of a JSON-LD Context. Here's an explanation of what the
JSON-LD Context does:

http://www.w3.org/TR/json-ld/#the-context

I think what you want is something like this for the Context:

{
  "BusinessRole": "http://access.example.org#BusinessRole",
  "name": "http://access.example.org#name",
  "jobFunction": "http://access.example.org#jobFunction"
}

and then this as your data:

{
  "@context": {
    "BusinessRole": "http://access.example.org#BusinessRole",
    "name": "http://access.example.org#name",
    "jobFunction": "http://access.example.org#jobFunction"
  }
  "@id": "http://example.org/ids/3003",
  "@type": "BusinessRole",
  "name": "Physical Site Security",
  "jobFunction": "Ensuring security of physical site..."
}

Whether or not the data above validates against your data model is
something that must be written at the application layer. You could use
JSON Schema to accomplish something along these lines.

I don't think we'll be able to help you more until you provide the type
of data that you're trying to express.

-- manu

-- 
Manu Sporny (skype: msporny, twitter: manusporny, G+: +Manu Sporny)
Founder/CEO - Digital Bazaar, Inc.
blog: Meritora - Web payments commercial launch
http://blog.meritora.com/launch/

Received on Monday, 6 May 2013 20:19:25 UTC