Linked Art in C#

object/nightwatch/16 matches the site

On linked.art: Collections and Sets › Collections of Objects · site JSON · type HumanMadeObject · CollectionsAndSets.Nightwatch_in_Paintings

C#

public static HumanMadeObject Nightwatch_in_Paintings()
{
    var nightwatch = new HumanMadeObject()
        .WithContext()
        .WithId("https://linked.art/example/object/nightwatch/16")
        .WithLabel("Night Watch by Rembrandt")
        .WithClassifiedAs(Aat.Painting, Aat.TypeOfWork);

    nightwatch.IdentifiedBy = [new Name("The Night Watch").AsPrimaryName()];

    nightwatch.MemberOf = [
        new Set()
            .WithId("https://linked.art/example/set/rijks_paintings")
            .WithLabel("Paintings of the Rijksmuseum")
    ];

    return nightwatch;
}
  • Metatype classification The second argument classifies the first, not the object: WithClassifiedAs(Aat.Description, Aat.Statement) says this is a Description, and Description is a kind of Statement. The Plain C# form shows the nesting.
  • Role shortcuts AsPrimaryName, AsAccessionNumber and AsSystemAssignedNumber each add a single classification, with the AAT terms Primary Name, Accession Number and System Number.

JSON from the C#

{
  "@context": "https://linked.art/ns/v1/linked-art.json",
  "id": "https://linked.art/example/object/nightwatch/16",
  "type": "HumanMadeObject",
  "_label": "Night Watch by Rembrandt",
  "classified_as": [
    {
      "id": "http://vocab.getty.edu/aat/300033618",
      "type": "Type",
      "_label": "Painting",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300435443",
          "type": "Type",
          "_label": "Type of Work"
        }
      ]
    }
  ],
  "identified_by": [
    {
      "type": "Name",
      "content": "The Night Watch",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300404670",
          "type": "Type",
          "_label": "Primary Name"
        }
      ]
    }
  ],
  "member_of": [
    {
      "id": "https://linked.art/example/set/rijks_paintings",
      "type": "Set",
      "_label": "Paintings of the Rijksmuseum"
    }
  ]
}

JSON on linked.art

{
  "@context": "https://linked.art/ns/v1/linked-art.json",
  "id": "https://linked.art/example/object/nightwatch/16",
  "type": "HumanMadeObject",
  "_label": "Night Watch by Rembrandt",
  "classified_as": [
    {
      "id": "http://vocab.getty.edu/aat/300033618",
      "type": "Type",
      "_label": "Painting",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300435443",
          "type": "Type",
          "_label": "Type of Work"
        }
      ]
    }
  ],
  "identified_by": [
    {
      "type": "Name",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300404670",
          "type": "Type",
          "_label": "Primary Name"
        }
      ],
      "content": "The Night Watch"
    }
  ],
  "member_of": [
    {
      "id": "https://linked.art/example/set/rijks_paintings",
      "type": "Set",
      "_label": "Paintings of the Rijksmuseum"
    }
  ]
}

Comparison

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

Properties used

classified_as content identified_by member_of

Vocabulary terms

Painting Primary Name Type of Work