distributed-text-services / specifications

Specifications for the DTS API
https://w3id.org/dts
28 stars 9 forks source link

Hide the prefixes behind a nice @context à la IIIF for developers who do not care about Linked Data. #210

Closed monotasker closed 7 months ago

jonathanrobie commented 2 years ago

I assume this refers to this part of IIIF:

https://iiif.io/api/presentation/3.0/#46-linked-data-context-and-extensions

I assume that works as a "default context declaration", used when there is no prefix? And that other contexts could be declared, in addition, and associated with prefixes?

jonathanrobie commented 2 years ago

The dc prefix is defined in our schema, so people can use that. They can also define their own prefixes, e.g. if they want metadata that Dublin Core does not define.

PonteIneptique commented 2 years ago

Here is an example Manifest where things are mapped with context: https://iiif.io/api/presentation/3.0/#b-example-manifest-response

{
  "@context": "http://iiif.io/api/presentation/3/context.json",
  "id": "https://example.org/iiif/book1/manifest",
  "type": "Manifest",
  "label": { "en": [ "Book 1" ] },
  "metadata": [
    {
      "label": { "en": [ "Author" ] },
      "value": { "none": [ "Anne Author" ] }
    },
    {
      "label": { "en": [ "Published" ] },
      "value": {
        "en": [ "Paris, circa 1400" ],
        "fr": [ "Paris, environ 1400" ]
      }
    },
    {
      "label": { "en": [ "Notes" ] },
      "value": {
        "en": [
          "Text of note 1",
          "Text of note 2"
        ]
      }
    },
jonathanrobie commented 2 years ago

This more recent version of the json-ld spec is very helpful for seeing equivalents clearly, seeing the compact and expanded equivalents:

https://w3c.github.io/json-ld-syntax/#scoped-contexts

image

image

PonteIneptique commented 2 years ago

So, we have the following draft of a context.json:

{
  "@context": {
    "hydra": "https://www.w3.org/ns/hydra/core#",
    "dct": "http://purl.org/dc/terms/",
    "dts": "https://w3id.org/dts/api#",

    // Types should be mapped
    "Collection": "dts:Collection",
    "Resource": "dts:Resource",
    "CitableUnit": "dts:CitableUnit",
    "EntryPoint": "dts:EntryPoint",

    // Hydra interaction
    "statusCode": "hydra:statusCode",
    "Status": "hydra:Status",

    // Collection
    "title": "hydra:title",
    "description": "hydra:description",
    "member": "hydra:member",
    "totalItems": "hydra:totalItems",

    "id": "@id",
    "type": "@type",
    "language": "@language",
    "value": "@value",

    "totalChildren": "dts:totalChildren",
    "totalParents": "dts:totalParents",
    "maxCiteDepth": "dts:maxCiteDepth",
      "dublincore": {
        "@id": "dts:dublincore", // Using @id because we are using an object
        "@context": {"@vocab": "http://purl.org/dc/terms/"}
    },
    "references": "dts:references",
    "download": "dts:download",
    "passage": "dts:passage",

    "extensions": "dts:extensions",
    "citeStructure": {
        "@id": "dts:citeStructure",
      "@type": "@list"
    },
    "citeType": {
      "@id": "dts:citeType",
      "@type": "@value",
      // Connect to schema or whateverelse if we want to make this more LOD.
    },

    // Navigation only
    "referenceNode": "dts:referenceNode",
    "level": "dts:level",
    "parent": "dts:parent",
    "ref": "dts:ref",
    "start": "dts:start",
    "end": "dts:end"
    // (Optional) dts:extensions contains any supplementary information provided by other ontologies/domains
  }
}

Issues we have to deal with:

  1. Do we want to type a little more what we do (ints, strings, value, URIs) ?
  2. dts:extensions is tricky, @hcayless will take a stab at it. ( issue #215 )
  3. We have some kind of discrepancies between dts:navigation in the EntryPoint and dts:references in both Collections and Navigation ( issue #214 )
  4. We still need the view / pagination to be dealt with.
  5. We should probably have our vocabulary defined somewhere else.
  6. @language is mapped to language but in dublincore, language is mapped to dct:language, even though language as a property of an object under a dublincore property in there should be rdfs:language ( issue #216 )

Some example:

{
    "@context": "https://w3id.org/dts/1.0/context.json",
    "id": "lasciva_roma",
    "type": "Collection",
    "totalItems": 3,
    "totalParents": 1,
    "totalChildren": 3,
    "title" : "Lasciva Roma",
    "description": "Collection of primary sources of interest in the studies of Ancient World's sexuality",
    "dublincore": {
        "creator": [
            "Thibault Clérice", "http://orcid.org/0000-0003-1852-9204"
        ],
        "title" : [
            {"language": "la", "value": "Lasciva Roma"},
        ],
        "description": [
            {
                "language": "en",
                "value": "Collection of primary sources of interest in the studies of Ancient World's sexuality"
            }
        ],
    },
    "member": [
        {
            "id" : "urn:cts:latinLit:phi1103.phi001",
            "title" : "Priapeia",
            "dublincore": {
                "type": [
                    "http://chs.harvard.edu/xmlns/cts#work"
                ],
                "creator": [
                    {"language": "en", "value": "Anonymous"}
                ],
                "language": ["la", "en"],
                "description": [
                    { "language": "en", "value": "Anonymous lascivious Poems" }
                ],
            },
            "type" : "Collection",
            "totalItems": 1,
            "totalParents": 1,
            "totalChildren": 1
        }
    ]
}
monotasker commented 7 months ago

We published the resolution of this issue during the tech committee meeting on 2024-03-08

commit https://github.com/distributed-text-services/specifications/commit/a0db8ca0f5b9ef2e208baae7cacd8e2b6108685b release https://github.com/distributed-text-services/specifications/releases/tag/1-alpha1

This is an alpha release and we are looking for feedback!