2016-09-06 35 views
0

我一直在通過Jena中的代碼來弄清楚在傳遞--strict命令行時會發生什麼。除了記錄警告之外,似乎沒有區別。在CmdLangParse.java中設置嚴格模式並調用SysRIOT.setStrictMode(true),並在掩碼下設置StrictXSDLexicialForms和strictMode標誌。Jena命令行和 - 嚴格

@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命令行工具的一般標誌。

解析時,您注意到幾乎沒有區別。它關閉功能併爲標準提供最小值。對於解析,沒有太多。