jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1427389 - in /jena/trunk/jena-arq: bin/rdfxml bin2/rdfxml src/main/java/org/apache/jena/riot/RDFLanguages.java src/main/java/riotcmd/rdfxml.java
Date Tue, 01 Jan 2013 11:39:08 GMT
Author: andy
Date: Tue Jan  1 11:39:08 2013
New Revision: 1427389

URL: http://svn.apache.org/viewvc?rev=1427389&view=rev
Log:
Correctly determine language from name of compressed file\nAdd riotcmd.rdfxml to parse RDF/XML
files.

Added:
    jena/trunk/jena-arq/bin/rdfxml   (with props)
    jena/trunk/jena-arq/bin2/rdfxml   (with props)
    jena/trunk/jena-arq/src/main/java/riotcmd/rdfxml.java
Modified:
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java

Added: jena/trunk/jena-arq/bin/rdfxml
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/bin/rdfxml?rev=1427389&view=auto
==============================================================================
--- jena/trunk/jena-arq/bin/rdfxml (added)
+++ jena/trunk/jena-arq/bin/rdfxml Tue Jan  1 11:39:08 2013
@@ -0,0 +1,19 @@
+#!/bin/sh
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+if [ "$ARQROOT" = "" ]
+    then 
+    echo "ARQROOT is not set" 1>&2
+    exit 1
+fi
+
+INIT="$ARQROOT/bin/arq_init"
+
+if [ ! -r "$INIT" ] 
+    then 
+    echo "Script $INIT (\$ARQROOT/bin/arq_init) does not exist or is not readable"
+    exit 1
+fi
+
+. "$INIT"
+exec java $JVM_ARGS $SOCKS -cp "$ARQ_CP" "riotcmd.$ARQ_CMD" "$@"

Propchange: jena/trunk/jena-arq/bin/rdfxml
------------------------------------------------------------------------------
    svn:executable = *

Added: jena/trunk/jena-arq/bin2/rdfxml
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/bin2/rdfxml?rev=1427389&view=auto
==============================================================================
--- jena/trunk/jena-arq/bin2/rdfxml (added)
+++ jena/trunk/jena-arq/bin2/rdfxml Tue Jan  1 11:39:08 2013
@@ -0,0 +1,11 @@
+#!/bin/sh
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+if [ "$ARQROOT" = "" ]
+then
+    echo "ARQROOT not set" 1>&2
+    exit 1
+    fi
+
+ARQ_CMD=$(basename $0)
+exec "${ARQROOT}/bin/${ARQ_CMD}" "$@"

Propchange: jena/trunk/jena-arq/bin2/rdfxml
------------------------------------------------------------------------------
    svn:executable = *

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java?rev=1427389&r1=1427388&r2=1427389&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java Tue Jan  1 11:39:08
2013
@@ -276,6 +276,9 @@ public class RDFLanguages
     /** Try to map a file name to a {@link Lang}; return null on no registered mapping */
     public static Lang filenameToLang(String filename)
     {
+        if ( filename == null ) return null ;
+        if ( filename.endsWith(".gz") )
+            filename = filename.substring(0, filename.length()-3) ;
         return fileExtToLang(FileUtils.getFilenameExt(filename)) ;
     }
 

Added: jena/trunk/jena-arq/src/main/java/riotcmd/rdfxml.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/riotcmd/rdfxml.java?rev=1427389&view=auto
==============================================================================
--- jena/trunk/jena-arq/src/main/java/riotcmd/rdfxml.java (added)
+++ jena/trunk/jena-arq/src/main/java/riotcmd/rdfxml.java Tue Jan  1 11:39:08 2013
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package riotcmd;
+
+import org.apache.jena.riot.Lang ;
+import org.apache.jena.riot.RDFLanguages ;
+
+import com.hp.hpl.jena.sparql.util.Utils ;
+
+/** Run the RDf/XML parser - and produce triples */
+public class rdfxml extends CmdLangParse
+{
+    public static void main(String... argv)
+    {
+        new rdfxml(argv).mainRun() ;
+    }    
+    
+    protected rdfxml(String[] argv)
+    {
+        super(argv) ;
+    }
+
+    @Override
+    protected String getCommandName()
+    {
+        return Utils.classShortName(rdfxml.class) ;
+    }
+    
+    @Override
+    protected Lang selectLang(String filename, Lang lang) 
+    { return RDFLanguages.RDFXML ; }
+}



Mime
View raw message