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

Update README.md

parent 2aeb9fa8
......@@ -114,18 +114,31 @@ 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
```
```
{{#annotask:
......@@ -136,30 +149,9 @@ See the [SMW concepts](https://www.semantic-mediawiki.org/wiki/Help:Concepts)
}}
```
The result should be a sortable table containing the following data:
## annotask: Query result
The result is a sortable table containing the following data:
```link to page and section | comment | category | wiki_text```
```Category | Comment | Link | Annotated Text | Last edited by | Modification date```
**Problem**: how to provide a deep link, not just to the page but to the right paragraph which was annotated.
**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: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
\ 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