Yserbius
Yserbius

Reputation: 1414

How can I disable semantic notations in text areas in Semantic MediaWiki Forms?

I am working on a user-moderated database and settled on MediaWiki with Semantic MediaWiki as an engine. I installed Semantic Forms to force the end users to conform to a certain standard when creating or editing entries. The problem is that since a user can add a semantic notation to any form text input it can throw off the proper structure of the system, i.e. if it was an IMDB clone a user can add [[Directed by:Forest Gump]] which would then result in the movie "Forest Gump" showing up under a list of directors.

I doubt that there's any setting that can simply turn this off or on, but I've had one or two ideas as to how to get it working.

One, perhaps there's a way to disable semantic notation on specific namespaces and put the forms on those namespaces. I have a feeling that this will cause the forms to merely break.

Another idea is to modify the code. This is clearly the less ideal approach. To get started, I believe I would need to create some sort of filter on SFTextAreaInput which would disable semantic notations for the user inserted text, but alas I'm unsure as to how to get started on that.

Upvotes: 1

Views: 114

Answers (2)

Wolfgang Fahl
Wolfgang Fahl

Reputation: 15769

My name is Wolfgang Fahl I am behind the smartMediaWiki approach. You might want to go the smartMediaWiki route see

For a start don't go just by the property values but e.g. also by a category.

{{#ask: [[Category:Movie]] [[Directed by::+]]
|?Directed by
}}

will only show pages that have both the property set and are in the correct category.

In the smartMediaWiki approach you'd create a topic "Movie" and the entry of movies would be done via Forms. This is an elaboration of the SemanticForms and semantic PageSchemas idea that recently evolved. You can find out more about this at SMWCon Barcelona 2015 this fall.

Upvotes: 1

JosefAssad
JosefAssad

Reputation: 4128

Well, Semantic MediaWiki is still a Wiki. In your classical enterprise database, you restrict the users' input options as a means of ensuring data integrity. That isn't what wikis do; the thinking with a wiki is, yes, the user can enter incorrect information, but another user will amend it and let the first user know what was wrong.

I wouldn't try to coerce SMW into rigid data acquisition. I mean, you do have options such as removing the standard input fields in forms:

'''Free text:'''

{{{standard input|free text|rows=10}}}

If users are selecting a movie page when they should be selecting a director page, then you probably want to encourage correct selection by populating the form control from the Directors category, like:

{{{field|Director|input type=combobox|values from category=Directors}}}

Yes, they can still go very far out of their way to select "Forrest Gump", but if that happens then the fact that someone wilfully circumvented the preselected correct options is a more pressing concern than the fact that the system permits it.

Wikis work best when the system encourages rather than enforces valid knowledge.

Upvotes: 1

Related Questions