2016-09-06 12 views
0

--strictコマンドラインを渡すときに何が起こるか把握するためにJenaのコードを調べました。警告のロギング以外の違いはないようです。 CmdLangParse.javaではstrictモードが設定され、SysRIOT.setStrictMode(true)が呼び出され、StrictXSDLexicialFormsとstrictModeフラグの両方が設定されます。 Jenaコマンドラインと--strict

@Override 
protected void exec() { 
    boolean oldStrictValue = SysRIOT.isStrictMode() ; 
    if (modLangParse.strictMode()) 
     SysRIOT.setStrictMode(true) ; 
    try { exec$() ; } 
    finally { SysRIOT.setStrictMode(oldStrictValue) ; } 
} 

はその後だけCheckerLiters validateByDatatypeand validateByDatatypeNumericuseにStrictXSDLexicalForms属性と、それは、\ nは、スペースを見つけた場合、または\ rが、それはちょうどそれをログに記録します。以下はvalidateByDatatypeNumeric

// Do a white space check as well for numerics. 
    if (lexicalForm.contains(" ")) { 
     handler.warning("Whitespace in numeric XSD literal: '" + lexicalForm + "'", line, col) ; 
     return false ; 
    } 
    if (lexicalForm.contains("\n")) { 
     handler.warning("Newline in numeric XSD literal: '" + lexicalForm + "'", line, col) ; 
     return false ; 
    } 
    if (lexicalForm.contains("\r")) { 
     handler.warning("Carriage return in numeric XSD literal: '" + lexicalForm + "'", line, col) ; 
     return false ; 
    } 

からの抜粋を、私は何かが足りないか、二つのモード(厳密および非厳密)に違いはありませんアムれますか?

答えて

0

--strictは、Jenaコマンドラインツールの一般的なフラグです。

構文解析には、注意してください。機能を無効にし、標準の最小値を提供します。解析のために、それほど多くはありません。