You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2012/12/06 23:42:33 UTC

svn commit: r1418119 - in /jena/trunk/jena-arq/src/main/java/arq/cmdline: CmdGeneral.java ModLangParse.java

Author: andy
Date: Thu Dec  6 22:42:33 2012
New Revision: 1418119

URL: http://svn.apache.org/viewvc?rev=1418119&view=rev
Log:
Enable RDFS expansion when parsing data.

Modified:
    jena/trunk/jena-arq/src/main/java/arq/cmdline/CmdGeneral.java
    jena/trunk/jena-arq/src/main/java/arq/cmdline/ModLangParse.java

Modified: jena/trunk/jena-arq/src/main/java/arq/cmdline/CmdGeneral.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/arq/cmdline/CmdGeneral.java?rev=1418119&r1=1418118&r2=1418119&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/arq/cmdline/CmdGeneral.java (original)
+++ jena/trunk/jena-arq/src/main/java/arq/cmdline/CmdGeneral.java Thu Dec  6 22:42:33 2012
@@ -20,6 +20,8 @@ package arq.cmdline;
 
 import java.io.PrintStream ;
 
+import com.hp.hpl.jena.query.ARQ ;
+
 import org.apache.jena.atlas.io.IndentedWriter ;
 import arq.cmd.CmdUtils ;
 import arq.cmd.TerminationException ;
@@ -29,7 +31,7 @@ import arq.cmd.TerminationException ;
 
 public abstract class CmdGeneral extends CmdArgModule implements CallbackHelp//, VersionCallback
 {
-    static { CmdUtils.setN3Params() ; }
+    static { CmdUtils.setN3Params() ; ARQ.init() ; }
 
     protected ModGeneral modGeneral = new ModGeneral(this) ;
     protected ModVersion modVersion = new ModVersion(true) ;

Modified: jena/trunk/jena-arq/src/main/java/arq/cmdline/ModLangParse.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/arq/cmdline/ModLangParse.java?rev=1418119&r1=1418118&r2=1418119&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/arq/cmdline/ModLangParse.java (original)
+++ jena/trunk/jena-arq/src/main/java/arq/cmdline/ModLangParse.java Thu Dec  6 22:42:33 2012
@@ -18,10 +18,11 @@
 
 package arq.cmdline;
 
+import org.apache.jena.iri.IRI ;
+import org.openjena.riot.RiotException ;
 import org.openjena.riot.system.IRIResolver ;
 import arq.cmd.CmdException ;
 
-import org.apache.jena.iri.IRI ;
 import com.hp.hpl.jena.rdf.model.Model ;
 import com.hp.hpl.jena.util.FileManager ;
 
@@ -62,7 +63,7 @@ public class ModLangParse implements Arg
         cmdLine.add(argCheck,   "--check",          "Addition checking of RDF terms") ; // (default: off for N-triples, N-Quads, on for Turtle and TriG)") ;
         cmdLine.add(argStrict,  "--strict",         "Run with in strict mode") ;
         cmdLine.add(argValidate,"--validate",       "Same as --sink --check=true --strict") ;
-//        cmdLine.add(argRDFS,    "--rdfs=file",      "Apply some RDFS inference using the vocabulary in the file") ;
+        cmdLine.add(argRDFS,    "--rdfs=file",      "Apply some RDFS inference using the vocabulary in the file") ;
         
         cmdLine.add(argNoCheck, "--nocheck",        "Turn off checking of RDF terms") ;
 //        cmdLine.add(argSkip,    "--noSkip",         "Skip (do not output) triples failing the RDF term tests") ;
@@ -113,8 +114,15 @@ public class ModLangParse implements Arg
         
         if ( cmdLine.contains(argRDFS) )
         {
-            rdfsVocabFilename = cmdLine.getArg(argRDFS).getValue() ;
-            rdfsVocab = FileManager.get().loadModel(rdfsVocabFilename) ;
+            try {
+                rdfsVocabFilename = cmdLine.getArg(argRDFS).getValue() ;
+                rdfsVocab = FileManager.get().loadModel(rdfsVocabFilename) ;
+            } 
+            catch (RiotException ex)
+            { throw new CmdException("Error in RDFS vocabulary: "+rdfsVocabFilename) ; }
+            catch (Exception ex)
+            { throw new CmdException("Error: "+ex.getMessage()) ; }
+            
         }
     }