Extension:VisualData/Edit data

From mediawiki.org

Edit data[edit]

Through the "Edit data" tab is possible to assign dynamically one or more pre-defined schemas (i.e. schemas previously created through the Schema Builder) to a wiki article. The schemas data will be registered in a dedicated slot with json content-model alongside the page and it is possible to perform CRUD operation through the form.



This is the dialog allowing to add/remove schemas to the wiki article:


This is how appears a schema after is assigned to the article:


Entered data are validated (based on the defined schema) using ajv-validator and after being inserted can be queried using VisualData's queries, or accessed through the standard Mediawiki Api, with a request like the following:

https://wikisphere.org/w/api.php?action=query&format=json&prop=revisions&list=&meta=&titles=Demo_VisualData&formatversion=2&rvprop=ids%7Ctimestamp%7Cflags%7Ccomment%7Cuser%7Ccontent&rvslots=jsondata


clik here for the ApiSandbox


A straightforward and effective way to query data associated to an article is to print an infobox using the following parser function:

(this is what happens when you have more than 1 name and stick to using an acronym)

Here is the related wikitext/parser function:

{{#visualdataprint: {{FULLPAGENAME}}
|?cover
|?title
|?authors/name
|?authors/email
|schema=Book
|template=Book
|template?authors=Book authors
|format=template
}}


(see here for more information)


See also[edit]