Introducing Corese 4.4.1 – Corese-command update

Dear all, 



We are thrilled to announce the release of [ https://github.com/Wimmics/corese/releases/tag/release-4.4.1 | Corese 4.4.1 ] . This latest version comes with an update to the Corese-Command interface. For a comprehensive list of updates and changes, please refer to the [ https://github.com/Wimmics/corese/releases/tag/release-4.4.1 | changelog ] . 

We encourage you to explore the new features and functionalities of Corese-4.4.1 and share your invaluable feedback with us. Join our [ https://github..com/Wimmics/corese/discussions/ | Discussion Forum ] to share your thoughts or ask any questions you may have. 

Should you encounter any issues or have suggestions for new features, we welcome your contributions through [ https://github.com/Wimmics/corese/issues | issue reports ] or [ https://github.com/Wimmics/corese/pulls | pull requests ] . 

We hope you find Corese-Command a valuable tool for all your Semantic Web needs! Below is a brief overview of some significant improvements and exciting additions in Corese-4.4.1: 


1. New Installation script for Corese-Command 


Corese-Command offers convenient installation options, and you can choose from the following methods: 

    1. Download the Corese-Command jar file: You can get the latest version of Corese-Command by downloading the [ https://files.inria.fr/corese/distrib/corese-command-4.4.1.jar | Corese-Command jar file ] . 



wget "files.inria.fr/corese/distrib/corese-command-4.4.1.jar" java -jar "-Dfile.encoding=UTF8" "corese-command-4.4.1.jar" 


    1. Use the installation script (Linux and MacOS systems only): For Linux and MacOS users, we provide an installation script for seamless setup. 



$ curl -sSL https://files.inria.fr/corese/distrib/script/install-corese-command.sh | bash # change bash to zsh if you're using zsh # restart your terminal $ corese-command -h 




Should you wish to uninstall Corese-Command, a convenient script is available for that: 
$ curl -sSL https://files.inria.fr/corese/distrib/script/uninstall-corese-command.sh | bash # restart your terminal 





2. Sparql sub-command 


The sparql command allows you to run SPARQL queries on RDF datasets. 


2.1. Basic Usage 


Let's start with a simple example, executing a query on a local file: 


corese-command sparql -q 'SELECT * WHERE {?s ?p ?o}' -i myData.ttl 



| ?s | ?p | ?o | | ----------------------------------------- | ------------------------------- | --------------------------------------- | | <http://corese.inria.fr/Please_Please_Me> | <http://corese.inria.fr/artist> | <http://corese.inria.fr/The_Beatles> | | <http://corese.inria.fr/McCartney> | <http://corese.inria.fr/artist> | <http://corese.inria.fr/Paul_McCartney> | 


In this example, the query is provided directly on the command line with the -q flag, and the input file is specified with the -i flag. The result is printed to the standard output with the default format, which is markdown . 


2.2. Choose the Result Format 


Let's try the same query as before, but this time with the json format: 


corese-command sparql -q 'SELECT * WHERE {?s ?p ?o}' -i myData.ttl -r json 



{ "head" : { "vars" : [ "s" , "p" , "o" ] } , "results" : { "bindings" : [ { "s" : { "type" : "uri" , "value" : "http://corese.inria.fr/Please_Please_Me" } , "p" : { "type" : "uri" , "value" : "http://corese.inria.fr/artist" } , "o" : { "type" : "uri" , "value" : "http://corese.inria.fr/The_Beatles" } } , { "s" : { "type" : "uri" , "value" : "http://corese.inria.fr/McCartney" } , "p" : { "type" : "uri" , "value" : "http://corese.inria.fr/artist" } , "o" : { "type" : "uri" , "value" : "http://corese.inria.fr/Paul_McCartney" } } ] } } 


The result format can be specified with the -r flag. The following formats are available: 

    * RDF/XML: rdfxml or application/rdf+xml 
    * Turtle: turtle or text/turtle 
    * TriG: trig or application/trig 
    * JSON-LD: jsonld or application/ld+json 
    * XML: xml or application/sparql-results+xml 
    * Json: json or application/sparql-results+json 
    * CSV: csv or text/csv 
    * TSV: tsv or text/tab-separated-values 
    * Markdown: markdown or md or text/markdown 



Here is a table of available formats according to the type of request: Format select ask insert insert-where delete delete-where describe construct rdfxml  ❌  ❌  ✅  ✅  ✅  ✅  ✅  ✅ 
turtle  ❌  ❌  ✅  ✅  ✅  ✅  ✅  ✅ 
trig  ❌  ❌  ✅  ✅  ✅  ✅  ✅  ✅ 
jsonld  ❌  ❌  ✅  ✅  ✅  ✅  ✅  ✅ 
xml  ✅  ✅  ❌  ❌  ❌  ❌  ❌  ❌ 
json  ✅  ✅  ❌  ❌  ❌  ❌  ❌  ❌ 
csv  ✅  ✅  ❌  ❌  ❌  ❌  ❌  ❌ 
tsv  ✅  ✅  ❌  ❌  ❌  ❌  ❌  ❌ 
markdown  ✅  ✅  ❌  ❌  ❌  ❌  ❌  ❌ 


2.3. Different Types of Input 


The input can be provided in different ways: 

    * File Input: The input file can be specified with the -i flag: 



corese-command sparql -q 'SELECT * WHERE {?s ?p ?o}' -i myData.ttl 


    * URL Input: URLs can be specified with the -i flag: 



corese-command sparql -q 'SELECT * WHERE {?s ?p ?o}' -i 'http://example.org/myData.ttl' 


    * Standard Input: If no input file is specified with -i , the program uses the standard input: 



cat myData.ttl | corese-command sparql -q 'SELECT * WHERE {?s ?p ?o}' 

BQ_BEGIN


The input file format is automatically detected for file and URL inputs. If the input is provided on the standard input or you want to force the input format, you can use the -f flag. Possible values are: 

    * rdfxml , application/rdf+xml 
    * turtle , text/turtle 
    * trig , application/trig 
    * jsonld , application/ld+json 
    * n3 , text/n3 
    * ntriples , application/n-triples 
    * nquads , application/n-quads 
    * rdfa , application/xhtml+xml 

BQ_END



2.4. Different Types of Queries 


The query can be provided in different ways: 

    * Query String: The query can be provided directly on the command line with the -q flag: 



corese-command sparql -q 'SELECT * WHERE {?s ?p ?o}' -i myData.ttl 


    * File Query: The query can be provided in a file with the -q flag: 



corese-command sparql -q myQuery.rq -i myData.ttl 



2.5. Multiple Input Files 


    * Multiple Input: It's possible to provide multiple input files by repeating the -i flag: 



corese-command sparql -q myQuery.rq -i myData1.ttl -i myData2.ttl -i http://example.com/myData3.ttl 


    * Shell Globbing: It's also possible to use shell globbing to provide multiple input files: 



corese-command sparql -q myQuery.rq -i *.ttl 



corese-command sparql -q myQuery.rq -i myData?.ttl 


    * Directory Input: If you want to use a whole directory as input, you can do so. 



corese-command sparql -q myQuery.rq -i ./myDirectory/ 


    * Directory Input Recursive: If you want to use a whole directory as input, you can do so. The -R flag allows you to use the directory recursively.. 



corese-command sparql -q myQuery.rq -i ./myDirectory/ -R 



2.6. Different Types of Output 


If you want to save the result to a file, you can do so with the -o flag: 


corese-command sparql -q 'SELECT * WHERE {?s ?p ?o}' -i myData.ttl -r json -o myResult.json 


If no -o flag is provided, the result is printed to the standard output. 


corese-command sparql -q 'SELECT * WHERE {?s ?p ?o}' -i myData.ttl -r json | jq [ … ] 



3. Convert sub-command 


The convert command allows you to convert an RDF file from one serialization format to another. 


3.1 Basic Usage 



corese-command convert -i myFile.ttl -r jsonld 


This example converts myFile.ttl from turtle to jsonld . The -i flag specifies the input file, and the -r flag specifies the output format. 


3.2. Different Types of Input 


The input can be provided in different ways: 

    * File Input: The input file can be specified with the -i flag: 



corese-command convert -i myData.ttl -r jsonld 


    * URL Input: URLs can be specified with the -i flag: 



corese-command convert -i 'http://example.org/myData.ttl' -r jsonld 


    * Standard Input: If no input file is specified with -i , the program uses the standard input: 



cat myData.ttl | corese-command convert -r turlte 

BQ_BEGIN


The input file format is automatically detected for file and URL inputs. If the input is provided on the standard input or you want to force the input format, you can use the -f flag. Possible values are: 

    * rdfxml , application/rdf+xml 
    * turtle , text/turtle 
    * trig , application/trig 
    * jsonld , application/ld+json 
    * n3 , text/n3 
    * ntriples , application/n-triples 
    * nquads , application/n-quads 
    * rdfa , application/xhtml+xml 

BQ_END



3.3. Different Types of Output 


The output can be provided in different ways: 

    * File Output: The output file can be specified with the -o flag: 



corese-command convert -i myData.ttl -r jsonld -o myData.jsonld 


    * Standard Output: If no output file is specified with -o , the program uses the standard output: 



corese-command convert -i myData.ttl -r jsonld | jq [ … ] 

BQ_BEGIN


The output file format can be specified with the -r flag. Possible values are: 

    * rdfxml , application/rdf+xml 
    * turtle , text/turtle 
    * trig , application/trig 
    * jsonld , application/ld+json 

BQ_END



3.4. Summary of Available Formats 


The convert command supports the following formats for input and output: Format Input Support Output Support RDFXML  ✅  ✅ 
Turtle  ✅  ✅ 
JSONLD  ✅  ✅ 
TriG  ✅  ✅ 
N3  ✅  ❌ 
NTRIPLES  ✅  ❌ 
NQUADS  ✅  ❌ 
RDFA  ✅  ❌ 

Best regards, 
Rémi Cérès. 

Received on Thursday, 24 August 2023 08:20:18 UTC