Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Define hydra:collection as a supported property on the entry point #49

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
12 changes: 12 additions & 0 deletions src/routes/api-documentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ export default (): AppMiddleware => (
name.addOut(hydra.readable, true);
name.addOut(hydra.writeable, toRdf(false));
});

entryPoint.addOut(hydra.supportedProperty, (collection: Clownface): void => {
collection.addOut(rdf.type, hydra.SupportedProperty);
collection.addOut(hydra.title, literal('Collection', 'en'));
collection.addOut(hydra.property, hydra.collection, (property: Clownface): void => {
property.addOut(rdf.type, rdf.Property);
property.addOut(rdf.type, hydra.Link);
});
collection.addOut(hydra.required, true);
collection.addOut(hydra.readable, true);
collection.addOut(hydra.writeable, toRdf(false));
});
});

graph.addOut(hydra.supportedClass, schema.Article, (article: Clownface): void => {
Expand Down