Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolchain description update #1933

Merged
merged 18 commits into from
Jan 17, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions toolchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
The W3C WoT specification generation process toolchain is depicted as a Business Process Modeling Notation diagram. There are 4 actors involved:
1. ***Semantic Web Expert***
2. ***WoT Toolchain***
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved
3. ***SPARQL Template Transformation Language***
3. ***SPARQL Template Transformation Language Engine***
4. ***Parser Creation***

The Semantic Web Expert has the main responsibility to iteratively define the schema of different vocabularies such as TD, TM, WoTsec, HCTL and any extensions required, as well as the JSON Schema definition and SHACL shapes for validation. These different tasks are performed in an adhoc manner until agreement is achieved among the experts. In addition, they define a set of templates for the specification according to the SPARQL Template Transformation Language (STTL).
The Semantic Web Expert has the main responsibility to iteratively define the schema of different TD model specifications such as TD core, TM, WoTsec, HCTL or any extensions required. Also, the JSON Schema definition is defined for syntacticAL validation of JSON-LD data and Shapes Constraint Language (SHACL) shapes for Validating RDF graphs. These different tasks are performed in an adhoc manner until agreement is achieved among the experts. In addition, the experts define a set of transformations for the specification generation according to the SPARQL Template Transformation Language (STTL). The templates expressed in STTL describe different rules for transforming a source RDF graph into a result text.
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved

The WoT Toolchain is a shell script (render.sh), which manages the interaction between different Node.js scripts. It receives the different JSON-LD context files for each schema, aggregates them into one and converts them into Turtle representation format.
The WoT Toolchain is a shell script (render.sh), which manages the interaction between different Node.js scripts developed to achieve different objectives. It receives the different JSON-LD context files for each vocabulary in the TD model and aggregates them into one. The resulting JSON-LD context is then converted into RDF Turtle representation format. The artifacts provided by the Semantic Web Experts and the RDF graphs are provided as input to the STTL Engine.
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved

The STTL engine takes different RDF graphs: TD model ontologies, SHACL shapes (validation/td-validation.ttl), merged context (context/td-context.ttl), a transformation (a set of templates), and a specific starting node that determines the starting HTML node pointing to the WoT Things Descriptions as a set of command-line arguments. The TD model ontologies and SHACL shapes are loaded and stored in an RDF store for semantic processing and querying. Then, the STTL templates are parsed according to the parser developed by the Parser Creation actor. This is followed by matching the input HTML node with one of the transformation names specified in the template. A template in a transformation may apply other templates or include different utility functions or SPARQL functions. Therefore, the Apply Template sub-process identifies these different cases and applies the rules which includes the following activities: evaluate patterns, variables and expressions in a template, construct the query to execute using a JSON format, and executing the query on the RDF graph. The output is generated HTML textual output format corresponding to the index.html file of the TD specification and the different ontology specifications.
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved

The TD specification include diagrams that are also generated from the same SHACL and merged context sources. The STTL Engine is run once more to generated diagrams in textual form (DOT text files) and then turned into graphics using Graphviz tool. The output is the SVG figures of the TD specification, which is then manually converted into PNG using a desired tool of choice. These PNG files are used to feed the HTML specification.
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved

The Parser Creation process is mainly performed by a developer using a 2-step process. The grammar is developed manually using to context-free grammar according to the semantics of STTL language. Then, Jison tool takes the grammar as input and outputs a JavaScript file capable of parsing the language described by that grammar. The generated script is then used to parse visualization template inputs in the STTL Engine.
mahdanoura marked this conversation as resolved.
Show resolved Hide resolved