Open opoudjis opened 6 years ago
JSON has already been created for NIST in https://github.com/metanorma/metanorma-nist/issues/121; task is to capture those design decisions in schema.
This isn't "really" complete; keeping this open.
The specific task of generating a JSON schema is not even started.
Are you sure you want JSON-LD? That seems complete overkill, and not really fit for purpose anyway. JSON Schema sounds much more appropriate here.
@opoudjis it's related to another work we're doing. In any case, here's a sample of the Relaton sample (!) provided by CSRC :wink:
{
"language": "en",
"script": "Latn",
"series": "nist-sp",
"docnumber": "1800-1",
"revision": null,
"edition": null,
"uri": "https://csrc.nist.gov/publications/detail/sp/1800-1/final",
"doi": "10.6028/NIST.SP.1800-1",
"title-main": "Securing Electronic Health Records on Mobile Devices",
"title-sub": null,
"iteration": null,
"issued-date": "2018-07",
"updated-date": null,
"published-date": "2018-07-27",
"obsoleted-date": null,
"status": "final",
"substage": "active",
"authors": [
{
"title": null,
"givenName": "Gavin",
"middlename": "W.",
"surname": "O'Brien",
"suffix": null,
"nickname": null,
"affiliation": {
"name": "National Institute of Standards and Technology",
"acronym": "NIST"
},
"fullname": "Gavin W. O'Brien"
},
{
"title": null,
"givenName": "Nate",
"middlename": "V.",
"surname": "Lesser",
"suffix": null,
"nickname": null,
"affiliation": {
"name": "National Institute of Standards and Technology",
"acronym": "NIST"
},
"fullname": "Nate V. Lesser"
},
{
"title": null,
"givenName": "Brett",
"middlename": null,
"surname": "Pleasant",
"suffix": null,
"nickname": null,
"affiliation": {
"name": "The MITRE Corporation",
"acronym": "MITRE"
},
"fullname": "Brett Pleasant"
},
{
"title": null,
"givenName": "Sue",
"middlename": null,
"surname": "Wang",
"suffix": null,
"nickname": null,
"affiliation": {
"name": "The MITRE Corporation",
"acronym": "MITRE"
},
"fullname": "Sue Wang"
},
{
"title": null,
"givenName": "Kangmin",
"middlename": null,
"surname": "Zheng",
"suffix": null,
"nickname": null,
"affiliation": {
"name": "The MITRE Corporation",
"acronym": "MITRE"
},
"fullname": "Kangmin Zheng"
},
{
"title": null,
"givenName": "Colin",
"middlename": null,
"surname": "Bowers",
"suffix": null,
"nickname": null,
"affiliation": {
"name": "Ramparts",
"acronym": null
},
"fullname": "Colin Bowers"
},
{
"title": null,
"givenName": "Kyle",
"middlename": null,
"surname": "Kamke",
"suffix": null,
"nickname": null,
"affiliation": {
"name": "Ramparts",
"acronym": null
},
"fullname": "Kyle Kamke"
}
],
"editors": [
{
"title": null,
"givenName": "Leah",
"middlename": "R.",
"surname": "Kauffman",
"suffix": null,
"nickname": null,
"affiliation": {
"name": "National Institute of Standards and Technology",
"acronym": "NIST"
},
"fullname": "Leah R. Kauffman"
}
],
"supersedes": [],
"superseded-by": [],
"keywords": [
"EHR",
"electronic health records",
"HIPAA",
"mobile device security",
"patient health information",
"PHI",
"risk management",
"standards-based cybersecurity",
"stolen health records"
],
"comment-from": null,
"comment-to": null
}
This is not what I asked them to generate, which means that our developers (because it isn't going to be me) now map this to our structure.
What I had written up is what I am going to write a schema for. It is going to stick close to the XML.
I don't understand where, if anywhere, namespaces come into it. You're going to have to give me a much more explicit specification than this for JSON-LD.
I'm going to provide a sample JSON LD here:
/*
In JSON-LD, the “@id” field indicates where this very object can be retrieved from.
The “@context” indicates the location of the schema.
If an attribute contains a JSON-LD URL, it is most likely a link to the data that resides at that URL.
NOTE: the domain names/URLs here are all fictitious.
*/
/* Personal profile */
{
"@context": "https://commonprofile.org/jsonld/profile/personalProfile",
"@id": "https://nist.gov/directory/harold.booth",
"name": "https://nist.gov/directory/harold.booth/name",
"affiliation": "https://nist.gov/directory/harold.booth/affiliation"
}
/* Personal name */
{
"@context": "https://commonprofile.org/jsonld/profile/personalName",
"@id": "https://nist.gov/directory/harold.booth/name",
"givenNames": [ "Harold" ],
"surname": "Booth",
"generationalName": "III",
"honorifics": [ "Dr." ]
}
/* Affiliations */
{
"@context": "https://commonprofile.org/jsonld/profile/affiliation",
"@id": "https://nist.gov/directory/harold.booth/affiliation",
"roles": [
"https://nist.gov/directory/harold.booth/affiliation/stvm"
]
}
/* Affiliation role */
{
"@context": "https://commonprofile.org/jsonld/profile/affiliationRole",
"@id": "https://nist.gov/directory/harold.booth/affiliation/stvm",
"title": "Computer Scientist",
"organization": "https://nist.gov/groups/stvm"
}
/* Organizations */
{
"@context": "https://commonprofile.org/jsonld/profile/organization",
"@id": "https://nist.gov/groups/stvm",
"name": "Security Testing, Validation and Measurement",
"abbrevName": "STVM",
"parentOrganization": "https://nist.gov/divisions/csd"
}
{
"@context": "https://commonprofile.org/jsonld/profile/organization",
"@id": "https://nist.gov/divisions/csd",
"name": "Computer Security Division",
"abbrevName": "CSD",
"parentOrganization": "https://nist.gov/labs/itl"
}
{
"@context": "https://commonprofile.org/jsonld/profile/organization",
"@id": "https://nist.gov/labs/itl",
"name": "Information Technology Laboratories",
"abbrevName": "ITL",
"parentOrganization": "https://nist.gov/organization"
}
{
"@context": "https://commonprofile.org/jsonld/profile/organization",
"@id": "https://nist.gov/organization",
"name": "National Institute of Standards and Technology",
"abbrevName": "NIST",
"parentOrganization": "https://www.commerce.gov"
}
/* Affiliation display profiles */
/* This is to show the affiliation “NIST” by itself */
{
"@context": "https://commonprofile.org/jsonld/profile/affiliationDisplay",
"@id": "https://nist.gov/jsonld/showNistAffiliation",
"affiliation": "https://nist.gov/directory/harold.booth/affiliation",
"organizations": [
"https://nist.gov/organization"
]
}
/* This is to show the affiliation “Computer Security Division, Information Technology Labs”
as shown on the SP Cover Page.
*/
{
"@context": "https://commonprofile.org/jsonld/profile/affiliationDisplay",
"@id": "https://nist.gov/jsonld/showNistDivisionAffiliation",
"affiliation": "https://nist.gov/directory/harold.booth/affiliation",
"organizations": [
"https://nist.gov/divisions/csd",
"https://nist.gov/labs/itl"
]
}
The review of NIST JSON is a separate ticket: https://github.com/metanorma/relaton-nist/issues/23
This task is underspecified. Again. What is it you actually want here? Do you want just a JSON-LD mapping of each relaton tag to JSON-LD tag? Do you also want them mapped to FOAF and other schema.org elements? How extensive is the typing of this supposed to be?
You haven't told me what this is for, and how it is going to be used; and I don't to maintain on an ongoing basis a second artefact alongside the RNC grammar manually.
I've done a first cut here:
https://github.com/relaton/relaton-models/blob/master/grammars/biblio.jsonld
All it is is an enumeration of all attributes in relaton, saying all of them are strings. It's a lie. But I need to know how much to refine it by.
And JSON-LD is specified by context documents; the documents you've given are not it. They are putting in @id
links assuming Linked Data that just is not going to exist; and they are doing a separate context document for each type, which I will not do, let alone maintain.
We need to discuss this.
This ticket has been unactioned in the past 14 months, it has no real spec or context provided, and hand crafting a separate artefact to maintain alongside the RNC source is simply not going to happen.
I'm demoting to low until I have an actual spec and context for it (the NIST annotated instance of a reference is neither); and I strongly recommend that this be delegated to someone else as a mechanical mapping from biblio.rnc.
No progress. Recusing myself.
@strogonoff this is for your information on implementing Relaton JSON-LD. Finally we have someone working on this!
For the purposes of BibXML service, I have partially implemented BibliographicItem and related interfaces as Pydantic models. While Pydantic doesn’t deal with JSON-LD, it does allow exporting model definition as JSON schema. We can see how well it works…
Any JSON LD should be derived from relaton RNC automatically, given that the schema remains under development.