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

Replace the subidentifier field with a Relationship object #108

Closed
DeraldDudley opened this issue Jul 1, 2020 · 1 comment
Closed

Replace the subidentifier field with a Relationship object #108

DeraldDudley opened this issue Jul 1, 2020 · 1 comment

Comments

@DeraldDudley
Copy link
Collaborator

Replace the subidentifier field with a Relationship object

The specification currently uses the road_events.subidentifier field as a foreign key to relate objects. However, the field does not explicitly describe how linked features are related. Replacing road_events.subidentifier with a Relation object, like the one used in JSCalendar, will relate road event features and explicitly describe how features are related.

The Relationship object as defined in the JSCalendar Specification.

A Relation object defines the relation to other objects, using a possibly empty set of relation types. The object that defines this relation is the linking object, while the other object is the linked object.

The Relation object has the following properties:

  • @type: "String" (mandatory)

Specifies the type of this object. This MUST be "Relation".

  • relation: "String[Boolean]" (optional, default: empty Object)

Describes how the linked object is related to the linking object. The relation is defined as a set of relation types. If empty, the relationship between the two objects is unspecified. Keys in the set MUST be one of the following values, or specified in the property definition where the Relation object is used, or a value registered in the IANA JSCalendar Enum Registry, or a vendor-specific value:

  • "first": The linked object is the first in a series the linking object is part of.
  • "next": The linked object is the next in a series the linking object is part of.
  • "child": The linked object is a subpart of the linking object.
  • "parent": The linking object is a subpart of the linked object.

The value for each key in the set MUST be true.

The Relationship object used in the Work Zone Data Specification.

Hierarchical Example

  • In the example below, the first road event feature ("road_event_id": "1") is the parent of the second, third, and fourth features ("road_event_id": "2", "road_event_id": "3", "road_event_id": "4")
  • Note the relationship in the first feature ("road_event_id": "1") can be left blank. The children can point to the parent with the same effect.
{
  "road_event_feed_info": {},
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "road_event_id": "1",
        "relatioship": [{"child":"2"},{"child":"3"},{"child":"4"}]
      },
      "geometry": {
        "type": "LineString",
        "coordinates": []
      }
    },
    {
      "type": "Feature",
      "properties": {
        "road_event_id": "2",
        "relatioship": {"parent":"1"}
      },
        "geometry": {
          "type": "LineString",
          "coordinates": []
      }
    },
    {
      "type": "Feature",
      "properties": {
        "road_event_id": "3",
        "relatioship": {"parent":"1"}
      },
      "geometry": {
        "type": "LineString",
        "coordinates": []
      }
    },
    {
      "type": "Feature",
      "properties": {
        "road_event_id": "4",
        "relatioship": {"parent":"1"}
      },
      "geometry": {
        "type": "LineString",
        "coordinates": []
      }
    }
  ]
}

Sequential Example

  • The example below shows how to relate and order road event features.
  • The first road event feature ("road_event_id": "1") begins the sequence and identifies the second feature ("road_event_id": "2") as next in the sequence.
  • The second feature identifies the first feature ("road_event_id": "1") as the beginning of the sequence and the third feature ("road_event_id": "3") as next in the sequence.
  • The third feature identifies the first feature ("road_event_id": "1") as the beginning of the sequence and the fourth feature ("road_event_id": "4") as next in the sequence.
  • The fourth feature identifies the first feature ("road_event_id": "1") as the beginning of the sequence.
{
  "road_event_feed_info": {},
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "road_event_id": "1",
        "relatioship": {"first":"1","next":"2"}
      },
      "geometry": {
        "type": "LineString",
        "coordinates": []
      }
    },
    {
      "type": "Feature",
      "properties": {
        "road_event_id": "2",
        "relatioship":  {"first":"1","next":"3"}
      },
        "geometry": {
          "type": "LineString",
          "coordinates": []
      }
    },
    {
      "type": "Feature",
      "properties": {
        "road_event_id": "3",
        "relatioship":  {"first":"1","next":"4"}
      },
      "geometry": {
        "type": "LineString",
        "coordinates": []
      }
    },
    {
      "type": "Feature",
      "properties": {
        "road_event_id": "4",
        "relatioship":  {"first":"1"}
      },
      "geometry": {
        "type": "LineString",
        "coordinates": []
      }
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants