Commit 56ce3792 authored by Élodie Thiéblin's avatar Élodie Thiéblin
Browse files

[DublinCore] Put dc rdfmeta schema in separated file

parent f0b4207bb31f
import { rdfMeta, application } from "@logilab/libview";
import { ONTOLOGY } from "../common/schema";
/**
* The data for DublinCore Elements metadata
*/
export interface DublinCoreElement extends rdfMeta.Loadable {
title: string;
description: string;
creator: string;
date: string;
}
/**
* The metaclass for DublinCore Element
*/
const DCE_METACLASS = new rdfMeta.MetaClass();
DCE_METACLASS.properties = [
new rdfMeta.MetaPropertyData(
"title",
"http://purl.org/dc/elements/1.1/title"
),
new rdfMeta.MetaPropertyData(
"description",
"http://purl.org/dc/elements/1.1/description"
),
new rdfMeta.MetaPropertyData(
"creator",
"http://purl.org/dc/elements/1.1/creator"
),
new rdfMeta.MetaPropertyData("date", "http://purl.org/dc/elements/1.1/date")
];
/**
* Loads the data for the entity of interest
* @param renderer The current renderer
* @param context The current rendering context
* @param target The current RDF entity to be rendered
*/
export function loadDublinCoreElement(
renderer: application.ViewRenderer,
context: application.RenderingContext,
target: application.Resource
): DublinCoreElement {
return rdfMeta.loadEntity(renderer, context, ONTOLOGY, DCE_METACLASS, target);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment