Linked Art in C#

text/koot_nightwatch_ch1/2 matches the site

The introduction chapter to Koot's book is 10 pages long.

On linked.art: Texts and Documents › Pages · site JSON · type LinguisticObject · TextualDocuments.Page_Count

C#

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

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

    chapter.ReferredToBy = [
        new LinguisticObject()
            .WithContent("5 - 15")
            .WithClassifiedAs(Aat.PaginationStatement, Aat.Statement)
    ];

    chapter.WithPageCount(10, "10 pages");

    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.
  • Dimensions and physical description Each helper builds a Dimension with its AAT type, value and unit, or a classification with its metatype: height, width, colour, shape, page count, component count, file size, duration in days.

JSON from the C#

{
  "@context": "https://linked.art/ns/v1/linked-art.json",
  "id": "https://linked.art/example/text/koot_nightwatch_ch1/2",
  "type": "LinguisticObject",
  "_label": "Chapter 1 of Koot",
  "dimension": [
    {
      "type": "Dimension",
      "_label": "10 pages",
      "value": 10,
      "unit": {
        "id": "http://vocab.getty.edu/aat/300194222",
        "type": "MeasurementUnit",
        "_label": "Pages"
      },
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300404433",
          "type": "Type",
          "_label": "Count Of"
        }
      ]
    }
  ],
  "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"
        }
      ]
    }
  ],
  "referred_to_by": [
    {
      "type": "LinguisticObject",
      "content": "5 - 15",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300435440",
          "type": "Type",
          "_label": "Pagination Statement",
          "classified_as": [
            {
              "id": "http://vocab.getty.edu/aat/300418049",
              "type": "Type",
              "_label": "Brief Text"
            }
          ]
        }
      ]
    }
  ]
}

JSON on linked.art

{
  "@context": "https://linked.art/ns/v1/linked-art.json",
  "id": "https://linked.art/example/text/koot_nightwatch_ch1/2",
  "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"
    }
  ],
  "referred_to_by": [
    {
      "type": "LinguisticObject",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300435440",
          "type": "Type",
          "_label": "Pagination Statement",
          "classified_as": [
            {
              "id": "http://vocab.getty.edu/aat/300418049",
              "type": "Type",
              "_label": "Brief Text"
            }
          ]
        }
      ],
      "content": "5 - 15"
    }
  ],
  "dimension": [
    {
      "type": "Dimension",
      "_label": "10 pages",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300404433",
          "type": "Type",
          "_label": "Count Of"
        }
      ],
      "value": 10,
      "unit": {
        "id": "http://vocab.getty.edu/aat/300194222",
        "type": "MeasurementUnit",
        "_label": "Pages"
      }
    }
  ]
}

Comparison

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

Properties used

classified_as content dimension identified_by referred_to_by unit value

Vocabulary terms

Pages Chapter Count Of Primary Name Brief Text Pagination Statement Type of Work