Here are two approaches I have thought of for how this could be accomplished.
MediaObject → coordinates
The first approach would build on the existing media gallery and add a link from a MediaObject
to some coordinates.
Looking at schema.org, the best candidate I see is the spatial
property on a MediaObject
. The schema looks something like this:
{
"title": "MediaObject",
"properties": {
"spatial": {
"$ref": "#/definitions/PlaceStreamId"
}
}
}
{
"title": "Place",
"properties": {
"geo": {
"description": "The geo coordinates of the place.",
"anyOf": [
{ "$ref": "#/definitions/GeoCoordinatesStreamId" },
{ "$ref": "#/definitions/GeoShapeStreamId" }
]
}
}
}
{
"title": "GeoCoordinates",
"properties": {
"elevation": {
"anyOf": [{ "type": "number" }, { "type": "string" }]
},
"latitude": {
"anyOf": [{ "type": "number" }, { "type": "string" }]
},
"longitude": {
"anyOf": [{ "type": "number" }, { "type": "string" }]
}
}
}
So the MediaObject
links to a Place
which links to a GeoCoordinates
. This would be three separate streams.
Pros
- No new schemas or definitions
Cons
- Two additional links needed per object
- Must iterate through entire MediaGallery to see what is anchored
GeoCoordinates + MediaObject
Another approach is to have a new definition separate from the MediaGallery
. Call it AnchoredMediaObjects
. This would be an array of pairs of coordinates and objects:
{
"title": "AnchoredMediaObjects",
"properties": {
"anchors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"coordinates": { "$ref": "#/definitions/GeoCoordinatesStreamId" },
"mediaObject": { "$ref": "#/definitions/MediaObjectStreamId" }
}
}
}
}
}
Pros
- No iteration through
MediaGallery
- Only one extra stream per anchor
Cons
- New definition + schema
- No link from
MediaGallery
Both?
Both approaches could also be used to create a bidirectional link.