Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for a route format standard #27

Closed
carlosmanri opened this issue Feb 18, 2020 · 8 comments
Closed

Proposal for a route format standard #27

carlosmanri opened this issue Feb 18, 2020 · 8 comments
Assignees
Labels
➕enhancement New feature or request 🚀 help wanted Extra attention is needed 💬 Question Further information is requested

Comments

@carlosmanri
Copy link
Contributor

carlosmanri commented Feb 18, 2020

Proposal for a route format

The use of a subset of the existing "Trip" scheme from schema.org is proposed to structure the route data

I have tried to reduce the number of properties to the minimum possible, but always with the future in mind in order to extend it in the future if changes arise that would make us require more information

Next, the schemes used that will make up the route are broken down. At the end of the document you can see two examples of routes

Already existing schemas and fields in use

As the web Schema.org says:

Schema.org is a collaborative, community activity with a mission to create, maintain, and promote schemas for structured data on the Internet, on web pages, in email messages, and beyond. Schema.org vocabulary can be used with many different encodings, including RDFa, Microdata and JSON-LD.
Founded by Google, Microsoft, Yahoo and Yandex, Schema.org vocabularies are developed by an open community process, using the [email protected] mailing list and through GitHub.

To define the route, existing schema.org schemes have been used. This allows us to create a format that is compatible with existing structured data.

A property name in bold means that it is mandatory to define the route

Trip

Complete schema: Trip

Property Expected type Description
name Text The name of the route
description Text A brief description of the route
itinerary ItemList Destinations that make the trip. ItemList ensures the order of the elements

GeoCoordinates

Complete schema: GeoCoordinates

Property Expected type Description
name Text The name of the place
address Text Physical address of the item
addressCountry Text The country, You can also provide the two-letter ISO 3166-1 alpha-2 country code
elevation Number The elevation. Assumed in meters
latitude Number The latitude of a location
longitude Number The longitude of a location
description Text A brief description of the place
postalCode Text or Number The postal code
image ImageObject or URL An image of the place

ImageObject

Complete schema: ImageObject

Property Expected type Description
contentURL URL Actual bytes of the media object, for example the image file or video file.

ItemList

Complete schema: ItemList

Property Expected type Description
itemListElement GeoCoordinate Element that represent a waypoint in the route
itemListOrder itemListOrderType Type of ordering (e.g. Ascending, Descending, Unordered)
numberOfItems Integer Number of items in the list.

Example of a complete route

{
    "@context": "http://schema.org",
    "@type": "Trip",
    "name": "A route 1",
    "description": "The test route with all the properties",
    "itinerary": {
      "@type": "ItemList",
      "numberOfItems": 6,
      "itemListOrder": "http://schema.org/ItemListOrderDescending",
      "itemListElement": [
        {
          "@type": "GeoCoordinates",
          "name": "Waypoint 1",
          "address": "Calle Cardenal Cienfuegos",
          "addressCountry": "ES",
          "elevation": 266,
          "latitude": 43.3551061,
          "longitude": -5.8512792,
          "postalCode": 33007,
          "image": {
            "@type": "ImageObject",
            "contentUrl": "https://ingenieriainformatica.uniovi.es/image/image_gallery?uuid=52c688ab-7f0c-424a-9113-60d512f0ca8b&groupId=780436&t=1347274143849"
          }
        },
        {
          "@type": "GeoCoordinates",
          "name": "Waypoint 2",
          "address": "Calle Cardenal Cienfuegos",
          "addressCountry": "ES",
          "elevation": 264,
          "latitude": 43.3547082,
          "longitude": -5.8507937,
          "postalCode": 33007,
          "image": {
            "@type": "ImageObject",
            "contentUrl": "https://cei.uniovi.es/image/image_gallery?uuid=bae87ecb-b806-44bd-857c-ccc2c563b133&groupId=49472&t=1284395694586"
          }
        },
        {
          "@type": "GeoCoordinates",
          "name": "Waypoint 3",
          "address": "Calle Cardenal Cienfuegos",
          "addressCountry": "ES",
          "elevation": 266,
          "latitude": 43.3545444,
          "longitude": -5.8494473,
          "postalCode": 33007,
          "image": {
            "@type": "ImageObject",
            "contentUrl": ""
          }
        },
        {
          "@type": "GeoCoordinates",
          "name": "Waypoint 4",
          "address": "Calle Cardenal Cienfuegos",
          "addressCountry": "ES",
          "elevation": 266,
          "latitude": 43.3546653,
          "longitude": -5.8490288,
          "postalCode": 33007,
          "image": {
            "@type": "ImageObject",
            "contentUrl": ""
          }
        },
        {
          "@type": "GeoCoordinates",
          "name": "Waypoint 5",
          "address": "Calle Cardenal Cienfuegos",
          "addressCountry": "ES",
          "elevation": 271,
          "latitude": 43.354872,
          "longitude": -5.8487445,
          "postalCode": 33007,
          "image": {
            "@type": "ImageObject",
            "contentUrl": ""
          }
        },
        {
          "@type": "GeoCoordinates",
          "name": "Waypoint 6",
          "address": "Calle Cardenal Cienfuegos",
          "addressCountry": "ES",
          "elevation": 274,
          "latitude": 43.3552699,
          "longitude": -5.8485675,
          "postalCode": 33007,
          "image": {
            "@type": "ImageObject",
            "contentUrl": ""
          }
        }
      ]
    }
  }

