To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 85316d62 authored by vermeul's avatar vermeul
Browse files

Update README.md

parent 3f263413
......@@ -10,7 +10,9 @@ If you want to annotate text which *cannot be edited after*, there are several a
- co-ment (http://www.co-ment.com) – co-ment is a web service for annotating, discussing and writing texts online
- CATMA (http://catma.de) – for undogmatic textual markup and analysis
## Annotation Syntax
## Annotation
### Annotation Syntax
MediaWiki has the concept of **ParserFunctions** and offers the possibility to implement your own:
......@@ -33,88 +35,8 @@ Annotations come in different flavors:
- `{{#annotend: id}}` End-of-Annotation-Tag. The id must be present if the opening tag has one.
- `{{annotend}}` or `{{#annotend}}` (without the colon) are allowed too.
## Annotation Categories
Annotations can be categorized, but don't have to be. The categories themselves are organized hierarchically.
If a category has no parent category, it is a top category. If a category has no child category, it is called a leaf.
If a category has both a parent and a child category, it is called a node.
Categories themselves don't have to be unique. In the example below, the category `examples` is not unique, one
belongs to its parent `written addition` and the other to `written subtraction`:
```
/addition
/written addition
/examples
/subtraction
/written subtraction
/examples
```
So if we want to annotate a written subtraction example, we simply write:
```
{{#annot: my comment | written subtraction/examples}}
```
Note: **the combination of parent_category/child_category must be unique**
### list categories
Put this on any WikiPage and it will list existing categories:
```
{{#annotcat: list}} # lists all categories (might be a long list!)
{{#annotcat: list | top_category_name}} # list a certain top category and all categories «below»
{{#annotcat: list | parent_name/category_name}} # start list with node parent_category/category
```
### list existing categories
```
{{#annotcat: list }}
{{#annotcat: list | top_cat }} #
{{#annotcat: list | parent_cat/child_cat }}
```
### add a new category
To add a new category into the categories table, we simply add one of the following anywhere in a Wiki Page:
```
{{#annotcat: add | name='new top category', description='some meaningful comments', parent='grandparent_category/parent_category' }}
{{#annotcat: add | name='new top category', description='some meaningful comments', parent='parent_category' }} # add to an existing top category
```
Only the name argument is mandatory, everything else is optional. If you don't specify a parent category, a new top category will be created.
### update an existing category
To update a category, add something like this to any Wiki Page:
```
# update everything
{{#annotcat: up | kat_parent/kat_child | name='new category name', description='new description', parent='grandparent_category/parent_category' }}
# make a category becoming a top category
{{#annotcat: up | kat_parent/kat_child | parent=}}
# remove description
{{#annotcat: up | kat_parent/kat_child | description=}}
```
If you do not want to update certain fields, just omit them. If you want to remove the parent or deleting the description, just leave the value empty.
### delete an existing category
To delete a category, add this to any Wiki Page:
```
{{#annotcat: del | parent_cat_name/cat_name }}
{{#annotcat: del | cat_name }} # if the category is a top category (no parent)
```
It will delete the category from the database. Annotations will still be there, but no longer assigned to a category.
If this category was a parent- or child-category, then this connection will break and you might not receive the same
results as before when searching for annotations. Therefore: be careful!
## Nested or overlapping annotations: Examples
### Nested or overlapping annotations: Examples
The vertical bars are used to supply a number of different arguments. Because annotations can be even nested or overlapping,
we need to add an identifier to be sure the start and endings are connected together correctly. For example:
......@@ -138,7 +60,7 @@ while annotation (b) will contain this part of the WikiText:
comments, which means we need
```
## display all annotations of a given page
### display all annotations of a given page
To display all annotations on a page, just add
......@@ -150,7 +72,7 @@ while annotation (b) will contain this part of the WikiText:
The output will be a sortable Wikitable which contains comment, category and
the extracted text.
# How to query annotations
## Querying annotations
To get specific annotations we are interested in, we need a small query language
which allow us to find a text passage in a page anywhere in the Wiki. Our goal is
......@@ -158,7 +80,7 @@ to define the query language similar to the Semantic Media Wiki query language {
See the [SMW concepts](https://www.semantic-mediawiki.org/wiki/Help:Concepts)
## annotask Query syntax
### annotask Query syntax
```
[[category: category_name1 ]] # this category (and all categories below it)
[[category: category_name1, category_name2 ]] # category_name1 OR category_name2
......@@ -176,7 +98,7 @@ See the [SMW concepts](https://www.semantic-mediawiki.org/wiki/Help:Concepts)
_ match any single character
```
## Query example
### Annotation query example
```
{{#annotask:
......@@ -193,11 +115,92 @@ Find all annotations
* and contain `this is somewhere in my text` in the extracted annotation
## annotask: Query result
### annotask: Query result
The result is a sortable table containing the following data:
```Category | Comment | Link | Annotated Text | Last edited by | Modification date```
Because Pages can be long, the link contains an anchor (bookmark) and thus the result will appear immediately at the top of the page.
To achieve this, all annotations automatically get a bookmark generated which will result in a unique `id` within that page.
\ No newline at end of file
To achieve this, all annotations automatically get a bookmark generated which will result in a unique `id` within that page.
## Annotation Categories
Annotations can be categorized, but don't have to be. The categories themselves are organized hierarchically.
If a category has no parent category, it is a top category. If a category has no child category, it is called a leaf.
If a category has both a parent and a child category, it is called a node.
Categories themselves don't have to be unique. In the example below, the category `examples` is not unique, one
belongs to its parent `written addition` and the other to `written subtraction`:
```
/addition
/written addition
/examples
/subtraction
/written subtraction
/examples
```
So if we want to annotate a written subtraction example, we simply write:
```
{{#annot: my comment | written subtraction/examples}}
```
Note: **the combination of parent_category/child_category must be unique**
### list categories
Put this on any WikiPage and it will list existing categories:
```
{{#annotcat: list}} # lists all categories (might be a long list!)
{{#annotcat: list | top_category_name}} # list a certain top category and all categories «below»
{{#annotcat: list | parent_name/category_name}} # start list with node parent_category/category
```
### list existing categories
```
{{#annotcat: list }}
{{#annotcat: list | top_cat }} #
{{#annotcat: list | parent_cat/child_cat }}
```
### add a new category
To add a new category into the categories table, we simply add one of the following anywhere in a Wiki Page:
```
{{#annotcat: add | name='new top category', description='some meaningful comments', parent='grandparent_category/parent_category' }}
{{#annotcat: add | name='new top category', description='some meaningful comments', parent='parent_category' }} # add to an existing top category
```
Only the name argument is mandatory, everything else is optional. If you don't specify a parent category, a new top category will be created.
### update an existing category
To update a category, add something like this to any Wiki Page:
```
# update everything
{{#annotcat: up | kat_parent/kat_child | name='new category name', description='new description', parent='grandparent_category/parent_category' }}
# make a category becoming a top category
{{#annotcat: up | kat_parent/kat_child | parent=}}
# remove description
{{#annotcat: up | kat_parent/kat_child | description=}}
```
If you do not want to update certain fields, just omit them. If you want to remove the parent or deleting the description, just leave the value empty.
### delete an existing category
To delete a category, add this to any Wiki Page:
```
{{#annotcat: del | parent_cat_name/cat_name }}
{{#annotcat: del | cat_name }} # if the category is a top category (no parent)
```
It will delete the category from the database. Annotations will still be there, but no longer assigned to a category.
If this category was a parent- or child-category, then this connection will break and you might not receive the same
results as before when searching for annotations. Therefore: be careful!
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