Semantic Trip

Curiosio
6 min readFeb 8, 2020

--

by Vas Mylko

It was Supertrips hackathon when we seriously thought about representing travel itineraries in machine-friendly format for the first time. We wanted a lightweight markup language, that is both machine and human-friendly. Back then, it was focused on the search query rather than on the search result.

After the recent experiments with ingesting travel stories from the web, we started to think about the machine-friendly representation of any travel itinerary — transcribed original story or search result by Curiosio.

Travel stories from the Web: Travel + Leisure, Australia.com, Wikivoyage, Condé Nast Traveler.

Questions

  1. What is the best format to transcribe any travel story on the Web?
  2. What is the best format to return search results from Curiosio?
  3. What is the best format to [Supersearch] interactively in Curiosio?
  4. Can travel itinerary from Curiosio be read by another travel system?
  5. Can Curiosio read a travel itinerary from another travel system?

Schema.org

Years ago I learned the programming wisdom that standard was better than custom, even if the standard lacked features. Is there a standard to answer those questions? It appeared that yes — schema.org.

Founded by Google, Microsoft, Yahoo in June 2011. Then Yandex joined in November 2011. There are schemas for structured data on the Internet, on web pages, in email messages, and beyond. Schema.org vocabularies are developed by an open community process. It’s proposed to use Schema vocabularies together with data formats, such as RDF/RDFa and JSON-LD.

Abstractions

Trip — a trip or journey. An itinerary of visits to one or more places. (Naming things is hard. Trip is destination-oriented. Journey is multi-point. Tour is themed. But there is only one abstraction, called Trip.)

TouristTrip — a tourist trip. Derived from Trip. A created itinerary of visits to one or more places of interest often linked by a similar theme, geographic area, or interest to a particular tourist type.

TouristDestination — a tourist destination. Derived from Place. The UNWTO defines Destination (main destination of a tourism trip) as the place visited that is central to the decision to take the trip.

TouristAttraction — a tourist attraction. Derived from Place. Anything can be a tourist attraction: mountain, landmark, historic building, local business. So this is POI aka point of interest.

Relations are established via properties and aggregation. Trip (and derived TouristTrip) has the property itinerary. Itinerary can contain one or more Place (or derived TouristDestination).

Arranging POIs by populated places and nature can by implemented via the property of TouristDestination includesAttraction. A list of TouristAttraction nodes can be assigned as value.

Multi-day trip abstraction can be implemented as a hierarchy. Separate days are represented as separate Trip nodes. TouristTrip can have multiple Trip nodes assigned to subTrip property as a list.

Travel Itinerary in JSON-LD Format

I am going to transcribe one of Curiosio Originals. Let’s take this trip.

Below is the trip in JSON-LD format. Captured with Carbon, because browser standard whole web page capturing did not work on JSON content.

Conclusion

Semantic Data meets Travel. It is possible to use Schema.org abstractions for a description of the travel itineraries. More properties to be involved (to define time ranges arrivalTime, departureTime) for fine-tuning Trip nodes by days.

If some geeks can design connectors/adapters that crawl National Geographic & Co and produce travel stories in JSON-LD format — that would be awesome! It will be the beginning of transcribing all travel stories from free form to the standard machine form. NLP-to-JSON.

Anything can be put on input, modified by geo/points/time/budget, and put on output in the machine-to-machine friendly manner. Curiosio will read JSON-LD for search queries. Curiosio will produce search results in JSON-LD.

Appendix A — Reusable Code

Here is editable format. Rendered very poorly by Medium. But if somebody wants to experiment — here you go.

{
"@context": "http://schema.org",
"@type": "TouristTrip",
"name": "NUCLEAR AND UFO STORIES AROUND SANTA FE",
"description": "Santa Fe Institute of Complex Systems. First nuclear explosion site. Los Alamos. Roswell UFO Incident.",
"subTrip": [
{
"@type": "TouristTrip",
"name": "DAY 1-3",
"description": "3 nights",
"itinerary": [
{
"@type": "TouristDestination",
"name": "Santa Fe, New Mexico",
"url": "https://en.wikipedia.org/wiki/Santa_Fe,_New_Mexico",
"includesAttraction": [
{
"@type": "TouristAttraction",
"name": "Palace of the Governors",
"url": "https://en.wikipedia.org/wiki/Palace_of_the_Governors"
},
{
"@type": "TouristAttraction",
"name": "Cathedral Basilica of St. Francis of Assisi (Santa Fe)",
"url": "https://en.wikipedia.org/wiki/Cathedral_Basilica_of_St._Francis_of_Assisi_(Santa_Fe)"
},
{
"@type": "TouristAttraction",
"name": "Sangre de Cristo Mountains",
"url": "https://en.wikipedia.org/wiki/Sangre_de_Cristo_Mountains"
},
{
"@type": "TouristAttraction",
"name": "SITE Santa Fe",
"url": "https://en.wikipedia.org/wiki/SITE_Santa_Fe"
},
{
"@type": "TouristAttraction",
"name": "New Mexico Museum of Art",
"url": "https://en.wikipedia.org/wiki/New_Mexico_Museum_of_Art"
},
{
"@type": "TouristAttraction",
"name": "Meow Wolf",
"url": "https://en.wikipedia.org/wiki/Meow_Wolf"
},
{
"@type": "TouristAttraction",
"name": "Santa Fe Institute",
"url": "https://en.wikipedia.org/wiki/Santa_Fe_Institute"
},
{
"@type": "TouristAttraction",
"name": "Jean Cocteau Cinema",
"url": "https://en.wikipedia.org/wiki/Jean_Cocteau_Cinema"
},
{
"@type": "TouristAttraction",
"name": "Museum of Indian Arts and Culture",
"url": "https://en.wikipedia.org/wiki/Museum_of_Indian_Arts_and_Culture"
},
{
"@type": "TouristAttraction",
"name": "Hyde Memorial State Park",
"url": "https://en.wikipedia.org/wiki/Hyde_Memorial_State_Park"
},
{
"@type": "TouristAttraction",
"name": "Loretto Chapel",
"url": "https://en.wikipedia.org/wiki/Loretto_Chapel"
},
{
"@type": "TouristAttraction",
"name": "Lensic Theater",
"url": "https://en.wikipedia.org/wiki/Lensic_Theater"
},
{
"@type": "TouristAttraction",
"name": "Barrio De Analco Historic District",
"url": "https://en.wikipedia.org/wiki/Barrio_De_Analco_Historic_District"
}
]
}
]
},
{
"@type": "TouristTrip",
"name": "DAY 4-5",
"description": "2 nights",
"itinerary": [
{
"@type": "TouristDestination",
"name": "Trinity (nuclear test)",
"url": "https://en.wikipedia.org/wiki/Trinity_(nuclear_test)"
},
{
"@type": "TouristDestination",
"name": "Roswell, New Mexico",
"url": "https://en.wikipedia.org/wiki/Roswell,_New_Mexico",
"includesAttraction": [
{
"@type": "TouristAttraction",
"name": "New Mexico Military Institute",
"url": "https://en.wikipedia.org/wiki/New_Mexico_Military_Institute"
},
{
"@type": "TouristAttraction",
"name": "Salt Creek Wilderness",
"url": "https://en.wikipedia.org/wiki/Salt_Creek_Wilderness"
},
{
"@type": "TouristAttraction",
"name": "Walker Air Force Base",
"url": "https://en.wikipedia.org/wiki/Walker_Air_Force_Base"
},
{
"@type": "TouristAttraction",
"name": "Roswell Museum and Art Center",
"url": "https://en.wikipedia.org/wiki/Roswell_Museum_and_Art_Center"
},
{
"@type": "TouristAttraction",
"name": "International UFO Museum and Research Center",
"url": "https://en.wikipedia.org/wiki/International_UFO_Museum_and_Research_Center"
}
]
}
]
},
{
"@type": "TouristTrip",
"name": "DAY 6",
"description": "1 night",
"itinerary": [
{
"@type": "TouristDestination",
"name": "Roswell, New Mexico",
"url": "https://en.wikipedia.org/wiki/Trinity_(nuclear_test)",
"description": "continue ½ day in Roswell, New Mexico"
},
{
"@type": "TouristDestination",
"name": "Roswell UFO incident",
"url": "https://en.wikipedia.org/wiki/Roswell_UFO_incident"
},
{
"@type": "TouristDestination",
"name": "Chimayo, New Mexico",
"url": "https://en.wikipedia.org/wiki/Chimayo,_New_Mexico"
}
]
},
{
"@type": "TouristTrip",
"name": "DAY 7",
"description": "1 night",
"itinerary": [
{
"@type": "TouristDestination",
"name": "Chimayo, New Mexico",
"url": "https://en.wikipedia.org/wiki/Chimayo,_New_Mexico",
"description": "continue ½ day in Chimayo, New Mexico"
},
{
"@type": "TouristDestination",
"name": "Cordova, New Mexico",
"url": "https://en.wikipedia.org/wiki/Cordova,_New_Mexico"
},
{
"@type": "TouristDestination",
"name": "Peñasco, New Mexico",
"url": "https://en.wikipedia.org/wiki/Pe%C3%B1asco,_New_Mexico"
}
]
},
{
"@type": "TouristTrip",
"name": "DAY 8",
"description": "1 night",
"itinerary": [
{
"@type": "TouristDestination",
"name": "Los Alamos, New Mexico",
"url": "https://en.wikipedia.org/wiki/Los_Alamos,_New_Mexico",
"includesAttraction": [
{
"@type": "TouristAttraction",
"name": "Los Alamos National Laboratory",
"url": "https://en.wikipedia.org/wiki/Los_Alamos_National_Laboratory"
},
{
"@type": "TouristAttraction",
"name": "Bradbury Science Museum",
"url": "https://en.wikipedia.org/wiki/Bradbury_Science_Museum"
},
{
"@type": "TouristAttraction",
"name": "Los Alamos Neutron Science Center",
"url": "https://en.wikipedia.org/wiki/Los_Alamos_Neutron_Science_Center"
},
{
"@type": "TouristAttraction",
"name": "Los Alamos Ranch School",
"url": "https://en.wikipedia.org/wiki/Los_Alamos_Ranch_School"
},
{
"@type": "TouristAttraction",
"name": "Los Alamos Historical Museum",
"url": "https://en.wikipedia.org/wiki/Los_Alamos_Historical_Museum"
}
]
}
]
},
{
"@type": "TouristTrip",
"name": "DAY 9-10",
"description": "1 night",
"itinerary": [
{
"@type": "TouristDestination",
"name": "Santa Fe, New Mexico",
"url": "https://en.wikipedia.org/wiki/Santa_Fe,_New_Mexico",
"description": "Relax & Departure"
}
]
}
]
}

Appendix B — Testing Tool

JSON-LD can be tested with Google Structured Data Testing Tool. Here is screenshot from the tool. I tested this trip exactly in this tool.

Google Structured Data Testing Tool

--

--