improved_metadata.mojom 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. // This file is a fork of ./metadata.mojom. The original file is in-use by the
  5. // down-stream clank repositories. The fork was created so that changes can be
  6. // made here iteratively without breaking clank. Once this file has become
  7. // fairly stable, the intent is to merge it back into the original with as few
  8. // changes as possible.
  9. module schema_org.improved.mojom;
  10. import "mojo/public/mojom/base/time.mojom";
  11. import "url/mojom/url.mojom";
  12. // A property can have arrays of different types simultaneously. Non-array
  13. // values are converted to arrays of one element.
  14. struct Values {
  15. array<bool> bool_values;
  16. array<int64> long_values;
  17. array<string> string_values;
  18. array<double> double_values;
  19. array<mojo_base.mojom.Time> date_time_values;
  20. array<mojo_base.mojom.TimeDelta> time_values;
  21. array<url.mojom.Url> url_values;
  22. array<Entity> entity_values;
  23. };
  24. // Key-value pair for the attributes of an |Entity|.
  25. struct Property {
  26. string name;
  27. Values values;
  28. };
  29. // Top-level metadata entry using schema.org vocabulary.
  30. // Tree structure of entities is possible.
  31. // Ref: https://developers.google.com/schemas/formats/json-ld
  32. struct Entity {
  33. // Corresponds to the "@type" key, defined in JSON-LD.
  34. // See: https://w3c.github.io/json-ld-syntax/#specifying-the-type
  35. string type;
  36. // Corresponds to the "@id" key, defined in JSON-LD.
  37. // See: https://w3c.github.io/json-ld-syntax/#node-identifiers
  38. string id;
  39. array<Property> properties;
  40. };