Linked Art in C#

text/koot_nightwatch_ch1/1 matches the site

On linked.art: Texts and Documents › Structure · site JSON · type LinguisticObject · TextualDocuments.Koot_Chapter

C#

public static LinguisticObject Koot_Chapter()
{
    var chapter = new LinguisticObject()
        .WithContext()
        .WithId("https://linked.art/example/text/koot_nightwatch_ch1/1")
        .WithLabel("Chapter 1 of Koot")
        .WithClassifiedAs(Aat.Chapter, Aat.TypeOfWork);

    chapter.IdentifiedBy = [new Name("Introduction").AsPrimaryName()];

    chapter.PartOf = [
        new LinguisticObject()
            .WithId("https://linked.art/example/text/koot_nightwatch")
            .WithLabel("Koot's Night Watch")
    ];

    return chapter;
}
  • 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/text/koot_nightwatch_ch1/1",
  "type": "LinguisticObject",
  "_label": "Chapter 1 of Koot",
  "classified_as": [
    {
      "id": "http://vocab.getty.edu/aat/300311699",
      "type": "Type",
      "_label": "Chapter",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300435443",
          "type": "Type",
          "_label": "Type of Work"
        }
      ]
    }
  ],
  "identified_by": [
    {
      "type": "Name",
      "content": "Introduction",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300404670",
          "type": "Type",
          "_label": "Primary Name"
        }
      ]
    }
  ],
  "part_of": [
    {
      "id": "https://linked.art/example/text/koot_nightwatch",
      "type": "LinguisticObject",
      "_label": "Koot's Night Watch"
    }
  ]
}

JSON on linked.art

{
  "@context": "https://linked.art/ns/v1/linked-art.json",
  "id": "https://linked.art/example/text/koot_nightwatch_ch1/1",
  "type": "LinguisticObject",
  "_label": "Chapter 1 of Koot",
  "classified_as": [
    {
      "id": "http://vocab.getty.edu/aat/300311699",
      "type": "Type",
      "_label": "Chapter",
      "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": "Introduction"
    }
  ],
  "part_of": [
    {
      "id": "https://linked.art/example/text/koot_nightwatch",
      "type": "LinguisticObject",
      "_label": "Koot's Night Watch"
    }
  ]
}

Comparison

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

Properties used

classified_as content identified_by part_of

Vocabulary terms

Chapter Primary Name Type of Work