Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new relation QualifiedGeneration #10

Open
jdcourcol opened this issue Oct 9, 2017 · 5 comments
Open

new relation QualifiedGeneration #10

jdcourcol opened this issue Oct 9, 2017 · 5 comments

Comments

@jdcourcol
Copy link

There is a QualifiedAssociation, a QualifiedUsage but no QualifiedGeneration.
For instance a software execution returns multiple artefacts of the same kind. I want to be able to distinguish them. (That is a simular concept to the name of an output parameter in a function).

@MFSY
Copy link
Contributor

MFSY commented Oct 19, 2017

There is indeed a prov:qualifiedGeneration property in the W3C PROV-O recommendation. It is used to provide a context about how an entity was generated (generation time, ....). It's range (the type of its value) is prov:Generation for which we already have a schema written.

Now there is a difference between prov:qualifiedUsage and prov:qualifiedGeneration:

  • prov:qualifiedUsage has a prov:Activity as domain and prov:Usage as range
  • prov: qualifiedGeneration has a prov:Entity as domain and prov:Generation as range

So prov: qualifiedGeneration is entity centric whereas prov:qualifiedUsage is activity centric.

We have two options here:

  • Add in the prov:Entity schema a property prov:qualifiedGeneration with prov:Generation as value type. Which means that to know which entity is generated from an activity and how it was generated one has to : 1) read the prov:generated activity property but also look up all generation objects that has the current activity id as prov:activity value; 2) or consistently add a generated entity in the current activity prov:generated list whenever a generation object is created.

  • Become activity centric. Link to an activity all information about what entities was used and how, what entities was generated and how. This can be achieved by introducing a reverseActivityGeneration property which has an prov:Activity as domain and a prov:Generation as range and a reverseQualifiedGeneration which has a proven:Generation as domain and an entity as rang.

"reverseActivityGeneration" : {
      "@reverse" : "http://www.w3.org/ns/prov#activity",
      "@type" : "@id",
      "@container" : "@set"
    },
"reverseQualifiedGeneration" : {
      "@reverse" : "http://www.w3.org/ns/prov#qualifiedGeneration",
      "@type" : "@id"
    }

An activity payload looks like:

{
  "@type": "prov:Activity",
  "@id": "activity_URI",
 "used":[],
 "qualifiedUsage":[],
 "generated":[],
 "reverseActivityGeneration":[
    {
      "@type":"prov:Generation"
      "reverseQualifiedGeneration": "entity_URI",
      "hadRole": "role_URI",
      "atTime":"2016-09-10T06:51:00+02:00"
    }
  ]
}

Thoughts ?

@jdcourcol
Copy link
Author

I saw that in:

So this is what I want to express:
'''
:output
a prov:Entity;
prov:wasGeneratedBy :a;
.
:metadata
a prov:Entity;
prov:wasGeneratedBy :a;
.
:a
a prov:Activity;

prov:generated :output;
prov:qualifiedGeneration [
   a prov:Generation;
   prov:qualifiedEntity         :output;
   prov:hadRole            workflow:output;
];

prov:generated :metadata;
prov:qualifiedGeneration [
   a prov:Generation;
   prov:qualifiedEntity         :metadata;
   prov:hadRole            workflow:metadata-of-output-with-log;
];

'''

I sounds that with that approach, If I have an activity, it gives me the list of "prov:qualifiedGeneration" as a list of properties.

@MFSY
Copy link
Contributor

MFSY commented Oct 19, 2017

Can I know the source of the prov:qualifiedEntity property ? I'm not seeing it in the W3C PROV-O specification.

@jdcourcol
Copy link
Author

I think they don't have qualifiedEntity anymore

@MFSY
Copy link
Contributor

MFSY commented Oct 20, 2017

I think they don't have it. We use the W3C PROV-O recommendation as reference. Now I see in the example you provided that you adopted both entity and activity centric views :

Entity centric view:

:output
a prov:Entity;
prov:wasGeneratedBy :a.

Activity centric view:

:a a prov:Activity;
prov:generated :output.

I would recommend to choose one view to ease the querying. Otherwise you'll have to check both prov:wasGeneratedBy and prov:generated to know what entities was generated by a given activity.

I propose the two following options:

  1. Activity centric view: from the activity towards the generated entities (how many entities are being generated ?) with the generation context.
{
  "@type": "prov:Activity",
  "@id": "activity_URI",
 "prov used":[],
 "prov qualifiedUsage":[],
 "prov generated":[],
 "qualifiedEntityGeneration":[
    {
      "@type":"prov:Generation"
      "generatedEntity": "entity_URI",
      "prov hadRole": "role_URI",
      "prov atTime":"2016-09-10T06:51:00+02:00"
    }
  ]
}

qualifiedEntityGeneration and generatedEntity respectively define as (in the @context):

"qualifiedEntityGeneration" : {
      "@reverse" : "http://www.w3.org/ns/prov#activity",
      "@type" : "@id",
      "@container" : "@set"
    },
"generatedEntity" : {
      "@reverse" : "http://www.w3.org/ns/prov#qualifiedGeneration",
      "@type" : "@id"
    }
  1. Entity centric view: from an entity towards the generating activity with the generation context
{
  "@type": "prov:Entity",
  "@id": "entity_URI",
 "prov:wasGeneratedBy":"activity_URI",
 "prov:wasDerivedFrom":[],
 "prov:qualifiedGeneration":[
    {
      "@type":"prov:Generation"
      "prov:activity": "activity_URI",
      "prov:hadRole": "role_URI",
      "prov:atTime":"2016-09-10T06:51:00+02:00"
    }
  ]
}

In this second option the entity that was used an how they used are recorded in the activity activity_URI or in other usage objects.

Thoughts ?

@MFSY MFSY added the prov label Oct 23, 2017
@MFSY MFSY added the next label Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants