w3c-ccg / traceability-vocab

A traceability vocabulary for describing relevant Verifiable Credentials and their contents.
https://w3id.org/traceability
Other
34 stars 35 forks source link

traceability ontology #284

Closed VladimirAlexiev closed 1 year ago

VladimirAlexiev commented 2 years ago

@nissimsan provoked me in https://github.com/w3c-ccg/traceability-vocab/issues/230#issuecomment-1023049089

I have not heard any talks of a "traceability ontology" here, and doubt it will be scoped any time soon.

(Ok that was a joke).

Seriously though, such an ontology is needed because:

Mistakes in #270 are closely related to this. When you say in a schema.yml:

$linkedData:
      term: freight
      '@id': https://schema.org/ParcelDelivery

What you really mean is a transparency.ttl ontology with this:

transparency:freight a owl:ObjectProperty;
  rdfs:range schema:ParcelDelivery.

There are a lot of intricacies, eg

uncl1153:Bill_of_lading_number rdfs:subPropertyOf schema:identifier belongs on the UN/CEFACT side. I'm involved in that project too and will raise it there.

That may well be (didn't know you can move mountains :-)) But since you reuse multiple ontologies in a customized way, there are a lot more ontological statements you'd need to make.


Some resources:

OR13 commented 2 years ago

backing up for a second, the original goal of this work was to map JSON Schema types to JSON-LD vocabularies, and generate documentation and context from the JSON Schema types.

There are cases where we "needed to invent something"... and I regret pretty much every instance.

I do think we are on the hook for correcting those cases and minimizing them.

You reuse terms from a lot of ontologies, but they not always point to a class from the same ontology

I think this is the most obvious flaw with the current approach... but I see it as something which we should fix, and not embrace / perpetuate with a "new ontology"... but I could be convinced.

VladimirAlexiev commented 2 years ago

@OR13 that's not a flaw!

Seems you'll need help with the ontological approach, and I'll lend a hand. Here are some issues that force you to consider classes, props, subclasses, and other ontological constructs. Please comment on them!

We already had an example of a subproperty: uncl1153:Consignment_identifier_carrier_assigned rdfs:subPropertyOf schema:identifier

In that case @nissimsan said he'll add it in the UNECE ontology. But it's very rare to be able to modify an external ontology: It is ok to add such adjustments to your own glue ontology!

OR13 commented 2 years ago

I think I may have misread your comment.

I was trying to say, we should be careful not to go crazy with glue, and we should prefer to fix issues upstream when we can... but I agree some amount of glue is always necessary.

VladimirAlexiev commented 2 years ago

@OR13 @nissimsan Let me give you a very simple example:

    "Observation": {
      "@id": "https://schema.org/Observation",
      "@context": {
        "property": {
          "@id": "https://schema.org/measuredProperty"
        "measurement": {
          "@id": "https://w3id.org/traceability#MeasuredValue" // Why not schema:measuredValue?
        "date": {
          "@id": "https://schema.org/observationDate"
    "MeasuredValue": {
      "@id": "https://www.schema.org/QuantitativeValue",
      "@context": {
        "value": {
          "@id": "https://www.schema.org/value"
        "unitCode": {
          "@id": "https://schema.org/unitCode"

So you want to use schema:Observation, but in measuredValue you want to have both value and unitCode (why didn't they think of that?).

But the above doesn't express that! It mistakenly maps measurement (prop) to tr:MeasuredValue (class).

What you need is to map measurement to schema:measuredValue, and then add to traceability.ttl:

schema:measuredValue schema:rangeIncludes schema:QuantitativeValue.

This way YOUR ontology amends the definition of that prop to include one more possible range, the one you need.

Or, you can post to https://github.com/schemaorg/schemaorg/issues, and wait 2 years, and have your issue closed for inactivity. Happened to me many times. See https://github.com/schemaorg/schemaorg/issues/2573.

OR13 commented 2 years ago
"@id": "https://w3id.org/traceability#MeasuredValue" // Why not schema:measuredValue?

another bug : )

As I said, we area erroneously defining terms all over the place, when a better existing reference is available.

OR13 commented 2 years ago

@nissimsan @BenjaminMoe please propose concrete changes.

nissimsan commented 2 years ago

I think we might have more of an ontology than I was aware of... This should be described better.

BenjaminMoe commented 2 years ago

Added Pending Close by mistake.

VladimirAlexiev commented 2 years ago

I have not heard any talks of a "traceability ontology" here, and doubt it will be scoped any time soon.

I think we might have more of an ontology than I was aware of...

Ok, that's a positive evolution :-)

BenjaminMoe commented 2 years ago

@nissimsan any updates?

BenjaminMoe commented 2 years ago

Suggestion: have a section in the respec document for terms we accidentally need to define.

nissimsan commented 1 year ago

Building a complete ontology would be great. Unfortunately there does not seem to be bandwidth to implement this. Closing for now. Would be great to reopen if there is interest in implementation.