uncefact / spec-jsonld

Exposing the UN/CEFACT vocabulary as web semantics
https://service.unece.org/trade/uncefact/vocabulary/uncefact/
13 stars 5 forks source link

Parasitic Word "Formatted" #52

Closed VladimirAlexiev closed 2 years ago

VladimirAlexiev commented 2 years ago

Many dateTime props have names called "formatted".

This query finds them, together with a better-named prop when it exists:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX uncefact: <https://service.unece.org/trade/uncefact/trade/uncefact/vocabulary/uncefact#>
select ?x ?y {
  ?x a rdf:Property
  bind(strafter(str(?x),str(uncefact:)) as ?xName)
  filter(regex(?xName,"formatted","i"))
  optional {
    ?y a rdf:Property
    bind(strafter(str(?y),str(uncefact:)) as ?yName)
    filter(?xName != ?yName && regex(?xName,?yName,"i"))
  }
}

I think all x should be simplified by removing the parasitic words "formatted", and merged with y when indicated:

x y note
formattedExpiryDateTime expiryDate maybe merge all 3 but see below
formattedExpiryDateTime expiryDateTime
formattedFormattedCancellationAnnouncedLaunchDateTime
formattedFormattedIssueDateTime issueDateTime
formattedFormattedLatestProductDataChangeDateTime
formattedFormattedPickUpAvailabilityDateTime formattedPickUpAvailabilityDateTime merge & rename to pickUpAvailabilityDateTime
formattedPickUpAvailabilityDateTime
formattedFormattedReceivedDateTime receivedDateTime
formattedFormattedUltimateShipToDeliveryDateTime ultimateShipToDeliveryDateTime
formattedJurisdictionEntryDateTime
formattedLastRegisteredYearDateTime lastRegisteredYearDateTime
formattedObtainedDateTime
formattedScheduledArrivalRelatedDateTime arrivalRelatedDateTime
formattedScheduledArrivalRelatedDateTime scheduledArrivalRelatedDateTime
formattedScheduledDepartureRelatedDateTime departureRelatedDateTime
formattedScheduledDepartureRelatedDateTime scheduledDepartureRelatedDateTime

This puppy is really messed up:

VladimirAlexiev commented 2 years ago

Actually all these below have range UNCL2379Code, so maybe should be re named to ...DateTimeFormat:

uncefact:formattedExpiryDateTime uncefact:formattedFormattedCancellationAnnouncedLaunchDateTime uncefact:formattedFormattedIssueDateTime uncefact:formattedFormattedLatestProductDataChangeDateTime uncefact:formattedFormattedPickUpAvailabilityDateTime uncefact:formattedFormattedReceivedDateTime uncefact:formattedFormattedUltimateShipToDeliveryDateTime uncefact:formattedJurisdictionEntryDateTime uncefact:formattedLastRegisteredYearDateTime uncefact:formattedObtainedDateTime uncefact:formattedScheduledArrivalRelatedDateTime uncefact:formattedScheduledDepartureRelatedDateTime

But then they must come in pairs:

nissimsan commented 2 years ago

@VladimirAlexiev , we have attempted to strip such terms in the NDR. Thanks for pointing this out - we will address it.

kshychko commented 2 years ago

The following NDR rules were implemented to produce the suggested changes in this ticket:

  1. Data Type Qualifier is being ignored when TDED is 2379
  2. Formatted word in Property Term Qualifier is being ignored when Representation Term is set to Date Time
nissimsan commented 2 years ago

Code for this is implemented. Let's keep the ticket open until deployment, so we can test.