Create JSONLD files - OregonDigital/opaque_ns GitHub Wiki

Creating JSONLD Files

Opaque Namespace

  • If terms (objects) belong to a specific controlled vocabulary, create a .jsonld file for that set
  • If terms (properties) belong to a specific schema, extend URI with schema before term (e.g. 'cco')
  • Make sure you know JSONLD syntax, RDF schema, and SKOS before proceeding
  • Start file with {
  • Define prefixes for compact URLs (Example)
"@context": {
	"title": "http://purl.org/dc/terms/title",
	"label": "http://www.w3.org/2000/01/rdf-schema#label",
	"comment": "http://www.w3.org/2000/01/rdf-schema#comment",
	"description": "http://purl.org/dc/terms/description",
       ....
},
  • Write graph (Example)
"@graph": [
	{
	    "@id": "http://opaquenamespace.org/ns/cco/viewDescription",
	    "@type": "Property",
	    "definedBy": {
		"@id": "http://opaquenamespace.org/VOCAB_PLACEHOLDER.nt"
	    },
	    "issued": {
		"@value": "2014-02-25",
		"@type": "date"
	    },
	    "label": "View Description",
	    "comment": "Describes the spatial, chronological or contextual aspect of teh work as captures in the image view.",
	    "modified": {
		"@value": "2014-02-25",
		"@type": "date"
	    }
	},
]
  • Close end of file with }
  • Use Oregon Digital Git best practices and make changes / additions on a branch, commit with helpful commit message, then push for merge
  • Validate JSON before commit