Giter Club home page Giter Club logo

Comments (14)

cmsdroff avatar cmsdroff commented on July 28, 2024 1

Thanks to @nissimsan here's a working version which I'll put something in place for

{
    "@context": [
        "https://vocabulary.uncefact.org/unlocode-vocab-context.jsonld",
        "https://schema.org"
    ],
    "@type": ["Place"],
    "name": "HHLA CONTAINER TERMINAL ALTENWERDER (CTA)",
    "countryCode": "DE",
    "UNLOCODE": "DEHAM",
   	"countryCode":"DE",
 	"address": {
	  "@type": "PostalAddress",
      "streetAddress": "Am Ballinkai 1",
      "addressCountry": "Germany",
      "addressRegion": "Hamburg",
      "postalCode": "2119"
	},
    "geo": {
      "@type": "GeoCoordinates",
      "latitude": 53.509241285961544, 
      "longitude": 9.927578892050956
    },
    "url": "https://www.bic-code.org/facility-codes/GBLIVJMDA"     
}

from spec-jsonld.

nissimsan avatar nissimsan commented on July 28, 2024

@onthebreeze the UN traceability project could also be added

from spec-jsonld.

nissimsan avatar nissimsan commented on July 28, 2024

@cmsdroff , please action.

from spec-jsonld.

cmsdroff avatar cmsdroff commented on July 28, 2024

Welcome some comments or a steer on the below, I've looked at schema.org, IATA and the UNCEFACT vocab and made a start at defining a shipping container which could be used by BIC for their container database, but also for industry to define a shipping container in the context of BIC.

We would need to link this to the CEFACT vocab for TransportEquipment see https://tinyurl.com/y8hu7emc and below as a start.

{
   "@context":{
      "@vocab":"http://vocab.bic-code.org#",
      "schema":"http://schema.org/",
      "uncefact":"https://service.unece.org/trade/uncefact/trade/uncefact/vocabulary/uncefact#"
   },
   "@graph":[
      {
         "@id":"bic:Container",
         "@type":"rdfs:Class",
         "rdfs:comment":"A Container is a reusable transport and storage unit for moving products and raw materials between locations or countries",
         "rdfs:label":"Container"
      }
   ],
   "Container":{
      "ContainerNumber":{
         "description":"Unique identifier for the container to the BIC Code holder",
         "type":"text"
      },
      "BicCode":{
         "description":"Registered code used to identify the owner of the container",
         "type":"text"
      },
      "CubicCapacity":{
         "description":"The maximum capacity of a container in Cubic Meters",
         "type":"float"
      },
      "ISOType":{
         "description":"The type of container as defined by ISO under ISO XXXX",
         "type":"string"
      },
      "MaxGrossMass":{
         "description":"The maximum gross mass of a container in Kilograms when laden",
         "type":"float"
      },
      "MaxPayload":{
         "description":"The maximum payload a container can hold in Kilograms",
         "type":"float"
      },
      "TareWeight":{
         "description":"The weight of the container when empty",
         "type":"float"
      }
   }
}

To be used like below ?

{
    "@context": "http://vocab.bic-code.org#",
    "@type": "Container",
    "BicCode": "NNCU",
    "ContainerNumber": "NNCU1000180",
    "CubicCapacity": 33.0,
    "ISOType": "20G1",
    "MaxGrossMass": 30480,  
    "MaxPayload": 28130,
    "TareWeight": 2280
}

from spec-jsonld.

cmsdroff avatar cmsdroff commented on July 28, 2024

@cmsdroff , please action.

@nissimsan made a start!

from spec-jsonld.

nissimsan avatar nissimsan commented on July 28, 2024

Awesome, @cmsdroff !

The one thing I would ask before PR'ing this example would be to also include an actual un/cefact definition. You define the context, but don't use it.
To be clear: it's perfectly cool to have bic definitions also. It serves a good purpose to have both contexts in the example. but without using cefact, it's not really a cefact example. :)

Here is the parsed graph:

<bic:Container> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <rdfs:Class> _:b0 .
<bic:Container> <rdfs:comment> "A Container is a reusable transport and storage unit for moving products and raw materials between locations or countries" _:b0 .
<bic:Container> <rdfs:label> "Container" _:b0 .
_:b0 <http://vocab.bic-code.org#container> _:b1 .
_:b1 <http://vocab.bic-code.org#BicCode> _:b2 .
_:b1 <http://vocab.bic-code.org#ContainerNumber> _:b3 .
_:b1 <http://vocab.bic-code.org#TareWeight> _:b4 .
_:b2 <http://vocab.bic-code.org#description> "Registered code used to identify the owner of the container" .
_:b2 <http://vocab.bic-code.org#type> "text" .
_:b3 <http://vocab.bic-code.org#description> "Unique identifier for the container to the BIC Code holder" .
_:b3 <http://vocab.bic-code.org#type> "text" .
_:b4 <http://vocab.bic-code.org#description> "The weight of the container when empty" .

from spec-jsonld.

cmsdroff avatar cmsdroff commented on July 28, 2024

I plan to relate it to the TransportEquipment https://service.unece.org/trade/uncefact/vocabulary/uncefact/#TransportEquipment

the UN is of course multimodal and this is a specification of the transport equipment in relation to a 'Container'.

So maybe some equivalent or reference to, as opposed to a a transport document that references the json-ld.

from spec-jsonld.

VladimirAlexiev avatar VladimirAlexiev commented on July 28, 2024

@cmsdroff reaching out into BIC is an awesome idea, however the JSONLD is wrong. Always convert to turtle (or trig) to check your work.

