Ldow2011 Texto Mauricio

Embed Size (px)

Citation preview

  • 8/18/2019 Ldow2011 Texto Mauricio

    1/20

    Synth

    Synth is a development environment for building applications that are modeled

    according to SHDM method. It provides a set of modules that receives, as input, models

    generated on each step of SHDM and produces, as output, the hypermedia application

    described by these models. Synth also provides an authoring environment that facilitates

    the adding and editing of these models by a GUI that can run on any web browser.

    A modular software architecture

    modular software architecture !Gauthier " #onto, $%&'( #arnas, $%&)* was

    designed, regardless of implementation technology, supporting the development of 

    applications modeled by SHDM. +his software architecture consists of a set of modules,

    each one responsible for maintaining and interpreting the models generated in each step

    of SHDM. ach module is composed by an ontology in -DS or /01, for the

    representation of their models, and an interpreter that gives semantics to these models,

     besides the basic semantics of -DS and /01 languages in which they are represented.

    +hese modules wor2 together, interpreting their models and communicating with each

    other to generate the application runtime in accordance with the definitions of eachmodel.

    igure $ shows a conceptual view of the modular software architecture for 

    applications modeled by the method SHDM. +he gray bo3es with rounded corners

    represent the modules and the white bo3es represent the components of each module.

  • 8/18/2019 Ldow2011 Texto Mauricio

    2/20

    Persistencemodule

    Legenda

    BusinessLogic module

    Domainmodule

    InterfacesmoduleNaviga onmodule

    Naviga onOntology

    Naviga onModel

    Interpreter

    Naviga onModel

    BusinessLogicOntology

    BusinessLogicModel

    Interpreter

    BusinessLogicModel

    InterfacesOntology

    InterfacesModel

    Interpreter

    InterfacesModel

    DomainModel

    DomainOntology

    vocabulary

    query

    queryorstore

    uses uses

    RDF(S!O"Lmappinglayer

    Store# inferencesandquerylayer

    Frame$or%RDF&   'Frame$or%RDF Frame$or%RDFN

           i      n       t      e      r      p      r      e       t      s

    Figure 1 – Conceptual view of the software architecture

    +he persistence module deals with access and manipulation of application data.

    +his module is composed of two layers4 a storage, inferences and 5uery layer and a

    -D6S78/01 mapping layer.

    +he storage, inferences and 5uery layer provides a uni5ue interface for access

    multiple environments and platforms for -D data. 9y applying the dapter design

     pattern !Gamma et al., $%%:*, this layer converts the access interfaces of -D data

    environments in a single interface 2nown by the -D6S78/01 mapping layer. s

    e3amples of -D data environments, we can mention ;ena$ and Sesame) framewor2s and

    databases that implement the S#-

  • 8/18/2019 Ldow2011 Texto Mauricio

    3/20

    allow the use of data distributed according to the recommendations of the pro>ect 1in2ing

    /pen Data, especially those data available under S#-ects, attributes and

    classes of class?based ob>ect?oriented programming languages. However this architecture

    does not impose the use of a specific programming language, and those that include other 

    2ind of primitives such as associative arrays !1uc2ham " Su@u2i, $%&%* and prototypes

    !1ieberman, $%AB* can be used.

    our other modules were designed4 domain module, navigation module, business

    logic module and interfaces module. ach of these modules is responsible for maintain

    and interpret their related models. ll that modules have similar organi@ation, composed

     by an ontology, a model specification and an interpreter of that model. /nly the domain

    module has no interpreter because the semantic of the domain model is the same of 

    -DS and /01 and the persistence module provides an interpreter for them on the

    -D6S78/01 mapping layer.

    Module collaboration

     

    +he se5uence diagram below illustrates the collaboration se5uence between the

    modules in a normal case of hyperte3tual navigation. +he user interaction always happens

    through the e3ternal operations of the business logic model, available as 0eb Services.

    3ternal agents invo2e e3ternal operations by sending H++# re5uests !9erners?1ee et al.,

    $%%%* to the application. In this sense, e3ternal operations fulfill the same role of the

    Ccontroller from the MEF 6model?view?controller7 standard !9urbec2, $%A&, $%%)*,

    coordinating user interactions, obtaining data from the domain model, as2ing the view togenerate the interface and, finally, delivering the result to the user or e3ternal agent.

  • 8/18/2019 Ldow2011 Texto Mauricio

    4/20

    In this se5uence diagram, the user sends a message to the business logic module

    invo2ing the method Ce3ecute e informing the name of an operation, in this case

    Cconte3t, and some parameters for this operation. fter that, the e3ternal operation

    invo2es the method Cgetconte3t from the navigation module with the conte3t identifier 

    Cll#erson which invo2es the method Cdsl from the domain module with the conte3t

    5uery e3pression, obtained from Cll#erson conte3t specification. +he domain module

     >ust pass the same message to the persistence module, that is responsible for receive the

    conte3t 5uery e3pression, convert it to an e5uivalent ederated S#-

  • 8/18/2019 Ldow2011 Texto Mauricio

    5/20

    Synt)

    Ruby on Rails

    +ctiveRDF

     ,ena

    RDF data

    Implementation architecture

    Synth is implemented with -uby on -ails, a MEF framewor2 for web applications

    development. Under this aspect, Synth is an application built according with the MEF

     pattern. However, was 2ept the modular organi@ation where each module presented on

    the conceptual view is implemented as a composition of one or more components of the

    MEF. +he figure below presents the stac2 of software components that compose the

    Synth general architecture.

    very data in Synth is maintained as a -D graph. It includes not only theinstances of domain data, but also the metadata about the models and meta models of 

    SHDM. verything about the application, domain data, hyperte3tual navigational

    specification, business logic and interfaces are e3pressed in -D6S7 and /01. +here is

    no need to change the Synth source code to ma2e a 1D because it is possible to define

    almost any aspect of an 1D as -D data, than2s to the Synth modules that interprets its

    models.

    +he ;ena framewor2 was used to given an #I for manipulating the -D

     programmatically. It covers the role of the store, inferences and 5uery layer on the

     persistence module. +he ctive-D is a library for accessing -D from -uby programs.

    It maps the -D data in -uby primitives, role of the -D6S78/01 mapping layer.

    ctive-D provides an #I that facilitates F-UD operations on -uby programs. It has a

    adapter for ;ena.

  • 8/18/2019 Ldow2011 Texto Mauricio

    6/20

    +he choice for -uby on -ails was motivated by the choice for the -uby language.

    s demonstrated by !/rena et al. )''A*, because of the dynamic and open nature of the

    Semantic 0eb, Cscripting dynamic languages are suitable for the development over this

    environment, than2s to its dynamically typed ob>ects, multiple heritance and rela3ation of 

    strict ob>ect conformance to class definition presents a good mapping for the specification

    of -DS classes. 1anguages, such as Smalltal2, #erl, #ython, and -uby, are dynamically

    typed, typically allow higher?order constructs 6e.g. passing methods to methods7 and

    support complete reflection, both introspection 6obtaining information on ob>ects at

    runtime7 as intercession 6modifying ob>ects at runtime7, all desirable characteristics for 

    1D development.

    Authoring environment !I

    Synth provides an authoring environment GUI of H+M1 forms that can be

    accessed from a web browser and allows the creation and edition of the SHDM models

     primitives. +hrough this interface it is possible run the application while it is built and

    validate it in each step of its development. +he figure below shows one of the screens

    from Synth GUI. +his is the screen for listing the application conte3ts.

  • 8/18/2019 Ldow2011 Texto Mauricio

    7/20

    ach tab on this screen is related to a specific step of SHDM. 0hen the user clic2 

    on a tab, sub tabs for editing the primitives related with the selected step are presented.

    So, it has CDomain for the Domain Modeling, Cavigation for Hyperte3tual avigation

    Modeling, CInterface for Interface Modeling and C9ehavior for 9usiness 1ogic

    Modeling.

    Synth also provides the -D Scaffold, a generic -D editor that allows the

    e3ecution of the F-UD operations for the local application -D database in the same

    way that it could be done on some well 2nown -D browsers and wi2is li2e +abulator,

    Disco or /nto0i2i. +he figure below presents one screen of the -D Scaffold.

  • 8/18/2019 Ldow2011 Texto Mauricio

    8/20

    "onte#t $uery %#pression Languages

    Synth provides many ways to specify the selection rules for a conte3t that denotes

    the set of resources that compose its nodes. +he selection rules are e3pressed as conte3t

    5uery e3pressions. +hese e3pressions can be specified on one of these 5uery languages4

    S#-

  • 8/18/2019 Ldow2011 Texto Mauricio

    9/20

    is a valid -uby string. +his string is interpolated with the value of the parameters on the

    array ! person, creationdate * on runtime.

    %{

      PREFIX rdf:

      PREFIX bibo:   PREFIX dc:

      SELECT DISTINCT ?s WHERE { ?s rdf:type track:TabIssue .

    ?s dc:creator .

    ?s dc:created "%s" .}

    } % [ person, creation_date ]

    +he S#-

  • 8/18/2019 Ldow2011 Texto Mauricio

    10/20

    :. ll resources which rdf4type is trac24+abIssue, dc4title is Crror and

    foaf4ma2er is the resource denoted by the U-I Chttp488usersLuser$(B. ll resources which rdf4type is my4nnotation and my4annotates is the same

    value of the parameter Cissue passed during the navigation.

    +he goal of Synth

  • 8/18/2019 Ldow2011 Texto Mauricio

    11/20

    Semantic Issue &rac'er

    In this section is presented the Semantic Issue +rac2er application as an e3ample of 

    a 1D created with Synth. n Issue +rac2er is a system for management creation, updateand solving issues about some service or product reported by clients or collaborators.

    Semantic Issue +rac2er is an Issue +rac2er in which the data are described in -D.

    +he domain model 6ontology and instances7 of this application is the data from

    +abulator & Issue +rac2er available on http488tabulator.org8wi2i8tabulator8trac2er with some

    e3tensions on the ontology for supporting user annotations. +hose raw data was provided

    on a S#-ose2i.org

  • 8/18/2019 Ldow2011 Texto Mauricio

    12/20

    +he figure below is the diagram that represents the conte3t schema for this

    application. +he conte3t schema is an artifact of SHDM for representing the hyperte3tual

    navigation in a high level of abstraction. In this diagram the dashed bo3es are the inde3es

    6accessing structures, li2e a list with lin2s7 and the white bo3es inside the grey bo3es are

    the conte3ts. +he arrows represent the navigation between conte3ts and inde3es.

  • 8/18/2019 Ldow2011 Texto Mauricio

    13/20

    trac%-.abIssue

    +ll.abIssuesId/

    List.abIssuesId/

    $f-Message

    MessageByIssue

    user-0ser

    Ma%erByIssue

    ModifierByIssue

    SubscriberByIssue

    IssuesBy1ategory

    IssuesByState

    +ll.abIssues

    IssuesByMa%er

    +lp)a

    +he hyperte3tual navigational model and, conse5uently, the conte3t schema

     presented above can be represented in -D triples with more details that could not be

    represented in that graphical notation.

    In this application the conte3t Cll+abIssues is the ma>or conte3t and is composed

     by the set of resources which type is trac24+abIssue. +he list below is the specification of 

    this conte3t e3pressed in the +urtle notation of -D.

    :AllTabIssues a shdm:Context ;

      shdm:context_name " AllTabIssues";

      shdm:context_title "All Tab Issues";

  • 8/18/2019 Ldow2011 Texto Mauricio

    14/20

      shdm:context_query "selects {

    a TRACK::TabIssue

    datasets :issue_tracker

      }".

     

    +he main property of a conte3t is shdm4conte3t5uery, that is a 5uery e3pression

    that denotes the set of resources that compose the nodes of the conte3t. In the list above,

    the 5uery e3pression is specified in Synthor property of a dataset is void4spar5lndpoint that carries the address of 

    the S#-

  • 8/18/2019 Ldow2011 Texto Mauricio

    15/20

    +he ne3t figure is the resulting page of navigation on the CIssues9yMa2er conte3t

    with the selected user is C;oyce.

  • 8/18/2019 Ldow2011 Texto Mauricio

    16/20

     

    In SHDM it is possible to enrich the navigational node, which is a resource

    accessed in some navigational conte3t, with some especial attributes, called navigational

    attributes. or that it is necessary to specify the navigational attributes for some class in

    some conte3t in a way that, if a resource of the specified class is accessed in the specified

    conte3t, this resource will be enriched with the specified navigational attributes. +his is

    called in conte3t class specification. +he list below is a in conte3t class specification for 

    the class trac24+abIssue and the Cll+abIssues conte3t.

    :TabIssueInAllTabIssues a shdm:InContextClass ;

      shdm:in_context_class_class track:TabIssue ;

      shdm:in_context_class_context :AllTabIssues

      shdm:computed_attributes [

      a shdm:ComputedNavigationAttribute;

      shdm:navigation_attribute_name "Annotations";

      shdm:computed_value_expression "

      issues = MY::Annotation.find_by.my::annotates(self)

      issues.execute.to_a.map{|a| a.rdfs::comment.first }

    ".

    ];

    +he figure below is the same specification on the Synth authoring environment

    graphical interface.

  • 8/18/2019 Ldow2011 Texto Mauricio

    17/20

    In this specification, the computed navigational attribute Cnnotates are added to

    the resources of the class trac24+abIssues accessed on the conte3t Cll+abIssues. +his

    computed navigational attribute is a string listing the annotations of the trac24+abIssue.

    +he figure below is the resulting page of navigation on the conte3t Cll+abIssues

     presenting the computed navigational attribute Cnnotates highlighted inside of the

    dashed bo3.

  • 8/18/2019 Ldow2011 Texto Mauricio

    18/20

    +he list below is the specification of the C1ist+abIssueId3 inde3. In this e3ample

    some navigational attributes are omitted to save space, but they are very similar to the

     presented navigational attribute.

    :ListTabIssueIdx a shdm:ContextIndex ;

      shdm:index_name "ListTabIssueIdx";

      shdm:index_title "Tabulator Issue List";

      shdm:context_index_context :AllTabIssues;

     

    shdm:context_anchor_attributes [

      a shdm:ContextAnchorNavigationAttribute;

      shdm:navigation_attribute_name "Issue";

      shdm:navigation_attribute_index_position 1;

      shdm:context_anchor_label_expression "self.dc::title";

    shdm:context_anchor_target_context :AllTabIssues;

      shdm:context_anchor_target_node_expression "self".

      ];

  • 8/18/2019 Ldow2011 Texto Mauricio

    19/20

    +his inde3 is based on the conte3t Cll+abIssues and has the navigational attribute

    which is a conte3t anchor. +his conte3t anchor shows the dc4title of the +abIssue and the

    target is the resource in which the current inde3 entry is based on the conte3t

    Cll+abIssues. +he figure below presents the complete specification of this inde3 on

    Synth.

    +he figure below is the resulting of the navigation on the C1ist+abIssueId3 inde3.

  • 8/18/2019 Ldow2011 Texto Mauricio

    20/20