comake/shacl-to-json-schema

Can you confirm if the transposition is accurate?

Opened this issue · 0 comments

Hi there,

Thanks for the library.

I am trying to convert a quite complex EU language model (https://publications.europa.eu/resource/authority/snb/model/ap/edc-generic-full), but I think the final output does not map correctly the various fields.

Take for instance this object of the SHACL model:

{
      "@id": "http://data.europa.eu/snb/model/ap/edc-generic-full/AccreditationShapeCV",
      "@type": "http://www.w3.org/ns/shacl#NodeShape",
      "http://www.w3.org/ns/shacl#targetClass": {
        "@id": "http://data.europa.eu/snb/model/elm/Accreditation"
      },
      "http://www.w3.org/ns/shacl#property": [
        {
          "http://www.w3.org/ns/shacl#node": {
            "@id": "http://data.europa.eu/snb/model/ap/edc-generic-full/AccreditationTypeRestriction"
          },
          "http://www.w3.org/ns/shacl#nodeKind": {
            "@id": "http://www.w3.org/ns/shacl#IRI"
          },
          "http://www.w3.org/ns/shacl#name": {
            "@value": "type",
            "@language": "en"
          },
          "http://www.w3.org/ns/shacl#path": {
            "@id": "http://purl.org/dc/terms/type"
          },
          "http://www.w3.org/ns/shacl#minCount": 1,
          "http://www.w3.org/ns/shacl#maxCount": 1,
          "http://www.w3.org/ns/shacl#severity": {
            "@id": "http://www.w3.org/ns/shacl#Violation"
          }
        },
        {
          "http://www.w3.org/ns/shacl#node": {
            "@id": "http://data.europa.eu/snb/model/ap/edc-generic-full/ThematicAreaRestriction"
          },
          "http://www.w3.org/ns/shacl#nodeKind": {
            "@id": "http://www.w3.org/ns/shacl#IRI"
          },
          "http://www.w3.org/ns/shacl#name": {
            "@value": "accredited for thematic area",
            "@language": "en"
          },
          "http://www.w3.org/ns/shacl#path": {
            "@id": "http://data.europa.eu/snb/model/elm/limitField"
          },
          "http://www.w3.org/ns/shacl#severity": {
            "@id": "http://www.w3.org/ns/shacl#Violation"
          }
        },
        {
          "http://www.w3.org/ns/shacl#node": {
            "@id": "http://data.europa.eu/snb/model/ap/edc-generic-full/EQFLevelRestriction"
          },
          "http://www.w3.org/ns/shacl#nodeKind": {
            "@id": "http://www.w3.org/ns/shacl#IRI"
          },
          "http://www.w3.org/ns/shacl#name": {
            "@value": "accredited for EQF level",
            "@language": "en"
          },
          "http://www.w3.org/ns/shacl#path": {
            "@id": "http://data.europa.eu/snb/model/elm/limitEQFLevel"
          },
          "http://www.w3.org/ns/shacl#severity": {
            "@id": "http://www.w3.org/ns/shacl#Violation"
          }
        },
        {
          "http://www.w3.org/ns/shacl#node": {
            "@id": "http://data.europa.eu/snb/model/ap/edc-generic-full/JurisdictionRestriction"
          },
          "http://www.w3.org/ns/shacl#nodeKind": {
            "@id": "http://www.w3.org/ns/shacl#IRI"
          },
          "http://www.w3.org/ns/shacl#name": {
            "@value": "accredited in jurisdiction",
            "@language": "en"
          },
          "http://www.w3.org/ns/shacl#path": {
            "@id": "http://data.europa.eu/snb/model/elm/limitJurisdiction"
          },
          "http://www.w3.org/ns/shacl#severity": {
            "@id": "http://www.w3.org/ns/shacl#Violation"
          }
        }
      ]
    }

This is the output from this library:

"AccreditationShapeCV": {
      "type": "object",
      "properties": {
        "http://purl.org/dc/terms/type": {
          "type": "object",
          "properties": {}
        },
        "http://data.europa.eu/snb/model/elm/limitField": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {}
          }
        },
        "http://data.europa.eu/snb/model/elm/limitEQFLevel": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {}
          }
        },
        "http://data.europa.eu/snb/model/elm/limitJurisdiction": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {}
          }
        }
      },
      "required": [
        "http://purl.org/dc/terms/type"
      ]
    }

It's my first time experiencing SHACL and I have limited knowledge of JSON Schemas, but it feels like it's not necessarily an accurate transposition? Could you have a look at the 2 objects and confirm that they are indeed what they are supposed to be?

Thanks for your help