Example of a minimum route

{
    "@context": "http://schema.org",
    "@type": "Trip",
    "name": "A route 1",
    "description": "The test route with the least number of possible properties",
    "itinerary": {
        "@type": "ItemList",
        "numberOfItems": 6,
        "itemListOrder": "http://schema.org/ItemListOrderDescending",
        "itemListElement": [
            {
                "@type": "GeoCoordinates",
                "latitude": 43.3551061,
                "longitude": -5.8512792
            },
            {
                "@type": "GeoCoordinates",
                "latitude": 43.3547082,
                "longitude": -5.8507937
            },
            {
                "@type": "GeoCoordinates",
                "latitude": 43.3545444,
                "longitude": -5.8494473
            },
            {
                "@type": "GeoCoordinates",
                "latitude": 43.3546653,
                "longitude": -5.8490288
            },
            {
                "@type": "GeoCoordinates",
                "latitude": 43.354872,
                "longitude": -5.8487445
            },
            {
                "@type": "GeoCoordinates",
                "latitude": 43.3552699,
                "longitude": -5.8485675
            }
        ]
    }
}

An example of a route in RDF Triples

/* triples as < subject, predicate, object > */

<root, @type, Trip>
<root, name, A route 1>
<root, description, The test route with all the properties>
<root, itinerary, @type>
<@type, type, ItemList>
<root, itinerary, numberOfItems>
<root, itinerary, itemListOrder>
<itemListOrder, type, http://schema.org/ItemListOrderDescending>
<root, itinerary, itemListElement>
<itemListElement, param, 0>
<itemListElement, param, 1>
<itemListElement, param, 2>
<itemListElement, param, 3>
<itemListElement, param, 4>
<itemListElement, param, 5>

The minimum route from the examples in n-triples

_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Trip> .
_:genid1 <http://schema.org/description> "The test route with the least number of possible properties"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid1 <http://schema.org/itinerary> _:genid2 .
_:genid1 <http://schema.org/name> "A route 1"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/ItemList> .
_:genid2 <http://schema.org/itemListElement> _:genid3 .
_:genid2 <http://schema.org/itemListElement> _:genid4 .
_:genid2 <http://schema.org/itemListElement> _:genid5 .
_:genid2 <http://schema.org/itemListElement> _:genid6 .
_:genid2 <http://schema.org/itemListElement> _:genid7 .
_:genid2 <http://schema.org/itemListElement> _:genid8 .
_:genid2 <http://schema.org/itemListOrder> "http://schema.org/ItemListOrderDescending"^^<http://www.w3.org/2001/XMLSchema#string> .
_:genid2 <http://schema.org/numberOfItems> "6"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .
_:genid3 <http://schema.org/latitude> "4.33551061E1"^^<http://www.w3.org/2001/XMLSchema#double> .
_:genid3 <http://schema.org/longitude> "-5.8512792E0"^^<http://www.w3.org/2001/XMLSchema#double> .
_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .
_:genid4 <http://schema.org/latitude> "4.33547082E1"^^<http://www.w3.org/2001/XMLSchema#double> .
_:genid4 <http://schema.org/longitude> "-5.8507937E0"^^<http://www.w3.org/2001/XMLSchema#double> .
_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .
_:genid5 <http://schema.org/latitude> "4.33545444E1"^^<http://www.w3.org/2001/XMLSchema#double> .
_:genid5 <http://schema.org/longitude> "-5.8494473E0"^^<http://www.w3.org/2001/XMLSchema#double> .
_:genid6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .
_:genid6 <http://schema.org/latitude> "4.33546653E1"^^<http://www.w3.org/2001/XMLSchema#double> .
_:genid6 <http://schema.org/longitude> "-5.8490288E0"^^<http://www.w3.org/2001/XMLSchema#double> .
_:genid7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .
_:genid7 <http://schema.org/latitude> "4.3354872E1"^^<http://www.w3.org/2001/XMLSchema#double> .
_:genid7 <http://schema.org/longitude> "-5.8487445E0"^^<http://www.w3.org/2001/XMLSchema#double> .
_:genid8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .
_:genid8 <http://schema.org/latitude> "4.33552699E1"^^<http://www.w3.org/2001/XMLSchema#double> .
_:genid8 <http://schema.org/longitude> "-5.8485675E0"^^<http://www.w3.org/2001/XMLSchema#double> .
@carlosmanri carlosmanri added ➕enhancement New feature or request 🚀 help wanted Extra attention is needed 💬 Question Further information is requested labels Feb 18, 2020
@luispc1998
Copy link
Contributor

