Skip to content

Commit

Permalink
add DELETE /properoty/:iri
Browse files Browse the repository at this point in the history
  • Loading branch information
na57 committed May 30, 2024
1 parent c8025f3 commit 8c6d327
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/rdf/property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import express from 'express';
import { Factory, RDF } from 'nagu-owl';
import { Factory, RDF, RdfProperty } from 'nagu-owl';
import { options } from '../utils.ts';
import { setAnnotations } from './resource.ts';

Expand All @@ -22,6 +22,14 @@ const getOrCreateProperty = async (req ,res) => {
});
}

const destoryProperty = async (req, res) => {
const cls = res.resource as RdfProperty;
await cls.destroy();
res.json({
ret: 0,
});
}

/**
* 添加Property
*/
Expand All @@ -30,4 +38,9 @@ router.put('/:iri', getOrCreateProperty, setAnnotations);
* 修改Property
*/
router.post('/:iri', getOrCreateProperty, setAnnotations);

/**
* 删除属性
*/
router.delete('/:iri', getOrCreateProperty, destoryProperty);
export default router;

0 comments on commit 8c6d327

Please sign in to comment.