gs1 / EPCIS

Draft files being shared for EPCIS 2.0 development
Other
20 stars 7 forks source link

dual documentation #238

Closed VladimirAlexiev closed 3 years ago

VladimirAlexiev commented 3 years ago

As discussed on 29 Mar, we need to produce two closely related but not identical documentations:

What should be the input?

I could devise some simple RDF way to capture this (using namespace gs1_meta:), eg

epcis:EPCISEvent a rdfs:Class;
  gs1_meta:definiton "A logistics event ...";
  gs1_meta:uriProperty epcis:eventID;
  rdfs:comment  # concatenated from own definition and uriProp's definition
"""A logistics event ... 
Its URI (called `eventID` in JSON-LD) is (Optional)... ni:///...
""".

epcis:eventID a gs1_meta:Property;
  gs1_meta:definiton "(Optional)... ni:///...".

@mgh128 would this work for you?

mgh128 commented 3 years ago

JSON Schema is written in JSON. JSON doesn't support comments. Therefore JSON Schema can't support comments.

I am happy for us to add further comments, annotations and cross-references within the Linked Data ontology we're developing for EPCIS and CBV.

I don't expect it to serve as the entire documentation for the XML data binding. It already has its XSD with comments. It's also very clunky.

We did very briefly consider JXON (see https://www.balisage.net/Proceedings/vol7/html/Lee01/BalisageVol7-Lee01.html and elsewhere) but have not devoted much effort to this.

I agree that we should consider a non-RDF mechanism (e.g. Google Sheets) way of enabling anyone in the work group to improve on definitions, then use this as the master document and run a script to generate the RDF / JSON-LD from that. We can take the initial draft of the Linked Data ontology and run a SPARQL query to convert it into spreadsheet format that can be edited more easily by others (mainly focusing on the definitions etc.)

nathanclevenger commented 3 years ago

Have you considered using YAML as the place to store the comments? You can have both YAML and JSON versions of the JSON schema, but YAML does support comments.

On Tue, Apr 6, 2021 at 5:40 AM Mark Harrison @.***> wrote:

JSON Schema is written in JSON. JSON doesn't support comments. Therefore JSON Schema can't support comments.

I am happy for us to add further comments, annotations and cross-references within the Linked Data ontology we're developing for EPCIS and CBV.

I don't expect it to serve as the entire documentation for the XML data binding. It already has its XSD with comments. It's also very clunky.

We did very briefly consider JXON (see https://www.balisage.net/Proceedings/vol7/html/Lee01/BalisageVol7-Lee01.html and elsewhere) but have not devoted much effort to this.

I agree that we should consider a non-RDF mechanism (e.g. Google Sheets) way of enabling anyone in the work group to improve on definitions, then use this as the master document and run a script to generate the RDF / JSON-LD from that. We can take the initial draft of the Linked Data ontology and run a SPARQL query to convert it into spreadsheet format that can be edited more easily by others (mainly focusing on the definitions etc.)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gs1/EPCIS/issues/238#issuecomment-814016211, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7QQXULLJM2O5VVEUTVH43THLQJZANCNFSM42FD5O6Q .

mgh128 commented 3 years ago

@nathanclevenger Thanks for the suggestion. YAML supports comments but they're lost as soon as you convert YAML to JSON. Plenty of programming / scripting languages have built-in support for JSON (e.g. JSON.parse(), JSON.stringify() in JavaScript) but don't have built-in support for parsing / outputting YAML.

VladimirAlexiev commented 3 years ago
VladimirAlexiev commented 3 years ago

@mgh128 my latest commit removes eventID, id from ontology in turtle. It also replaces all anyURI props with ObjectProperties.

And we still haven't worked out a way to make good jsonld from it.

Once we decide the appropriate way to express the pseudo props, I'll add them back.

VladimirAlexiev commented 3 years ago

Jose prefers to use something standard, rather than our own "pseudo property" or "meta property". Which indicates a SHACL "node constraint"

VladimirAlexiev commented 3 years ago

@mgh128 Currently I'll submit a PR with 2 meta-props:

epcis:jsonldLabel a owl:DatatypeProperty , rdf:Property ;
      rdfs:comment      """JSONLD term (alias) used for this property.
The default is the property local name, which is captured in rdfs:label."""@en ;
      rdfs:domain       rdf:Property;
      schema:domainIncludes rdf:Property ;
      rdfs:isDefinedBy  epcis: ;
      rdfs:label        "jsonldLabel" ;
      rdfs:range        xsd:string ;
      schema:rangeIncludes xsd:string ;
      sw:term_status    "stable" .

epcis:jsonldUriLabel a owl:DatatypeProperty , rdf:Property ;
      rdfs:comment      """JSONLD term (alias) used for the URI of nodes of this class.
There is no default: many EPCIS classes use blank nodes instead of the standard @id JSONLD term."""@en ;
      rdfs:domain       rdf:Property;
      schema:domainIncludes rdf:Property ;
      rdfs:isDefinedBy  epcis: ;
      rdfs:label        "jsonldLabel" ;
      rdfs:range        xsd:string ;
      schema:rangeIncludes xsd:string ;
      sw:term_status    "stable" .

Used like this:

epcis:AggregationEvent   a owl:Class , rdfs:Class ;
        epcis:jsonldUriLabel "eventID".
epcis:measurementType a owl:ObjectProperty , rdf:Property ;
        epcis:jsonldLabel "type".
epcis:sourceOrDestination  a owl:ObjectProperty , rdf:Property ;
        epcis:jsonldLabel "source", "destination".

@jmcanterafonseca-iota Can you provide an example of how to do this with SHACL?

VladimirAlexiev commented 3 years ago

@CraigRe, @RalphTro I edited "EPCIS Semantics" and split off subsec 11.4.1 Meta-Properties, and updated the text to reflect the above. If you've published this document, please update it.

VladimirAlexiev commented 3 years ago

@mgh128 @mkotoff

We need to decide what to use for ttl->jsonld.

VladimirAlexiev commented 2 years ago

@mgh128 as mentioned in https://github.com/gs1/EPCIS/issues/172#issuecomment-964914441 there are 3 mistakes in jsonldUriLabel, should be as below. Can you fix them in EPCIS.ttl?

epcis:jsonldUriLabel a owl:DatatypeProperty , rdf:Property ;
      rdfs:domain       rdfs:Class;
      schema:domainIncludes rdfs:Class ;
      rdfs:label        "jsonldUriLabel" ;