Some brief observations (there may be more)

  • superfluous graph (b0 in @nissimsan 's conversion)
  • prop names should use lowerCamelCase
  • lumping props under the class is no good. You need to define rdfs:domain or schema:domain includes
  • type, description, text are not keywords you can use to define ontological props

I think you'd be better off defining the ontology in turtle then converting to JSONLD.

Eg see https://github.com/gs1/EPCIS/tree/master/Ontology: EPCIS.ttl is an example, and https://github.com/gs1/EPCIS/tree/master/Ontology#conversion-to-jsonld describes how it's converted to EPCIS.jsonld.

https://github.com/gs1/EPCIS/blob/master/Ontology/EPCIS-CBV-context.jsonld is used in the conversion to make the JSONLD as nice as possible

from spec-jsonld.

cmsdroff avatar cmsdroff commented on July 28, 2024

Great feedback @VladimirAlexiev is done the above by hand as I was learning but now looking at these suggestions and hope to have something revised inline for next meeting šŸ‘

from spec-jsonld.

cmsdroff avatar cmsdroff commented on July 28, 2024

Now I have looked into the suggestions from @VladimirAlexiev on how to approach this and we are about to close #105 imminently I think I can create some examples for facilities and link the the unlocode outputs from #105, aim to do this for next meeting

from spec-jsonld.

cmsdroff avatar cmsdroff commented on July 28, 2024

DRAFT for discussion during tomorrows call @nissimsan tried to use the committed work on unlocodes #105 for a container facility and ocean terminal. I've based this on a Facility rather than container as in initial example.

Copy the below code into https://issemantic.net/rdf-visualizer

Not perfect by any means and im yet to convert to turtle for checking etc that's next šŸ¤£

I linked to the UNLOCODE, Function, Subdivision and Country as below.

{
    "@context": [
        "https://schema.org",
        {"unlcdc": "https://service.unece.org/trade/uncefact/vocabulary/unlocode-countries/"},
        {"unlcds": "https://service.unece.org/trade/uncefact/vocabulary/unlocode-subdivisions/"},
        {"unlcd": "https://service.unece.org/trade/uncefact/vocabulary/unlocode/"},
        {"unlcdf": "https://service.unece.org/trade/uncefact/vocabulary/unlocode-functions/"}
    ],
    "@type": "ContainerFacility",
    "name": "HHLA CONTAINER TERMINAL ALTENWERDER (CTA)",
    "unlcdc":"DE",
    "unlcds":"HH",
    "unlcd":"DEHAM",
    "unlcdf": [1,2,3,4,5],
    "address": {
    "@type": "PostalAddress",
    "streetAddress": "Am Ballinkai 1",
    "addressLocality": "Hamburg",
    "postalCode": "21129",
    "addressCountry": "DE"
    },
    "geo": {
    "@type": "GeoCoordinates",
    "latitude": 53.509241285961544, 
    "longitude": 9.927578892050956
    },
    "url": "https://www.bic-code.org/facility-codes/GBLIVJMDA"     
}

from spec-jsonld.

cmsdroff avatar cmsdroff commented on July 28, 2024

Iā€™d probably omit the function and subdivision if publishing as the link to the unlocode would expose these but in think value in sharing county and maybe subdivision

from spec-jsonld.

cmsdroff avatar cmsdroff commented on July 28, 2024

Revised but still WIP storing here for coming back to ahead of next call.

{
    "@context": [
        {"unlcd": "https://dmvc7xzscpizo.cloudfront.net/unlocode"},
        {"unlcdc": "https://dmvc7xzscpizo.cloudfront.net/unlocode-countries"},
        {"unlcds": "https://dmvc7xzscpizo.cloudfront.net/unlocode-subdivisions"},
        {"unlcdf": "https://dmvc7xzscpizo.cloudfront.net/unlocode-functions"},
        "https://schema.org"
    ],
    "@type": ["Place"],
    "name": "HHLA CONTAINER TERMINAL ALTENWERDER (CTA)",
    "unlcdc": "DE",
    "unlcd": {
    	"@type": "unlcdv:UNLOCODE",
    	"unlocode": "DEHAM",
    	"countryCode":"DE"
        },
 	"address": {
	  "@type": "PostalAddress",
      "streetAddress": "Am Ballinkai 1",
      "addressCountry": "DE",
      "addressRegion": "Hamburg",
      "postalCode": "2119"
	},
    "geo": {
      "@type": "GeoCoordinates",
      "latitude": 53.509241285961544, 
      "longitude": 9.927578892050956
    },
    "url": "https://www.bic-code.org/facility-codes/GBLIVJMDA"     
}

Passes on schema validator where the old did not https://validator.schema.org

Points to resolve:

  1. The vocab url doesn't currently work and im looking for the property names in the unlcoode for example but calling via postman seems to time out for unlocode (https://dmvc7xzscpizo.cloudfront.net/unlocode-vocab) @kshychko is this me or is it a bug?
  2. Not sure if referencing the unlocode or country in the right way, moved schema.org to the bottom to resolve last

Screenshot 2022-10-28 at 12 01 45

3. look into custom `type`, its a container facility might be good to add a new type for terminal and container depot for example to the official types instead of defaulting to `place` - not related to this vocab, more linked data generally as shipping locations maybe useful.

from spec-jsonld.

kshychko avatar kshychko commented on July 28, 2024

@cmsdroff , if you need to use the context files, we've got the following contexts published:
https://dmvc7xzscpizo.cloudfront.net/unece-context.jsonld
https://dmvc7xzscpizo.cloudfront.net/unlocode-vocab-context.jsonld

from spec-jsonld.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.