git clone https://@opensourceprojects.eu/git/p/timbus/context-model/converters/json-xml/linux-hw-converter timbus-context-model-converters-json-xml-linux-hw-converter



File Date Author Commit
META-INF 2015-01-02 miguelnunes miguelnunes [ac774b] Resolved conflict. Helpers dependency added
bundle 2015-01-05 miguelnunes miguelnunes [ef4cc7] Started cli and bundle separation. Cli implemen...
cli 2015-01-05 miguelnunes miguelnunes [50cc3d] Finished CLI. Now working with the two versions
output 2015-01-02 miguelnunes miguelnunes [ac774b] Resolved conflict. Helpers dependency added
src 2015-01-05 miguelnunes miguelnunes [50cc3d] Finished CLI. Now working with the two versions
.gitignore 2014-08-08 Jorge Simões Jorge Simões [654e96] Cleaned project and added .gitignore
Readme.md 2015-01-14 miguelnunes miguelnunes [7daf1a] Updated Readme
build.properties 2013-11-13 Luís Marques Luís Marques [313d0d] Maps CPU to OWL
pom.xml 2015-01-05 miguelnunes miguelnunes [50cc3d] Finished CLI. Now working with the two versions

Read Me

Linux Hardware Converter

Linux Hardware converts the JSON output from the Linux hardware Extractor and converts it to Context, required for further preservation.

 

How to get the code

git clone https://opensourceprojects.eu/git/p/timbus/context-model/converters/json-xml/linux-hw-converter

 

Install Requirements

  1. Oracle Java JDK 1.7
  2. Apache Maven installed

 

Format UUID

This version of Linux Hardware converter accepts the format ffd20389-64ac-5564-a4d7-21281c1daa39

 

Building the code

This converter is split into two different modules:
1. Bundle - To be used in the Context Population Framework
2. Cli - To be used through command-line
Apache Maven is used to manage dependencies and build the project, and all that's needed to successfully build the project is running the following command in the base directory:

1
mvn clean package

This command will freshly create a target subdirectory in both cli and bundle directories and place the output jar files there.

 

Running the cli modules

A simple example on running this module with a previous Perl Modules extraction is running the following command in the cli base directory:

1
java -jar linux-hardware-converter-cli-1.1-SNAPSHOT.jar --json exampleextraction.json -f RDF

This command requests a conversion from the exampleextraction.json file and will create a file within the current directory with the output directory. Further options are:
- -d,--directory - Output directory
- -f,--format (RDF|OWL) - Output format
- -h,--help - Shows help (no arguments)
- --json - Input JSON file(s)
- -n
- --dont-save - Does not save output to file (no arguments)

 

Running the bundle module

The bundle needs to be deployed in the Virgo container. A tutorial on how to install Virgo and deploy artefacts, including the usage of converters can be found here

 
Note: A typical extraction within the Context Population Framework will encapsulate the result with the following header:

1
2
3
4
5
6
7
8
{
    "format": {
        "multiple": false,
        "id": "ffd20389-64ac-5564-a4d7-21281c1daa39"
    },
    "UUID": "923fdec6-2ebf-11e4-bc19-ce2b29c0122c",
    "result": {
        ... ... ...

The converter expects solely the result JSON Object. Any other format or header will result in an error.

 

Expected output

This module converts from JSON to OWL, more specifically to DIO and the Hardware Extended DSO. In this second ontology, classes are provided in order for it to be possible to store Hardware elements such as the Motherboard, CPU, and relevant inherent Properties.

alt text

 

Author

Miguel Gama Nunes miguel.nunes@caixamagica.pt

 

License

Copyright (c) 2014, Caixa Magica Software Lda (CMS).
The work has been developed in the TIMBUS Project and the above-mentioned are Members of the TIMBUS Consortium.
TIMBUS is supported by the European Union under the 7th Framework Programme for research and technological development and demonstration activities (FP7/2007-2013) under grant agreement no. 269940.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTIBITLY, or FITNESS FOR A PARTICULAR PURPOSE. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law or agreed to in writing, shall any Contributor be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work.
See the License for the specific language governing permissions and limitation under the License.