Objective


Aiming at an easy generation of virtual Learning Spaces for the use of the person in charge of institutional archives or museums, an external Domain-Specific Language was idealized and developed, called CaVaDSL, to describe, in an abstract level, virtual exhibition rooms in the museum Curator's perspective, giving the Curator the possibility to specify the virtual LS upon a domain ontology vocabulary.

So CaVaDSL was created in order to foster the Cultural Heritage Curator to specify a virtual Learning Space, letting the CaVa System conduct the automatic creation of LS.

CaVaDSL focuses on the exhibition rooms, so the main component of the language is a list of exhibitions.


Documentation


Main Configuration


Defines the virtual Learning Space title and main description, as well as, other components related to the entire Learning Space (not only about a specific page, like an exhibition room, for example). It is specified by the following derivation rule of CaVagrammar:

mainConfig: ‘mainconfig’ ‘[’ learningSpaceTitle learningSpaceAbout? learningSpaceCarousel? ‘]’ ;

Example:

mainconfig [ LS Title: "Learning Space Title", about [ p: "something about the LS in a paragraph...", p: "something more about the LS in second a paragraph...", ] carousel [ interval: 5, images [ caption: "caption of the first image", src: "source of the first image file (path)", active, caption: "caption of the second image", src: "source of the second image file (path)", ] ] ]

The example specification above describes the title and two paragraphs about the virtual LS that will be designed in the entrance room (the website homepage). Additionally, a carousel of images was defined. This carousel, in addition to the caption and source of each image, also sets a time interval (in seconds, in this case, the value 5) for the transition between each of them. The "active" value defines the initial image in the carousel when the main page of the virtual LS is loaded.

Attributes:
All the parameters are mandatory, except that marked with the Optional tag.
Attribute name Data type / Keyword Description
LS Title String The title of the Learning Space.
Optional about Array An array of paragraphs.
about > p String A paragraph. It accepts how many paragraphs you want!
Optional carousel Array An array to configure a carousel of images. Each carousel must contain an interval and an array of images.
carousel > interval Integer A time (in seconds) interval to the transition of the carousel of images.
carousel > images Array An array of images. Each element must contain a caption and a source (src). At least one caption and source must be specified.
carousel > images > caption String A caption for the image.
carousel > images > src String A path of the image file.
Optional carousel > images > active Keyword A parameter to mark the active image to start the transition of the carousel of images.

Header


Defines the main menu of the virtual Learning Space. It is specified by the following derivation rule of CaVagrammar:

header: ‘menu’ ‘[’ (optionHeader)+ ‘]’ ; optionHeader: brand | backgroundColor | fontColor | behaviourStat | items ;

Example:

menu [ brand: "Learning Space Menu Title", background color: green, foreground color: white", behavior: fixed, options [ label: "First dropdown menu title", dropdown [ dropdown label: "First option label", url: "URL to the corresponding webpage", dropdown label: "Second option label", url: "URL to the corresponding webpage", ] label: "Second dropdown menu title", dropdown [ dropdown label: "First option label", url: "URL to the corresponding webpage", dropdown label: "Second option label", url: "URL to the corresponding webpage", ] label: "Simple label", extension: "filetype (.php, .html, ...)", ] ]

The menu specification above specifies the header of the entire virtual Learning Space. This component described the brand, the colors, the behavior and the options of the menu (dropdown and simple). Notice that the URL must be defined, so that CaVa generator can create the right pages to jump to when the option is selected.

Attributes:
All the parameters are mandatory, except that marked with the Optional tag.
Attribute name Data type / Keyword Description
menu String The Learning Space menu title.
background color color / hexadecimal The background color of the LS. It can be defined by the known color names or by the hexadecimal system.
foreground color color / hexadecimal The foreground color of the LS (text). It can be defined by the known color names or by the hexadecimal system.
behavior Keyword It must be specified to decide if the menu should be fixed or if it should follow the scrolling of the page. The possible values are fixed or static.
options Array An array of labels that configure the entire menu. It can be a simple menu or a dropdown menu.
options > label String The label of the menu.
options > dropdown Array An array to specify the labels of the dropdown menu.
options > dropdown > dropdown label String The dropdown menu label options.
options > dropdown > url String An URL to jump when the option is selected.
options > extension Keyword A filetype to define the type of the file to be generated. It is used only when is a simple menu.

Content (Exhibition List)


Defines the Exhibitions List. The content of the virtual LS is specified through a list of exhibitions. Each exhibition is declared inside the exhibitions element. It is specified by the following derivation rules of CaVagrammar:


    exhibitions:  ‘exhibitions’ ‘[’ (exhibition)+ ‘]’ ;
    exhibition: ‘exhibitions’ ‘[’ (optionExhibition)+ ‘]’ ;
    optionExhibition: exhibitionTitle | exhibitionShortDescription | exhibitionIcon | exhibitionBehaviour
                    | exhibitionAdditionalInfo | exhibitionType | exhibitionNotification
                    | ( queryOperators | sparql);

    queryOperators: all | one ;
    all: CONCEPT ‘->’ ‘all’ ‘(’ parametersAll ‘)’ labelsOptions ;
    parametersAll: listName ‘,’ mappingOrTriplesFileName ‘,’ ontologyFileName ;
    listName: TEXT ;
    mappingOrTriplesFileName: TEXT ;
    ontologyFileName: TEXT ;
    labelsOptions:  ‘[’ (labelsExhibitionRoom)+ ‘]’ ;
    labelsExhibitionRoom:  elem (‘,’ elem)* ;
    elem: TEXT ;

    sparql: ‘SPARQL’ ‘[’ sparqlStatement ‘]’ ‘[’ labelsOptions ‘]’ ;

The queryOperators rule is responsible for describing the operator to query the database repository through the ontology.
The sparql rule is the responsible in charge to query the database repository through the ontology via the SPARQL query language.

The production rule sparqlStatement is a declaration based and verified by the SPARQL grammar.

To demonstrate how the production rules are applied, an example is presented. Notice that the lexer rule CONCEPT shall be related to a class of the used ontology. The used ontology for this example is related to the ontology presented in Chapter 7 of the Thesis.

Example:

exhibitions [ exhibition [ title: "Técnicas da Fotografia", short description: "Dividimos a história da fotografia ...", icon: "camera-retro", additional info [ title: "1672-2010", description: "Período", ] behavior: expanded, type: permanent, Technique->all("Técnicas", "mvif.obda", "http://semanticweb.org/rgm/2018/mvif/") [headerOfEachElement: "Técnica", "Década", "Descrição", "Período"], ], # other exhibitions ... ]

The content of a CaVa virtual Learning Space is specified through a list of exhibitions. Each exhibition is declared inside the exhibitions element. In this particular case, there is only one exhibition specified. It is a permanent type exhibition room. The referred description includes the definition of the exhibition title, an exhibition short description, the icon to be used, the additional information, and the expected component (accordion) behavior, that in this case is "expanded".

In addition to the static content of this exhibition room, a query operator "all()" was provided. The concept passed to it is "Technique", which means that the CaVa system needs to search for all occurrences of the specified concept in the database instances based on the mappings between the ontology and the repository (Chapter 8 of the Thesis). The parameters are the title of the instances list, the OBDA mapping file, and the URL of the ontology. As optional, if the order of the queried fields is known, they can be specified, as seen in the list of labels inside the brackets after the third parameter. If the list is not specified, the CaVa system will take the property annotations (rdfs:label) of the ontology (e.g. P131 is identified by with the annotation "is identified by") as labels for the final rendering of the virtual LS. If there is no annotation, the name of the property is taken.

Footer


Defines an area at the bottom of the LS known as footer of the website. It is specified by the following derivation rule of CaVagrammar:

footer: ‘footer’ ‘[’ (optionFooter)+ ‘]’ ; optionFooter: footerImage | footerFormatDate | footerDeveloper | footerBehavior | footerStyle ;

Example:

footer [ images [ image: "path_to_the_image", alignment: right, ] format date: "Y", developer [ name: "name of the developer", alignment: left, ] behavior: fixed, style: condensed, ]

The footer element shown above describes the footer of the whole virtual Learning Space. This footer is composed of some image (e.g. the CaVa logo) with alignment on the right side, the current year (day and month also can be added), the developer name aligned on the left side, and a behavior. The style of the footer was set up as condensed, but there is another one called extended, which means that the element contains more options where can be set the Social Networks, Partners, Address, Contact, etc.

The four blocks described must be composed into a unique .cava file in the order that they were specified in this section.

Each block and component specification starts with the left bracket “[” and closes with the right bracket “]”, always embracing pairs consisting of plain text or built in terms (e.g., the exhibition’s behavior attribute can be set up as ‘collapsed’ or ‘expanded’ values only).