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 985e4799 authored by vermeul's avatar vermeul
Browse files

Merge branch 'master' of https://gitlab.ethz.ch/vermeul/YATA

parents c98bcbfb 6715689b
......@@ -2,7 +2,13 @@
YATA is a text annotation plugin for MediaWiki. It allows to annotate text passages with comments.
Each annotation can belong to a category. And categories can be organized in a hierarchical way.
In addition, annotations might be either nested or overlapping.
In addition, annotations might be either nested or overlapping. Because annotations become part of
the text, the text itself can be edited anytime, unlike most alternatives (see below).
If you want to annotate text which *cannot be edited after*, there are several alternatives:
- GATE (https://gate.ac.uk) – open source software capable of solving almost any text processing problem
- 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
......@@ -33,7 +39,7 @@ Annotations can be categorized, but don't have to be. The categories themselves
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 sutraction`:
belongs to its parent `written addition` and the other to `written subtraction`:
```
/addition
......@@ -108,52 +114,54 @@ 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.
# query annotations
# How to query 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
to define the query language similar to the Semantic Media Wiki query language {{#ask:}}.
See the [SMW concepts](https://www.semantic-mediawiki.org/wiki/Help:Concepts)
**Example**: find all annotations
- with category `kat_parent1/kat_child1`
- but not `kat_parent2/kat_child2`
- comment contains either «comment1» or «comment2»
- wiki_text contains the word «bla»
## annotask Query syntax
```
[[category: category_name1 ]] # this category (and all categories below it)
[[category: category_name1, category_name2 ]] # category_name1 OR category_name2
[[category: category_name1 ]] # every line is AND'ed, so these two lines mean:
[[category: category_name2 ]] # category_name1 AND category_name2
[[category!: category_name1 ]] # category is NOT category_name1
[[wiki_text: %anything%* ]] # wikitext LIKE %anything%
[[wiki_text: %anyth_ng%* ]] # Underscore matches single characters
[[wiki_text!: %anything% ]] # wikitext NOT LIKE %anything%
! "not" ("unequal")
% match any number of characters
_ match any single character
```
## Query example
```
{{#annotask:
[[category:kat_parent1/kat_child1]]
[[category!:kat_parent2/kat_child2]]
[[comment:comment1, comment2]]
[[wiki_text~:*bla*]]
[[category: parent_category1/child_category1 ]]
[[category!: parent_category2/child_category2 ]]
[[comment: %a part of my comment% ]]
[[wiki_text: %this is somewhere in my text%]]
}}
```
Find all annotations
* which belong to category `category parent_category1/child_category1`
* but not to category `parent_category2/child_category2`
* and contain the comment `a part of my comment`
* and contain `this is somewhere in my text` in the extracted annotation
The result should be a sortable table containing the following data:
```link to page and section | comment | category | wiki_text```
## annotask: Query result
**Problem**: how to provide a deep link, not just to the page but to the right paragraph which was annotated.
The result is a sortable table containing the following data:
**Possible Solutions**:
- Maybe search for the text?
- Can we add a unique ID to the function hook? Difficult.
- We now start_char and end_char in the source. Maybe we can add a marker at the given spots?
- we should always include the next previous title to the annotation. We then could use this title to add an anchor to the URL and thus be redirected to the right paragraph.
```Category | Comment | Link | Annotated Text | Last edited by | Modification date```
```
[[category:kat_parent1/kat_child1]] # this and all categories below
[[category:kat_parent1/kat_child1 || kat_parent2/kat_child2]] # OR
[[category:kat_parent1/kat_child1 && kat_parent2/kat_child2]] # AND
[[category!:kat_parent1/kat_child1 ]] # category is NOT kat_parent1/kat_child1
[[wikitext~*anything*]] # wikitext LIKE %anything%
[[wikitext!~*anything*]] # wikitext NOT LIKE %anything%
> and <: "greater than" and "less than"
≥ and ≤: "greater than or equal" and "less than or equal"
!: "not" ("unequal")
~: «like» comparison for strings
!~: «not like» comparison for strings
?: match any single character
```
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
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