jargon-sh / issues

The jargon.sh issue tracker
1 stars 0 forks source link

[JSON-LD Context]: owl:ObjectProperty `@type` is set to `@vocab` when `"schema:rangeIncludes"."@id"` is a code list #17

Open kshychko opened 1 month ago

kshychko commented 1 month ago
{
    "@context": {
        "dpp": "https://test.uncefact.org/vocabulary/untp/dpp/",
        "xsd": "http://www.w3.org/2001/XMLSchema#",
        "id": "@id",
        "type": "@type",
        "@version": 1.1,
        "ProductPassport": {
            "@id": "dpp:ProductPassport",
            "@type": "@id",
            "@context": {
                "product": {
                    "@id": "dpp:product",
                    "@type": "@id",
                    "@context": {
                        "traceabilityInformation": {
                            "@id": "dpp:traceabilityInformation",
                            "@type": "@id",
                            "@context": {
                                "eventType": {
                                    "@id": "dpp:eventType",
                                    "@type": "@vocab",
                                    "@context": {
                                        "@vocab": "https://test.uncefact.org/vocabulary/untp/dpp/eventTypeCode#"
                                    }
                                }
                            },
                            "@container": "@list"
                        }
                    }
                }
            }
        }
    }
}

and

{
            "@id": "DigitalProductPassport:eventType",
            "@type": [
                "rdf:Property",
                "owl:ObjectProperty"
            ],
            "rdfs:label": "eventType",
            "schema:rangeIncludes": {
                "@id": "DigitalProductPassport:eventTypeCode"
            },
            "schema:domainIncludes": {
                "@id": "DigitalProductPassport:TraceabilityEvent"
            },
            "rdfs:comment": "A code representing the type of EPCIS event. ObjectEvent, AggregationEvent, TransactionEvent, TransformationEvent, ObjectEvent."
        }
kshychko commented 1 month ago

Fixed for code lists that are defined within a domain, but isn't working for external codelists because of JSON-LD vocabulary issue #9

kshychko commented 1 month ago

Using an example from #9 originCountry in the context should look like:

{
    "originCountry": {
        "@id": "dpp:originCountry",
        "@type": "@vocab",
        "@context": {
            "@vocab": "https://vocabulary.uncefact.org/CountryId"
        }
    }
}
{
    "originCountry": {
        "@id": "dpp:originCountry",
        "@type": "@vocab",
        "@context": {
            "@vocab": "https://test.uncefact.org/vocabulary/untp/dpp/countryCode#"
        }
    }
}