The RDF Export tool is used to export the result of a SPARQL-CONSTRUCT or SeRQL-CONSTRUCT into RDF XML or N-Triple files. The tool allows you to export structured data, generated by KIM, to be used in other applications that can work with RDF, like Protege-OWL or TopBraid Composer .
The RDF Export tool is located in <KIM_HOME>/bin/tools folder and requires a running instance of KIM.
|query||SPARQL-CONSTRUCT or SeRQL-CONSTRUCT query or a file containing one|
|output file||name of the file where the output will be written; If a file with the same name exists, it will be rewritten|
|output format||type either NTRIPLES or RDFXML, case-insensitive. The parameter is optional; default is NTRIPLES.|
By default, the tool will export data from a KIM server running at localhost. To export data from a KIM server, running on a remote machine, users need to create a configuration file named kim_connection.properties within the directory from which they are running the tool script. The file should contain at least two key-value pairs representing the KIM server host and port.
- Exporting all names of entities that KIM has found in documents using SPARQL-CONSTRUCT
New lines are added for clarification. The command should be executed as a single line.
- Exporting all names of entities that KIM has found in documents using SeRQL-CONSTRUCT query in a file
To shorten the command, create a text file in <KIM_HOME>/bin/tools called query.txt with the following contents:
Now execute the following command using the system shell:
After the tool finishes, the results can be found in the output-rdf.rdf file written with RDF-XML format.