2017-03-06 87 views
1

我有我編寫的.ttl文件。我在Mac環境中。我想知道如何使用Apache jena來檢查文件是否有效。需要執行哪些終端命令?我已經下載了apache jena包。使用jena檢查RDF文件語法

回答

2

您可以使用riot$PATH_TO_JENA/bin/riot --validate $PATH_TO_FILE

riot [--time] [--check|--noCheck] [--sink] [--base=IRI] [--out=FORMAT] [--compress] file ... 
    Parser control 
     --sink     Parse but throw away output 
     --syntax=NAME   Set syntax (otherwise syntax guessed from file extension) 
     --base=URI    Set the base URI (does not apply to N-triples and N-Quads) 
     --check    Addition checking of RDF terms 
     --strict    Run with in strict mode 
     --validate    Same as --sink --check --strict 
     --rdfs=file   Apply some RDFS inference using the vocabulary in the file 
     --nocheck    Turn off checking of RDF terms 
     --stop     Stop parsing on encountering a bad RDF term 
    Output control 
     --output=FMT   Output in the given format, streaming if possible. 
     --formatted=FMT  Output, using pretty printing (consumes memory) 
     --stream=FMT   Output, using a streaming format 
     --compress    Compress the output with gzip 
    Time 
     --time     Time the operation 
    Symbol definition 
     --set     Set a configuration symbol to a value 
    General 
     -v --verbose   Verbose 
     -q --quiet   Run with minimal output 
     --debug    Output information for debugging 
     --help 
     --version    Version information