This repository contains the mapping structures and functions for transforming DiscoverSwiss data into the OpenDataHub content API ontology.
The primary purpose of this repository is to:
- Maintain mapping functions between DiscoverSwiss and OpenDataHub data structures
- Define Go structs that represent the data models
- Provide reusable mapping packages for the collector and transformers implementation
.
├── models/ # Data structures for both source and target schemas
│ ├── discover/ # DiscoverSwiss data models
│ │ └── accomodation.go
│ └── odh/ # OpenDataHub data models
│ └── new_model.go
├── mappers/ # Mapping functions
│ ├── lodgingmap.go
│ └── new_mapper.go
├── go.mod
├── go.sum
└── README.md
Import the required mapper packages in your collector implementation:
import (
"github.com/noi-techpark/go-opendatahub-discoverwiss/mappers"
"github.com/noi-techpark/go-opendatahub-discoverwiss/models"
)
Example mapping usage:
// Create a model
mapper := models.Accommodation{}
// Map DiscoverSwiss data to ODH format
odhData, err := mapper.MapAccommodation(discoverSwissData)
if err != nil {
log.Fatal(err)
}
OpenDataHub Team - help@opendatahub.com