diff --git a/domains/disinformation/crud-actions/README.md b/domains/disinformation/crud-actions/README.md new file mode 100644 index 00000000..c10aaf77 --- /dev/null +++ b/domains/disinformation/crud-actions/README.md @@ -0,0 +1,29 @@ +# CRUD Actions + +## Description + +Most basic Web interfaces follow the Create/Replace/Update/Delete pattern to manipulate resources. A forum, for instance, may expose actions to create or edit (replace) a post, to create a response to a post or even to create or delete a new discussion space dedicated to a particular topic. + +## Competency Questions + +| ID | Question in natural language | Example of answer | +|---|---|---| +| q1_1 | What request to send to post a message? | POST /topics/random/posts | +| q1_2 | What request to send to respond to a post? | POST /topics/random/posts/123/answers | +| q2 | What request to send to edit a post? | PUT /topics/random/posts/123 | +| q3 | What request to send to delete a peviously posted message? | DELETE /topics/random/posts/123 | +| q4 | What request to send to add a user to some forum? | POST /topics/random | + +Editing a post may either be executed as a single update operation, as a replace operation or as a sequence of delete and create operations. In case the three options have different side effects, an agent should be informed of the side effects of each action. + +## Glossary + +* [**CreateAction**](https://purl.org/hmas/CreateAction): Action to create a new resource. +* [**ReplaceAction**](https://purl.org/hmas/ReplaceAction): Action to replace an existing resource. +* [**UpdateAction**](https://purl.org/hmas/UpdateAction): Action to update the representation of an existing resource by adding statements to it. +* [**DeleteAction**](https://purl.org/hmas/DeleteAction): Action to delete an existing resource. + +### Recommendations + +- On-going actions can be described as temporal entities with the [PROV-O](https://www.w3.org/TR/prov-o/) and [OWL Time](https://www.w3.org/TR/owl-time/) ontologies. Action specification can be given as SHACL shapes on `prov:Activity` instances. +- [DublinCore terms](http://purl.org/dc/terms/) can capture the fact that a resource has a new version after every action. diff --git a/domains/disinformation/crud-actions/dataset.ttl b/domains/disinformation/crud-actions/dataset.ttl new file mode 100644 index 00000000..914114eb --- /dev/null +++ b/domains/disinformation/crud-actions/dataset.ttl @@ -0,0 +1,43 @@ +@prefix : . +@prefix ex: . +@prefix owl: . +@prefix rdfs: . +@prefix time: . +@prefix prov: . +@prefix dct: . +@prefix sioc: . +@prefix sh: . + +ex:CreatePostAction + a sh:NodeShape, owl:Class ; + rdfs:subClassof :CreateAction ; + sh:property [ + sh:path [ sh:inversePath prov:wasGeneratedBy ] ; + sh:class sioc:Post + ] . + +ex:CreateAnswerAction + a sh:NodeShape, owl:Class ; + rdfs:subClassof :CreateAction ; + sh:property [ + sh:path [ sh:inversePath prov:wasGeneratedBy ] ; + sh:and ( + [ + sh:classs sioc:Post + ] + [ + sh:property [ + sh:path [ sh:inversePath sioc:has_reply ] ; + sh:minCount 1 + ] + ] + ) + ] . + +ex:DeleteForumAction + a sh:NodeShape, owl:Class ; + rdfs:subClassof :DeleteAction ; + sh:property [ + sh:path prov:used ; + sh:class sioc:Forum + ] . diff --git a/domains/disinformation/crud-actions/onto.ttl b/domains/disinformation/crud-actions/onto.ttl new file mode 100644 index 00000000..89fb95ac --- /dev/null +++ b/domains/disinformation/crud-actions/onto.ttl @@ -0,0 +1,56 @@ +@prefix : . +@prefix owl: . +@prefix rdfs: . +@prefix time: . +@prefix prov: . +@prefix dct: . +@prefix sioc: . +@prefix sh: . + +:interaction a owl:Ontology . + +# TODO should prov:used statements be specialized to better capture actions? + +:CreateAction + a sh:NodeShape, owl:Class ; + sh:property [ + sh:path [ sh:inversePath prov:wasGeneratedBy ] ; + sh:node [ + sh:property [ + sh:path [ sh:inversePath dct:isReplacedBy ] ; + sh:maxCount 0 + ] + ] + ] ; + rdfs:isDefinedBy :interaction . + +:ReplaceAction + a sh:NodeShape, owl:Class ; + sh:property [ + sh:path ( [ sh:inversePath prov:wasGeneratedBy ] dct:isReplacedBy ) ; + sh:equals prov:used + ] ; + rdfs:isDefinedBy :interaction . + +# TODO UpdateAction (to POST new triples to an existing resource) + +:DeleteAction + a sh:NodeShape, owl:Class ; + sh:property [ + sh:path prov:used ; + sh:node [ + sh:property [ + sh:path dct:isReplacedBy ; + sh:maxCount 0 + ] + ] + ] ; + rdfs:isDefinedBy :interaction . + +:initiated + a owl:ObjectProperty ; + rdfs:comment "The form submitted to a server initiates activity (performed on the server) that transforms resources" ; + rdfs:domain hctl:Form ; + rdfs:range prov:Activity . + +# TODO improve relationship between signifiers/forms and actions \ No newline at end of file