-
Notifications
You must be signed in to change notification settings - Fork 10
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
ODRL Evaluator pseudocode #76
Comments
We should first agree on what are the input parameters and what are the output parameters, and a separation from the state of the world. As discussed in the conversation during your presentation of ODRE - I am implementing an evaluator and consider unnecessary embedded extra decorations to represent the state of the world or input parameters. In general, and as a baseline:
(I've added extra for practical interface with developers The evaluation logic/pseudocode from the top starts should look something like:
You could consider if you want the "Result" type to be a monad or just a structure (I am letting errors be structurally handled by the HTTP layer and errors, whilst ODRL semantic errors are wrapped inside the
I'll leave the next layer (rule evaluation) for now. |
The pseudocode don't seem that far from the one presented in the ODRE article. However there are things that should be formally defined as they are know a reader does not know what they are (e.g., I think is great we have more pseudocodes, we should gather to set first the formalization and then work on the pseudocode to be standardized for the evaluation. Without an agreement of the evaluation flow and the formalization of its elements it will be difficult to agree on the pseudocodes |
I think "What is a world" and the rest of the questions in the first paragraph should be defined in https://w3c.github.io/odrl/formal-semantics/ as part of a glossary. IMHO, aligning with practical authorisation implementations, and to keep consistency with everything:
For example, AuthZen uses slightly different terminology: The Access Evaluation request is a 4-tuple constructed of the four previously defined entities:
The semantics should focus on "What is the purpose of a policy?": A policy is the description of the possible intent (or execution, depending upon the "modality"?) of an "action" ( |
I agree with this: "I think "What is a world" and the rest of the questions in the first paragraph should be defined in https://w3c.github.io/odrl/formal-semantics/ as part of a glossary." But for me is not part of the glossary but a section by itself. I'm not sure it necessary needs to go to formal semantics, since this is not trivial and will take space in the text and time that's why I suggested a new drafting document. This definitions should be cristal clear otherwise it will be very difficult to have an agreement on the evaluation. Also, these definitions must be derived from the current RDF representation of ODRL and not custom ones based on other standards and even less implementations (you can have one concept but multiple implementations, following implementations IMHO just increases heterogeneity in the formalization), this comment is linked to the next paragraph. "IMHO, aligning with practical authorisation implementations, and to keep consistency with everything:" I not fully agree, I think for sure we should keep an eye on other similar proposals but we need to keep the other in the current ODRL practical use cases. Otherwise we can stick to practical authorisation implementations and leave behind scenarios like monitoring. A clear example is what you mention of AuthZen, the context is defined as the client-based state, however ODRL may have broader scopes (like service information, or third-party APIs information) and that kind of data is encoded as part of the constraints. Following the AuthZen we loose the constraints (I did not saw them in the pseudocode you posted). Therefore how can we evaluate if the current dateTime is before or after another? On the other hand, how constraints are formalized and used in the pseudocode you posted? since, IMHO, they are a core part of ODRL. I understand that your pseudocode checks whether an actor can execute the action related to a target. However, elements like Take this as an initial idea, IMHO a policy should be formalize as the tuple (a, t, s, C) where a is the URI that identifies an actor, t is the uri that identifies a target, and s the uri that identifies an assignees and C is a set of constraints. Each constraint is also a tuple (o, l, r) where o is the URI of the operator, and l, r are either a set of triples or a term from the ontology that refers to a left or right operand respectively. In the ODRE article we have already prove that there is a direct transformation from a policy expressed in Turtle or JSON-LD 1.1 to these definitions. What do you think? could this formalization fit your use case as well? I see little differences in terms of information in the pseudocode you posted, maybe just lack of more formalization and the set C. Of course there are things unsolved:
IMHO It would be great if in this thread we can find a common consensus on how to formalize the policies |
I didn't go a level below the rules - because those seem to have different behaviours:
And I think keeping it layered would make it clear ("C" is a separate section). I also separated validation and evaluation ("is it correct" vs "does it work") - in practice, validation takes time and has no real connection with the process of evaluation (i.e. only evaluate valid policies). There are also differences in how the "world" interacts with "the state" and how "the state" is input to an evaluation. For example, I might set a value of an |
I've had it open for ages, but just started reading @simonstey document If You Can’t Enforce It, Contract It: Enforceability in I've not done that part of the work (it has other moving parts that open pandora's box, so not worth going there). But what I do is build a "tentative final" RDF based on the merge of all the ancestors of a policy (each rule with each required [maybe different] assigner and a selected assignee, which in my case becomes the "main actor" as part of the evaluation requests (it could have multiple assignees/etc, but that's part of pandora's box). |
Following this thread, I think I would like to discuss in order to later include in the ODRL standard, either in the formal semantics or in a new working draft document, these elements:
To showcase my proposal I suggest as starting point the following formalization:
There is a direct transformation from an ODRL policy written in RDF to the aforementioned formalization. I will keep developing and extending the formalization in following posts. |
I don't think the part of the directory ecosystem (which most people are now settling to call "a marketplace") works the way you propose. There is a lot of convergence with other standards for assets (DCAT / DPROD), and at least DCAT (which is in version 3) is widely used across the data industry. Almost every implementation today is "asset focused". A search will start with Assigners (who provide data services) or Assets (the different services provided) AND maybe a defining characteristic of how the services are provided. A general example would look like:
A directory of policies is (in most cases) useful only to those creating policies, but the Asset dependency (as most of these people are "data product owners", and secondary behave as "policy product owners". The above proposal you make should encompass the |
My proposal was not to implement a marketplace, which is different from the directory I was mentioning. Also, search will heavily depend on the mechanisms implemented, for which I would suggest to have a filtering language (e.g., JSON Path) and a query language that should be SPARQL. Regarding Finally, regarding |
Just 2 comments:
|
The formalization proposed is meant to define a pseudocode for evaluating/enforcing policies, the directory will be the service that has such implementation and allows, among other functionalities, to evaluate the policies. |
Following my comment on issue #67, the formal semantics, or a new document, should provide a pseudocode for the evaluation of policies. IMHO a starting point could be the pseudocode of the article presented in the last general meeting from the ODRE article.
The text was updated successfully, but these errors were encountered: