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

Policy representation: odr:datatype and odrl:unit in a constraint are not stored, odrl:rightOperand cannot hanlde typed literals #4483

Closed
gkirtzou opened this issue Sep 19, 2024 · 1 comment
Labels
enhancement New feature or request triage all new issues awaiting classification

Comments

@gkirtzou
Copy link

Bug Report

Describe the Bug

Following the ODRL model,

"A Constraint MAY have none or one dataType property value for the data type of the rightOperand/Reference. A Constraint MAY have none or one unit property value (of type IRI [rfc3987]) to set the unit used for the value of the rightOperand/Reference." (source https://www.w3.org/TR/odrl-model/#constraint-class) .

Moreover, odrl:rightOperand again from the ODRL model page

"one rightOperand property value of type: literal, or IRI [rfc3987], or RightOperand; or for set-based operators; list of literals, or list of IRIs [rfc3987], or list of RightOperands; "

Expected Behavior_

  • Problem 1: Given a policy with odrl:datatype and/or odrl:unit properties on the constraint, EDC should parse them and store them in the SQL database.
  • Problem 2: EDC should handle odrl:rightOperand with typed literals values.

Observed Behavior

  • Problem 1: EDC ignores odrl:datatype and/or odrl:unit properties when creating the policy, and does not store them in the db
  • Problem 2: EDC ignores typed literal as odrl:rightOperand, and keeps only the @value , and stores it as a simple string.

Steps to Reproduce

During policy creation, the following input is provided to EDC that contains both odrl:datatype and odrl:unit properties
and a typed literal for the odrl:rightOperand property for the constraint:

{
  "@context": {
    "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
    "edc": "https://w3id.org/edc/v0.0.1/ns/",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "dcat": "http://www.w3.org/ns/dcat#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "foaf": "http://xmlns.com/foaf/0.1/",
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "adms": "http://www.w3.org/ns/adms#",
    "dcmitype": "http://purl.org/dc/dcmitype/",
    "skos": "http://www.w3.org/2004/02/skos/core#",
    "dct": "http://purl.org/dc/terms/",
    "odrl": "http://www.w3.org/ns/odrl/2/",
    "owl": "http://www.w3.org/2002/07/owl#",
    "cc": "http://creativecommons.org/ns#",
    "dalicc": "https://dalicc.net/ns#",
    "dalicclib": "https://dalicc.net/licenselibrary/",
    "osl": "http://opensource.org/licenses/",
    "prov": "http://www.w3.org/ns/prov#",
    "spdx": "http://spdx.org/rdf/terms#",
    "example": "http://www.example.com/"
  },
  "policy": {
    "@type": "odrl:Set",
    "dct:description": {
      "@language": "en",
      "@value":"Payment Once - odrl:compensate"
    },
    "dct:title": {
      "@language": "en",
      "@value": "Payment Once - odrl:compensate"
    },
    "odrl:permission": [
      {
        "@type": "odrl:Permission",
        "odrl:action": {
          "@id": "odrl:use"
        }
      }
    ],
    "odrl:obligation": [
      {
        "@type": "odrl:Duty",
        "odrl:action":
        {
          "@id": "odrl:compensate"
        },
        "odrl:constraint": [
            {
              "odrl:leftOperand": {
                "@id": "odrl:payAmount"
              },
              "odrl:operator": {
                "@id": "odrl:eq"
              },
              "odrl:rightOperand": {
                "@type": "http://www.w3.org/2001/XMLSchema#decimal",
                "@value": "100.0"
              },
              "odrl:unit": "http://dbpedia.org/resource/Euro",
              "ordl:datatype": "http://www.w3.org/2001/XMLSchema#decimal"
            }
        ]
      }
    ],
    "odrl:prohibition": null
  }
}

The policy was created successfully, but the returned policy from EDC is missing these two properties and only the value of the rightOperand is returned.

{
    "@id": "a2958688-b390-4298-a348-104dda38967a",
    "@type": "PolicyDefinition",
    "createdAt": 1726754527817,
    "policy": {
        "@id": "aeabfcea-98f8-4684-9750-3b9b875f1925",
        "@type": "odrl:Set",
        "odrl:permission": {
            "odrl:action": {
                "@id": "odrl:use"
            }
        },
        "odrl:prohibition": [],
        "odrl:obligation": {
            "odrl:action": {
                "@id": "odrl:compensate"
            },
            "odrl:constraint": {
                "odrl:leftOperand": {
                    "@id": "odrl:payAmount"
                },
                "odrl:operator": {
                    "@id": "odrl:eq"
                },
                "odrl:rightOperand": "100.0"
            }
        }
    },
    "@context": {
        "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
        "edc": "https://w3id.org/edc/v0.0.1/ns/",
        "foaf": "http://xmlns.com/foaf/0.1/",
        "xsd": "http://www.w3.org/2001/XMLSchema#",
        "dcat": "http://www.w3.org/ns/dcat#",
        "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
        "owl": "http://www.w3.org/2002/07/owl#",
        "euvoc_auth": "http://publications.europa.eu/resource/authority/",
        "ms": "http://w3id.org/meta-share/meta-share/",
        "odrl": "http://www.w3.org/ns/odrl/2/",
        "omtd": "http://w3id.org/meta-share/omtd-share/",
        "lds": "https://lds.eu/",
        "schema": "https://schema.org/",
        "dct": "http://purl.org/dc/terms/",
        "iana": "http://www.iana.org/assignments/media-types/application/",
        "skos": "http://www.w3.org/2004/02/skos/core#",
        "dcmitype": "http://purl.org/dc/dcmitype/",
        "loc": "http://id.loc.gov/vocabulary/iso639-1/",
        "adms": "http://www.w3.org/ns/adms#",
        "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    }
}

Context Information

Used version EDC v0.8.0

@github-actions github-actions bot added the triage all new issues awaiting classification label Sep 19, 2024
@jimmarino
Copy link
Contributor

Closing based on my comments for #4482.

@jimmarino jimmarino added the enhancement New feature or request label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage all new issues awaiting classification
Projects
None yet
Development

No branches or pull requests

2 participants