Considering the possibility of having more than one picture per "node" of the itemList. I'm thinking that it may a good idea to create a list, as done with the "nodes". In fact we should also consider "videos".

@Angelixus
Copy link
Contributor

As @luispc1998 said, there can be one and only one imageObject per itemList, I propose that first we change the name from "image" to "resource" (and from imageObject to resourceObject) because it is messy to call image any type of resource (as you said it can also be a video for example) and that we allow the now called "resource" list to have 0..* of the now called resourceObject

@carlosmanri
Copy link
Contributor Author

carlosmanri commented Feb 19, 2020

Yeah thats right. I forgot to include videos and comments for the waypoints. May be posible to add them in two ItemList, one containing media objects and another one containing user comments
What do you think?

{
  "@context": "http://schema.org",
  "@type": "Trip",
  "name": "A route 1",
  "description": "The test route with all the properties",
  "itinerary": {
    "@type": "ItemList",
    "numberOfItems": 1,
    "itemListOrder": "http://schema.org/ItemListOrderDescending",
    "itemListElement": [
      {
        "@type": "GeoCoordinates",
        "name": "Waypoint 1",
        "address": "Calle Cardenal Cienfuegos",
        "addressCountry": "ES",
        "elevation": 266,
        "latitude": 43.3551061,
        "longitude": -5.8512792,
        "postalCode": 33007,
        "media": {
          "@type": "ItemList",
          "numberOfItems": 2,
          "itemListOrder": "http://schema.org/ItemListOrderDescending",
          "itemListElement": [
            {
              "@type": "VideoObject",
              "author": "John Doe",
              "contentUrl": "mexico-beach.avi",
              "datePublished": "2013-11-28"
            },
            {
              "@type": "ImageObject",
              "author": "Jane Doe",
              "contentUrl": "mexico-beach.jpg",
              "datePublished": "2008-01-25"
            }
          ]
        }
      }
    ],
    "comments": {
      "@type": "ItemList",
      "numberOfItems": 2,
      "itemListOrder": "http://schema.org/ItemListOrderDescending",
      "itemListElement": [
        {
          "@type": "UserComments",
          "commentText": "hello there!",
          "commentTime": "2020-02-17T15:58:42",
          "creator": "Ben kenobi."
        },
        {
          "@type": "UserComments",
          "commentText": "general kenobi!",
          "commentTime": "2020-02-17T16:58:42",
          "creator": "The angry cyborg"
        }
      ]
    }
  }
}

In this case the comments are part of the route instead of the waypoints. In case the design of our application needs to add comments to the uploaded media we would just have to add the same field inside the GeoCoordinates

@Angelixus
Copy link
Contributor

Seems fine to me

@luispc1998
Copy link
Contributor

LGTM, but are we really sure about when recovering the data from the pod, the item list nodes will keep the same order of insertion?

@carlosmanri
Copy link
Contributor Author

The order of the itemlist should remain after recovering the route. If that does not work we can always add a property order with the index of the element.

@carlosmanri
Copy link
Contributor Author

As now there is a new repository dedicated to this topic, this is no longer necesary.

@labra
Copy link
Contributor

labra commented Mar 4, 2020

It would be very interesting if you try to integrate your work with the ViadeSpec work. Some of your ideas are interesting and you can discuss them there if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
➕enhancement New feature or request 🚀 help wanted Extra attention is needed 💬 Question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants