6#include "reservationconverter.h"
7#include "json/jsonldfilterengine.h"
15 {
"TrainReservation",
"BusReservation" },
16 {
"TrainStation",
"BusStation" },
17 {
"TrainTrip",
"BusTrip" },
21 {
"BusTrip",
"arrivalStation",
"arrivalBusStop" },
22 {
"BusTrip",
"departureStation",
"departureBusStop" },
23 {
"BusTrip",
"trainName",
"busName" },
24 {
"BusTrip",
"trainNumber",
"busNumber" },
31 filterEngine.setTypeMappings(train_to_bus_type_map);
32 filterEngine.setPropertyMappings(train_to_bus_property_map);
38 {
"BusReservation",
"TrainReservation" },
39 {
"BusStation",
"TrainStation" },
40 {
"BusStop",
"TrainStation" },
41 {
"BusTrip",
"TrainTrip" },
45 {
"TrainTrip",
"arrivalBusStop",
"arrivalStation" },
46 {
"TrainTrip",
"departureBusStop",
"departureStation" },
47 {
"TrainTrip",
"busCompany",
"provider" },
48 {
"TrainTrip",
"busName",
"trainName" },
49 {
"TrainTrip",
"busNumber",
"trainNumber" },
56 filterEngine.setTypeMappings(bus_to_train_type_map);
57 filterEngine.setPropertyMappings(bus_to_train_property_map);
63 {
"Airline",
"Organization" },
64 {
"Airport",
"TrainStation" },
65 {
"Flight",
"TrainTrip" },
66 {
"FlightReservation",
"TrainReservation" },
70 {
"Organization",
"iataCode",
"identifier" },
71 {
"TrainStation",
"iataCode",
"identifier" },
72 {
"TrainTrip",
"airline",
"provider" },
73 {
"TrainTrip",
"arrivalAirport",
"arrivalStation" },
74 {
"TrainTrip",
"departureAirport",
"departureStation" },
80 if (
const auto id = o.value(
"identifier"_L1).toString(); !
id.isEmpty()) {
81 o[
"identifier"_L1] =
QString(
"iata:"_L1 +
id);
90 filterEngine.setTypeMappings(flight_to_train_type_map);
91 filterEngine.setPropertyMappings(flight_to_train_property_map);
96 addIataIdentifierPrefix(flight,
"provider"_L1);
97 addIataIdentifierPrefix(flight,
"departureStation"_L1);
98 addIataIdentifierPrefix(flight,
"arrivalStation"_L1);
99 obj[
"reservationFor"_L1] = flight;
JSON-LD filtering for input normalization or type transforms.
void filterRecursive(QJsonObject &obj)
Recursively apply filtering rules to obj.
QJsonObject trainToBus(const QJsonObject &trainRes)
Convert a train reservation to a bus reservation.
QJsonObject flightToTrain(const QJsonObject &flightRes)
Convert a flight reservation to a train reservation.
QJsonObject busToTrain(const QJsonObject &busRes)
Convert a bus reservation to a train reservation.
Classes for reservation/travel data models, data extraction and data augmentation.
QJsonValue value(QLatin1StringView key) const const
QJsonObject toObject() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:52:37 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.