Skip to content

Latest commit

 

History

History
35 lines (30 loc) · 4.74 KB

File metadata and controls

35 lines (30 loc) · 4.74 KB

RDFCoder Interactive Console

The RDF Coder Interactive Console is a CLI providing methods to create, populate, query and store code models. A code model (for semplicity a model) is a representation of a classpath that can be composed of source code (.java), compiled code(.class), documentation (.java documentation) and other supported formats. A model can be queried with SPARQL queries, or browsed via inspection.

TODO: model life cycle graph

A model life cycle starts with an empty model, then it is possible to load statements from file system and add statements by loading classpath objects. The loading of classpath objects can be done is different sessions. A model can be cleaned to remove the entire content. A populated model can be queried by using SPARQL, on inspected with inspector functions. Finally a model can be made persistent on any supported code storage like database or filesystem. Many supported commands applies on a model, the consol displays the active model in prompt. If a model related command is invoked with no explicit model name, the command is invoked on the selected one.

Supported commands:

Command Example Description
debug debug [true|false]? Enables / disables the debug mode. With argument this command enables / disables the debug mode. If called without arguments shows the current value of the debug flag.
pwd pwd Prints the current directory. This command prints the current working directory, such directory is used every time a relative path is specified as argument in other commands requiring file system resources.
cd cd <path_to_dir> Changes the current directory. This command changes the current working directory. The <path_to_dir> argument can be both an absolute path or a relative path.
ls ls Lists the content of the current directory. This command lists the content of the current working directory, reporting for every file the type (file or directory), the size and the writing permissions.
loadjre loadjre Load the full JRE data model into the active model. This command may take minutes to complete.
list list Lists all the currently loaded models. Prints out the list of all the loaded models, the name of the selected model is marked with an asterisk.
setmodel setmodel [<model_name>] Allows to set the selected model. model name is the name of the model to set as selected, if not specified the command prints out the name of the currently selected model. Any command requiring a model name uses the selected model if no explicit model was specified. The selected model name is printed out in prompt.
newmodel newmodel <model_name> Creates a new Code Model to store library informations. model_name is the name of the new model, that must differ from the names of the already loaded models. This command creates a code model from scrath. A CodeModel is a triples container able to handle data generated by code parsers. This model can be queried and inspected, stored and relaoded from any supported storage.
clearmodel clearmodel [<model_name>] Cleans the content of a CodeModel. model_name is the name of the model model to delete, if not specified the selected model is deleted. This command removes all the triples present in the specified model.
removemodel removemodel [<model_name>] Removes a previously created Code Model._model_name+ is the name of the model to remove, if not specified the selected modelis removed. Removing a model deletes all the not stored content. To make the content of the model persistent use savemodel.
querymodel querymodel Allows to perform a query (SPARQL) on the current model. Performs the SPARQL query on the selected model.
inspectmodel inspectmodel Allows to inspect the current model.
loadmodel loadmodel <storage_name> <storage_param_1> ... Loads a library model. This command loads a model with name storage_name retrieving it from a phisical storage which access is described using a list of storage_parameters.
savemodel savemodel <storage_type> <storage_parameters> Saves a model on a storage. Saves the model on the storage specified with storage type using the given parameters. Storage type can be fs or db. The parameters are storage dependend. For filesystem there is fsfile containing the path to the file to store the model. For db there are dbuser, dbpassword, dbname. TODO: TBC
loadclasspath loadclasspath [classpath] Loads source classpath extracting the RDF representation.Loads the classpath on the selected model. The classpath is a : separated list of paths locating source packages, class packages or jar files. If paths are expressed as relative ones, the reference dir is given by the pwd command.