Linked Art in C#

object/torosaurus/1 matches the site

The fossil Torosaurus (VP.04072) was encountered in 1891 by John Bell Hatcher.

On linked.art: Object Production and Destruction › Discovery versus Production · site JSON · type HumanMadeObject · ProductionDestruction.Torosaurus_Gladius

C#

public static HumanMadeObject Torosaurus_Gladius()
{
    var torosaurus = new HumanMadeObject()
        .WithContext()
        .WithId("https://linked.art/example/object/torosaurus/1")
        .WithLabel("Torosaurus Gladius");

    torosaurus.EncounteredBy = [
        new Encounter()
        {
            TimeSpan = LinkedArtTimeSpan.FromYear(1891),
            CarriedOutBy = [
                new Person()
                    .WithId("https://linked.art/example/person/hatcher")
                    .WithLabel("John Bell Hatcher")
            ]
        }
    ];

    // The docs example doesn't have a label "1891" on the timespan:

    return torosaurus;
}

JSON from the C#

{
  "@context": "https://linked.art/ns/v1/linked-art.json",
  "id": "https://linked.art/example/object/torosaurus/1",
  "type": "HumanMadeObject",
  "_label": "Torosaurus Gladius",
  "encountered_by": [
    {
      "type": "Encounter",
      "carried_out_by": [
        {
          "id": "https://linked.art/example/person/hatcher",
          "type": "Person",
          "_label": "John Bell Hatcher"
        }
      ],
      "timespan": {
        "type": "TimeSpan",
        "begin_of_the_begin": "1891-01-01T00:00:00Z",
        "end_of_the_end": "1891-12-31T23:59:59Z"
      }
    }
  ]
}

JSON on linked.art

{
  "@context": "https://linked.art/ns/v1/linked-art.json",
  "id": "https://linked.art/example/object/torosaurus/1",
  "type": "HumanMadeObject",
  "_label": "Torosaurus Gladius",
  "encountered_by": [
    {
      "type": "Encounter",
      "timespan": {
        "type": "TimeSpan",
        "begin_of_the_begin": "1891-01-01T00:00:00Z",
        "end_of_the_end": "1891-12-31T23:59:59Z"
      },
      "carried_out_by": [
        {
          "id": "https://linked.art/example/person/hatcher",
          "type": "Person",
          "_label": "John Bell Hatcher"
        }
      ]
    }
  ]
}

Comparison

The two documents are equivalent (property order ignored, array order significant).

Properties used

begin_of_the_begin carried_out_by encountered_by end_of_the_end timespan