Initially a Topincs store is empty. We first need to model one or more topic types in order to see something in the index and start recording information. Nothing in this chapter requires any coding skills, but it lays the foundation for your system by specifying the schema with forms. All you need is a good understanding of Topic Graphs and the generic work flows in Topincs. But before we continue, a short introduction to how an administrator works in Topincs.
Hint: Topincs never opens a new browser window or tab. You know best when you want to do that!
For modeling you need to sign in as an administrator. After this you will notice the admin mode status to the lower left. By moving your mouse pointer over this the admin menu becomes visible. It is the starting point of any development activity in your Topincs store. If you are not able to find it, make sure your screen and the browser window are wide enough. By default the admin mode status is hidden in the layout modes fpr handheld devices – small and tiny. There you cannot perform any admin functions.
The first two entries Topic types and Services are used most frequently. They link to the index pages of these two central schematic topic types. The next entries link to specialized index pages for all schematic topics that define the online database. Since it is all connected there is multiple ways to find anything. In various sub menus there is plenty to explore. In Documentation you find links to this manual and to the reference, the primary sources of information about Topincs.
You also notice a switch to turn on admin mode. In admin mode all schematic page elements are highlighted and react to right-click with the context menu for viewing, editing, or deleting the relevant topics. The keystroke Alt+Shift+A toggles the admin mode as well.
Hint: Generally you should follow your train of thoughts when modeling. Linearity plays a minor role. Any error can be quickly corrected.
Defining a topic type requires you to name it and create one or more constraints. These correspond to input fields in the form. When modeling a topic type you will need to create new statement types. There is no need to create them before hand, you can create all necessary topics along the way by entering sub forms.
For the Santa Claus system our main topic types are year, gift, country, and wish. They all need a name and any wish will have several attributes. We will model the topic type wish last to make the demonstration clearer. We will start with Country and Gift in the video below.
Check it out
Hint: Use an asterisk * for maximum cardinality to allow an any number of statements.
Topic attribute constraints help you bring more life into your form and into your schema. An attribute belongs to one topic only, has a type, a value and a datatype. Names are simplified versions of attributes, they do not have a datatype, that is why we do not treat them separately. We have already seen in the video above how they are modeled.
Hint: Learn in depth how to to handle date and time information in Topincs.
The schematic information on attributes is distributed over several topics of these types:
By using a regular expression you can easily make sure that strings follow a certain form, e.g. an email address or a zip code. Since this approach is limited to one form field, there is a more sophisticated methods to ensure user input adheres to rules. There is complete section on form validation, explaining how to use tiny JavaScript code fragments to validate input, even across several fields.
A value space constraint can be used to restrict the value space of an attribute type. The supported datatypes will appear formatted in the select box.
Hint: It often makes sense to use topic types as role types! You can reuse role types in different association types.
An association is like a hyperlink between two topics. But it has a type and is named differently depending on the perspective. Creating an association type is more difficult, but you will quickly get the hang of it.
Any wish instance will need to have exactly three associations. The next video demonstrates how to model two associations types. From the perspective of the wish, all associations are mandatory, meaning minimum cardinality is 1. From the perspective of gift and country, they may or may not be associated with a wish. They are independent that is why we could already create them. They also may be associated with any number of wishes. In this case maximum cardinality is set to the asterisk * . By default Topincs creates an association type optional (0) and unlimited (*) in both directions. You need to adjust these defaults so that your requirements are met.
Check it out
To easily integrate files into your model, you need to define a file topic type. This is just an ordinary topic type which subtypes the predefined topic type Topincs file. The filing constraint helps us to restrict which files types, e.g. only PDFs. In addition you can specify that images are downscaled before uploading.
When a filing constraint is present at a topic type, the form for a new instance requires file to upload. It will be stored in Topincs and published at an URL. This URL will be the subject locator of the instance edited. It is required to make this topic type a subtype of Topincs file. The file upload field only appears when creating new instances since the connection between the topic and the file cannot be changed. A different file is a different topic. If you should upload the same file twice you will notice that Topincs recognizes the file and avoids to create a new topic but rather attaches all additional statements made to the existing topic which already represents this file.
The filing constraint takes any number of file extensions and media types. The file extensions will be used client side to restrict the files that can be selected in the file selection dialog, if the web browser supports this. The media types will be used server-side to deny the storage of files that do not match the media type. File extension and media type are optional.
The children making a wish should be able to upload a foto, if they want to. So we create a topic type photo, make it a subtype of Topincs file, and create a filing constraint. By default Topincs opens a sub form, in case other information is necessary. Not in our case, so we use simple file selection, which skips the sub form and goes right to the file selection dialog.
Check it out
Images and videos are supported in Topincs. They are embedded in factsheet and form. This manual uses both types. The video above is a Topincs file. In this manual all paragraphs, images, videos, headlines, code examples, etc. are in fact topics.
Hint: In theory a topic type can have multiple super types and even statement types can form hierarchies, but the behavior of Topincs is unknown for such cases.
We declare a topic type abstract by using the corresponding checkbox in the form. Abstract topic types cannot be instantiated. As usual its constraints will be inherited to all sub types. Topic role constraints can use abstract topic types for simple extensibility.
This page cannot be displayed in your browser. Use Firefox, Opera, Safari, or Chrome instead.
Saving …