distributed-text-services / specifications

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

Collection JSON-LD is not compliant ? #86

Closed PonteIneptique closed 6 years ago

PonteIneptique commented 6 years ago

I was working on the parsing of collection data in MyCapytain and saw that the json (Example) was not correct.

I am investigating what would make it correct, even if it's not my forte clearly :)

PonteIneptique commented 6 years ago

Ok, so I am facing my limits right now :/ I'll let you all have a check on this :)

PonteIneptique commented 6 years ago

I have my "answer" :

So the first example would look like :

{
    "@context": {
        "hydra": "https://www.w3.org/ns/hydra/core#",
        "dc": "http://purl.org/dc/terms/",
        "dts": "https://w3id.org/dts/api#",
        "tei": "http://www.tei-c.org/ns/1.0"
    },
    "@id": "general",
    "@type": "hydra:Collection",
    "hydra:totalItems": "2",
    "hydra:title": "Collection Générale de l'École Nationale des Chartes",
    "dts:dublincore": {
        "dc:publisher": ["École Nationale des Chartes", "https://viaf.org/viaf/167874585"],
        "dc:title": [
            {"@language":"fre", "@value": "Collection Générale de l'École Nationale des Chartes"}
        ]
    },
    "hydra:member": [
        {
             "@id" : "cartulaires",
             "hydra:title" : "Cartulaires",
             "hydra:description": "Collection de cartulaires d'Île-de-France et de ses environs",
             "@type" : "hydra:Collection",
             "hydra:totalItems" : "10"
        },
        {
             "@id" : "lasciva_roma",
             "hydra:title" : "Lasciva Roma",
             "hydra:description": "Collection of primary sources of interest in the studies of Ancient World's sexuality",
             "@type" : "hydra:Collection",
             "hydra:totalItems" : "1"
        },
        {
             "@id" : "lettres_de_poilus",
             "hydra:title" : "Correspondance des poilus",
             "hydra:description": "Collection de lettres de poilus entre 1917 et 1918",
             "@type" : "hydra:Collection",
             "hydra:totalItems" : "10000"
        }
    ]
}
PonteIneptique commented 6 years ago

Note that to check compliancy I mostly used the expand capacities in python and https://json-ld.org/playground/

balmas commented 6 years ago

Is another option to use the @vocab keyword to set the default vocabulary instead of @base? I think @base is intended to use to set the base IRI for identifiers and @vocab is for the base IRI for vocabulary.

{
    "@context": {
        "@vocab": "https://www.w3.org/ns/hydra/core#",
        "dc": "http://purl.org/dc/terms/",
        "dts": "https://w3id.org/dts/api#",
        "tei": "http://www.tei-c.org/ns/1.0"
    },
    "@id": "general",
    "@type": "Collection",
    "totalItems": "2",
    "title": "Collection Générale de l'École Nationale des Chartes",
    "dts:dublincore": {
        "dc:publisher": ["École Nationale des Chartes", "https://viaf.org/viaf/167874585"],
        "dc:title": [
            {"fre" : "Collection Générale de l'École Nationale des Chartes"}
        ]
    },
    "member": [
        {
             "@id" : "cartulaires",
             "title" : "Cartulaires",
             "description": "Collection de cartulaires d'Île-de-France et de ses environs",
             "@type" : "Collection",
             "totalItems" : "10"
        },
        {
             "@id" : "lasciva_roma",
             "title" : "Lasciva Roma",
             "description": "Collection of primary sources of interest in the studies of Ancient World's sexuality",
             "@type" : "Collection",
             "totalItems" : "1"
        },
        {
             "@id" : "lettres_de_poilus",
             "title" : "Correspondance des poilus",
             "description": "Collection de lettres de poilus entre 1917 et 1918",
             "@type" : "Collection",
             "totalItems" : "10000"
        }
    ]
}
PonteIneptique commented 6 years ago

Somehow it did not work this morning, we still have to fix the dc:title writing, even if I find lang_key:title much better...