Closed bgajdero closed 10 months ago
See mapping file to show how to store the knowledge graph.
Design of mapping configuration:
"mappings": {
"@context": {
"dcat": "http://www.w3.org/ns/dcat#",
"skos": "http://www.w3.org/2004/02/skos/core#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"dct": "http://purl.org/dc/terms/",
"foaf": "http://xmlns.com/foaf/0.1/"
},
"@id": "http://data.urbandatacentre.ca/catalogue/{ckanField.id}",
"@type": "http://data.urbandatacentre.ca/catalogue",
"dct:creator": {
"@id": "http://data.urbandatacetre.ca/{generate_uuid()}",
"@type": "foaf:Agent",
"foaf:mbox": "{ckanField.author_email}",
"foaf:name": "{ckanField.author}"
},
"dct:title": {
"@type": "xsd:string",
"@value": "{ckanField.title}"
}
}
The mappings
part follows the JSON-LD Spec. @context
stores the namespaces; @id
specify the URI of an instance'; @type
specify the rdf:type
of the value/instance.
The text in the curly bracket {}
will be evaluated in Python:
mappings
"preload_ontologies": {
// The graph to use: the file to import
"http://id.loc.gov/vocabulary/iso639-1": "http://id.loc.gov/vocabulary/iso639-1.json"
},
single_select
options if it is coming from the KG
{
"name": "language",
"label": "Language",
"type": "single_select",
"optionsFromQuery": {
"text": "label", // The text/label for an option to display in the dropdown
"value": "s", // The actual value of an option
"query": "select * from <http://id.loc.gov/vocabulary/iso639-1> where {?s <http://www.w3.org/2004/02/skos/core#prefLabel> ?label. FILTER (lang(?label) = 'en')}"
}
}
single_select
options from the cache
Save instances of metadata in a knowledge graph.
Knowledge graph schema will be the maturity models.