edi3 / edi3-json-ld-ndr

GNU General Public License v3.0
0 stars 2 forks source link

RDF Vocabulary for BSP #4

Open kshychko opened 4 years ago

kshychko commented 4 years ago

As PoC we are going to generate an experiment version of the RDF Vocabulary for BSP RDM. It will be published in three formats - ttl, jsonld and html. As an output of this process, we should come to the NDR rules for RDM2API.

kshychko commented 3 years ago

@Fak3, please check out the JSON-LD format of the BPS vocabulary http://edi3.org/vocab/bsp.jsonld

NDR rules in short terms:

ABIEs are RDF Classes

  1. The object class term is used as an initial id for RDF Class
  2. If it is not unique - the object class term qualifier is used to make it unique
  3. If there is one usual and one referenced classes - the object class term qualifier is dropped and not used. Check out Consignment and ReferencedConsignment to see it in action

BBIEs and ASBIEs are RDF Properties

  1. The business name is used as an initial id for RDF Property. It is human friendly and more suitable for the purpose of a dictionary.
  2. If it is not unique - the domain value (the resolved RDF class id) is added in front of the id. Check out ConsignmentGrossVolume and ReferencedConsignmentGrossVolume RDF properties.
  3. For BBIEs range is one of xsd data types. For ASBIEs range is the resolved RDDF class id for associated object class term with its qualifier.
onthebreeze commented 3 years ago

looks like an excellent start.

But I would really LOVE to find a way to get rid of property level duplication. So rather than having 👍

@id: "edi3:ReferencedConsignmentConsignmentItemQuantity",
@type: "rdfs:Property",
rdfs:range: "xsd:decimal",
rdfs:comment: "The number of consignment items separately defined for transport or customs purposes within this referenced supply chain consignment.",
rdfs:domain: "edi3:ReferencedConsignment",
rdfs:label: "Referenced_ Supply Chain_ Consignment. Consignment Item. Quantity",
edi3:cefactID: "UN01011051"

and

{
@id: "edi3:ConsignmentConsignmentItemQuantity",
@type: "rdfs:Property",
rdfs:range: "xsd:decimal",
rdfs:comment: "The number of consignment items separately defined for transport or customs purposes within this supply chain consignment.",
rdfs:domain: "edi3:Consignment",
rdfs:label: "Supply Chain_ Consignment. Consignment Item. Quantity",
edi3:cefactID: "UN01004196"
},

we just have

{
@id: "edi3:ConsignmentConsignmentItemQuantity",
@type: "rdfs:Property",
rdfs:range: "xsd:decimal",
rdfs:comment: "The number of consignment items separately defined for transport or customs purposes within this supply chain consignment.",
rdfs:domain: "edi3:Consignment",
rdfs:domain: "edi3:ReferencedConsignment",
rdfs:label: "Supply Chain_ Consignment. Consignment Item. Quantity",
edi3:cefactID: "UN01004196"
},

thoughts?

kshychko commented 3 years ago

Updated NDR rules:

ABIEs are grouped by Object Class Term as RDF Classes

  1. @id - edi3: + Object Class Term value with cleaned up white spaces
  2. @type is set to rdfs:Class
  3. rdfs:comment is one or more Definition values
  4. edi3:cefactElementMetadata represents RDM context. It's an array of grouped ABIEs
    • @id - cefact: + Dictionary Entry Namevalue with cleaned up white spaces
    • @type - edi3:AggregateBIE
    • edi3:cefactUNId - cefact: + Unique UN Assigned ID
    • rdfs:comment - Definition
    • edi3:cefactBusinessProcess - Business Process Value

BBIEs are grouped by Property Term Qualifier(s)+ Property Term + Datatype Qualifier(s) + Representation Term as RDF Properties

  1. @id - edi3: + Property Term Qualifier(s)+ Property Term + Datatype Qualifier(s) + Representation Term values with cleaned up white spaces
  2. @type is set to rdfs:Property
  3. rdfs:range - mapped xsd type
  4. rdfs:domain edi3: + Object Class Term value with cleaned up white spaces
  5. rdfs:comment is one or more Definition values
  6. edi3:cefactElementMetadata represents RDM context. It's an array of grouped BBIEs
    • @id - cefact: + Dictionary Entry Namevalue with cleaned up white spaces
    • @type - edi3:BasicBIE
    • edi3:cefactUNId - cefact: + Unique UN Assigned ID
    • edi3:cefactBieDomainClass - cefact: + Dictionary Entry Namevalue of the related ABIE
    • rdfs:comment - Definition
    • edi3:cefactBusinessProcess - Business Process Value

ASBIEs are grouped by Property Term Qualifier(s)+ Property Term + Associated Object Class Term Qualifier(s) + Associated Object Class as RDF Properties

  1. @id - edi3: + Property Term Qualifier(s)+ Property Term + Associated Object Class Term Qualifier(s) + Associated Object Class values with cleaned up white spaces
  2. @type is set to rdfs:Property
  3. rdfs:range - mapped xsd type
  4. rdfs:domain - one or more edi3: + Object Class Term value with cleaned up white spaces
  5. rdfs:comment is one or more Definition values
  6. edi3:cefactElementMetadata represents RDM context. It's an array of grouped ASBIEs
    • @id - cefact: + Dictionary Entry Namevalue with cleaned up white spaces
    • @type - edi3:AssociationBIE
    • edi3:cefactUNId - cefact: + Unique UN Assigned ID
    • edi3:cefactBieDomainClass - cefact: + Dictionary Entry Namevalue of the related ABIE
    • rdfs:comment - Definition
    • edi3:cefactBusinessProcess - Business Process Value
Fak3 commented 3 years ago

Should we lowercase the rdfs property names? ie rename ExportExitDateTime to exportExitDateTime It seems to be the most ubiquitous notation, and helps humans to interpret the data easier

onthebreeze commented 3 years ago

Yep