User:Wingoli/sandbox

Semantic Text Annotator is an extension for Semantic MediaWiki developed within the research project SMW-CorA and funded by the DFG that allows you to add customized semantic annotations to articles in your wiki. It requires SemanticForms and Semantic MediaWiki to work.

'''The extension is not recommended for development use only! '''

Download
*** BEGIN ************

You can download the extension directly from the MediaWiki source code repository. You can get:

*** END ************
 * One of the extensions tags (click the tag number and then "snapshot"). Tags tend to be stable.
 * A snapshot of the latest code. This might be unstable.

After you've got the code, save it into the extensions/SemanticImageAnnotator directory of your wiki.

*** BEGIN ************

If you are familiar with git and have shell access to your server, you can obtain the extension, with all its tags and branches, as follows: cd extensions git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticImageAnnotator.git *** END ************

Installation
*** BEGIN ************
 * 1) The downloaded file will contain a folder called something like SemanticTextAnnotator-master-80755c2. Rename it to SemanticImageAnnotator and put it into your wikis extension (/wiki/extensions/) folder.
 * 2) Include the following line in your LocalSettings.php :

*** END ************

Setup
After the installation, you have to visit the page "Special:SemanticTextAnnotator". This will automatically create all templates and forms the extension works with.

create a Template and a Form to work with Semantic Image Annotator. The form has to have the name Form:ImageAnnotation and it is good practice to call the corresponding Template the same. More information on using Semantic Forms can be found on it's extension page. A good starting point is the Quick start guide.

Usage
This is a brief introduction on how to use the Semantic Text Annotator.

Creating annotations
After Successful installation, you have to put all pages that you want to annotate in the category "STA_Annotatable" by adding the following text to the source code of the article:

Once you visit pages of the category "STA_Annotatable", the two buttons New Annotation and View Annotations will appear next to the text "Semantic Text Annotator".

Clicking on the button New Annotation will start the "annotation mode". You can now select a passage in the text with your mouse like in the picture below. A pop-up message will appear when you release the mouse button, where you can confirm your selection or abort the process.

++++++++BILD von markiertem text++++++++++

If you confirmed your selection a Semantic Forms popup window will appear. In this window, you can specify the details of your annotation. By default there are two fields you can put text in to annotate the selected passage. After clicking on the "Save"-button you will automatically switch the to the "annotation view" where all annotations are displayed.

Displaying annotations
To display annotations that you have created, click on the Button View Annotations. Every annotation is represented by a horizontal line on the left side of the article's text. You can view the information which belong to an annotation by moving your mouse cursor over the respective horizontal line.

++++++++großer Screenshot++++++++++

Query annotations
the Semantic MediaWiki ask parser functions with the result format imageannotation. If you want to display every annotation for a particular image, you can query for the special property SIAannotatedImage, giving the file name as its value. So for example if you have an image called Spieler.png, your query would look like this:

If you have created a form/template that stores additional properties for the annotations, you can also simply query for these properties. If your query returns annotations for multiple images, they are all displayed (see Planned features). You can also specify the parameter width= and give an integer number to scale the images width to this size (in pixels):

How it works
Semantic Text Annotator defines a custom namespace for annotations (TextAnnotation:). Each annotation is stored as a unique page in this namespace. Semantic Text Annotator also defines a few custom properties that are added to an image annotation page that are necessary to correctly store and retrieve annotations:
 * SIAannotatedImage
 * The name of the image file that this annotation belongs to.


 * SIArectangleCoordinates
 * The coordinates, relative to the image dimension, at which the annotation is drawn.


 * SIAimageURL
 * The url (relative to the wiki) at which the annotated image is stored.


 * SIAcreatedBy
 * The user that created the annotation.

Future development
The Semantic Text Annotator is still under heavy development. Feedback, bug reports and feature requests are therefore very welcome!

Upcoming features
These are features that are at the top of the priority list and will be implemented shortly:
 * 1) Configurable Namespace Number for the ImageAnnotation Namespace
 * 2) Different handling for queries that return annotations for multiple images

Planned features
These features are planned already and will be implemented in the near future:
 * 1) Modifying annotation shapes
 * 2) Dragging annotations to a different position
 * 3) Resizing annotations
 * 4) Add different shapes, e.g. circles and custom shapes
 * 5) Define custom colors for annotation shapes

Known issues
=Credits=

The Semantic Text Annotator is based on the extension "Semantic Image Annotator" of Felix Obenauer, which provides similiar functionality for image files.