Extensible property graph database stored in JSON-LD.
GraphletDB manages a JSON-LD file typed as a Dublin Core DCMI Dataset. The dataset contains the following top-level objects:
{
@context: {},
@id: "",
@type: "dc:Dataset",
creator: {},
distribution: {},
radioOption: {},
templates: {},
@graph: {}
}
@context
In JSON-LD, @context provides links to a precise definition for each property used in the dataset.
GraphletDB's dataset provides two contexts:
"@context": {
"gdb": "http://www.graphletdb.com/props/",
"dc": "http://purl.org/dc/terms/"
}
We use contexts to clarify the meaning of a property's name. In this example, it's nor clear without context what "date" means:
{
"name": "Ancient Vase",
"date": "500-300 BC"
}
We can be more clear by defining our terms.
{
"@context": {
"name": "http://schema.org/name",
"creationDate": "http://schema.org/dateCreated"
},
"name": "Ancient Vase",
"creationDate": "500-300 BC"
}
@id
This id is a unique identifier, usually a resource link, which allows this specific dataset to be referenced directly from anywhere on the internet.
"@id": "http://graphletdb.com/dataset/dataset.json",
@type
The type of the object, in this case “Dataset”, as defined in the Dublin Core context.
"@type": "dc:Dataset",
creator
This object contains information about the responsible individual or organization, including contact information.
"creator": {
"@type": "Organization",
"url": "https://www.whimsicalwidgetry.org/",
"name": "Whimsical Widgetry",
"contactPoint": {
"@type": "ContactPoint",
"contactType": "office",
"telephone": "(555) 246-1357",
"email": "info@whimsicalwidgetry.org"
}
}
distribution
This object contains the direct link to the dataset itself, along with the format and release date in YYYYMMDDHHmm format.
"distribution": {
"@type": "DataDownload",
"encodingFormat": "JSON",
"contentUrl": "https://www.whimsicalwidgetry.org/db.json",
"dateReleased": "202402270831"
}
radioOption
GraphletDB provides an object in which to store sets of radio options within the dataset.
The following example comes from the Archively museum collections app, which has Keyword nodes that require a type, as well as Item nodes that have a privacy status.
"radioOption": {
"KeywordType": [
"Topic",
"Person",
"Group",
"Place",
"Date",
"Medium",
"Event",
"Type"
],
"PrivacyStatus": [
"Public",
"Private",
"Confidential",
"Unassessed"
],
}
templates
This object contains, at minimum, the following two required TypeCollection and CoreTemplateObject template objects:
"templates": {
"gdb:TypeCollection": {
"@type": "gdb:TypeCollection",
"gdb:typeName": "",
"gdb:entries": []
},
"gdb:CoreTemplateObject": {
"gdb:@date": [
""
],
"gdb:@id": "",
"@type": "gdb:CoreTemplateObject",
"gdb:@text": "",
"gdb:rel__nodes": []
}
}
@graph
This object is a dictionary of TypeCollection objects indexed by the @type of node collected.
This is the actual data carried in the dataset. These are nodes which have varying lists of properties based on their @type.
"@graph": {
"dc:Person": {
"@type": "gdb:TypeCollection",
"gdb:typeName": "Person",
"gdb:entries": [
{
"gdb:@date": [
"202402010658jenner"
],
"gdb:@id": "e95bc8c502",
"@type": "Person",
"gdb:@text": "John Random",
"str__firstName": "John",
"str__lastName": "Random",
"rel__worksCreated": [
"c2092618aa3840"
],
"gdb:rel__nodes": []
}
]
},
"dc:Book": {
"@type": "gdb:TypeCollection",
"gdb:typeName": "Book",
"gdb:entries": [
{
"gdb:@date": [
"2023081102301jenner"
],
"gdb:@id": "c2092618aa3840",
"gdb:@text": "The Wandering Wizard",
"@type": "Book",
"str__title": "The Wandering Wizard",
"int__copiesSold": 4,
"bool__awarded": false,
"rel__writtenBy": [
"e95bc8c502"
],
"gdb:rel__nodes": []
}
]
}
}