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 2017/02/08 09:45:53 UTC

[1/6] jena git commit: Update comment - workaround still needed

Repository: jena
Updated Branches:
  refs/heads/master b64e310f2 -> fa0fb4848


Update comment - workaround still needed


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/f277e501
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/f277e501
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/f277e501

Branch: refs/heads/master
Commit: f277e5012980447ae1c33c52f4c1ff5036aae1c5
Parents: bb48c11
Author: Andy Seaborne <an...@apache.org>
Authored: Mon Jan 30 15:41:32 2017 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Feb 8 09:34:45 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/jena/sparql/expr/nodevalue/NodeValueDT.java   | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/f277e501/jena-arq/src/main/java/org/apache/jena/sparql/expr/nodevalue/NodeValueDT.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/nodevalue/NodeValueDT.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/nodevalue/NodeValueDT.java
index 310ef86..0f548ae 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/nodevalue/NodeValueDT.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/nodevalue/NodeValueDT.java
@@ -39,7 +39,7 @@ public class NodeValueDT extends NodeValue
     public NodeValueDT(String lex, Node n)
     {
         super(n) ;
-        // Java bug : Java6 gMonth with a timezone of Z causes IllegalArgumnentException
+        // Java bug : Java6, Java8: gMonth with a timezone of Z causes IllegalArgumentException
         if ( XSDgMonth.equals(getNode().getLiteralDatatype()) )
         {
             if ( lex.endsWith("Z") )
@@ -55,7 +55,6 @@ public class NodeValueDT extends NodeValue
 
     // Look at datatype.
     // By doing this here, the check of valid lexical form must have been done to create the node.
-    
    
     @Override
     public boolean isDateTime()     { return XSDdateTime.equals(getNode().getLiteralDatatype()) ; }


[3/6] jena git commit: Editorial/javadoc.

Posted by an...@apache.org.
Editorial/javadoc.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/c761b915
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/c761b915
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/c761b915

Branch: refs/heads/master
Commit: c761b915a4058a0dfc497e8d04d0411cbad30d2d
Parents: 6256efa
Author: Andy Seaborne <an...@apache.org>
Authored: Thu Feb 2 16:06:05 2017 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Feb 8 09:36:15 2017 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/jena/riot/system/RiotLib.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/c761b915/jena-arq/src/main/java/org/apache/jena/riot/system/RiotLib.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/RiotLib.java b/jena-arq/src/main/java/org/apache/jena/riot/system/RiotLib.java
index 8f1e893..e416975 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/RiotLib.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/RiotLib.java
@@ -181,15 +181,15 @@ public class RiotLib
             return new ParserProfileBase(prologue, handler, factoryRDF(labelToNode)) ;
     }
 
-    /** Create a new (notinfluenced by anything else) FactoryRDF
+    /** Create a new (not influenced by anything else) {@code FactoryRDF}
      * using the label to blank node scheme provided. 
      */
     public static FactoryRDF factoryRDF(LabelToNode labelMapping) {
         return new FactoryRDFCaching(FactoryRDFCaching.DftNodeCacheSize, labelMapping);
     }
 
-    /** Create a new (not influenced by anything else) FactoryRDF
-     * using the label to blank node scheme scope by this FactoryRDF. 
+    /** Create a new (not influenced by anything else) {@code FactoryRDF}
+     * using the default label to blank node scheme. 
      */  
     public static FactoryRDF factoryRDF() {
         return factoryRDF(SyntaxLabels.createLabelToNode());


[6/6] jena git commit: Return null model, rather than a model with a null graph.

Posted by an...@apache.org.
Return null model, rather than a model with a null graph.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/fa0fb484
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/fa0fb484
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/fa0fb484

Branch: refs/heads/master
Commit: fa0fb48482c5924251ada9ae2e061dba64245457
Parents: 171d16a
Author: Andy Seaborne <an...@apache.org>
Authored: Wed Feb 8 09:39:07 2017 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Feb 8 09:39:07 2017 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/jena/sparql/core/DatasetImpl.java     | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/fa0fb484/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetImpl.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetImpl.java b/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetImpl.java
index 7c0e064..60fa30f 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetImpl.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetImpl.java
@@ -195,6 +195,8 @@ public class DatasetImpl implements Dataset
     }
     
     protected Model graph2model(final Graph graph) {
+        if ( graph == null ) 
+            return null;
         return ModelFactory.createModelForGraph(graph);
     }
 


[4/6] jena git commit: Add comments about how DatatypeFactory initialization happens.

Posted by an...@apache.org.
Add comments about how DatatypeFactory initialization happens.

Correct pathSeparator to fileSeparator.
Put code in requirements order.


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/6256efa6
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/6256efa6
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/6256efa6

Branch: refs/heads/master
Commit: 6256efa6c77f881aa27b3992a609c6f505a8e4fb
Parents: f277e50
Author: Andy Seaborne <an...@apache.org>
Authored: Mon Jan 30 16:38:54 2017 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Feb 8 09:36:15 2017 +0000

----------------------------------------------------------------------
 .../org/apache/jena/sparql/expr/NodeValue.java  | 21 +++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/6256efa6/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java
index 8b0c143..c2b727e 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java
@@ -162,16 +162,12 @@ public abstract class NodeValue extends ExprNode
      */
     private static DatatypeFactory getDatatypeFactory() 
             throws DatatypeConfigurationException {
-        ClassLoader cl = NodeValue.class.getClassLoader();
-        File jaxpPropFile = new File(
-            System.getProperty("java.home") + File.pathSeparator + 
-            "lib" + File.pathSeparator + 
-            "jaxp.properties");
-        
         // Step 1. Try the system property
         String dtfClass = System.getProperty(DatatypeFactory.DATATYPEFACTORY_PROPERTY);
         
         try {
+            File jaxpPropFile = new File(System.getProperty("java.home") + 
+                                         File.separator + "lib" + File.separator + "jaxp.properties");
             // Step 2. Otherwise, try property in jaxp.properties
             if (dtfClass == null && jaxpPropFile.exists() && jaxpPropFile.canRead()) {
                 Properties jaxp = new Properties();
@@ -189,15 +185,22 @@ public abstract class NodeValue extends ExprNode
         }
         
         // Step 3. Otherwise try the service approach
+        // This is the normal initialization path, getting it from the Apach Xerces dependency
+        // and loading org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl
         if (dtfClass == null) {
+            ClassLoader cl = NodeValue.class.getClassLoader();
             Iterator<DatatypeFactory> factoryIterator = 
                 ServiceLoader.load(DatatypeFactory.class, cl).iterator();
             if (factoryIterator.hasNext()) return factoryIterator.next();
         }
         
-        // Step 4. Use the default
-        if (dtfClass == null) dtfClass = DatatypeFactory.DATATYPEFACTORY_IMPLEMENTATION_CLASS;
-        
+        // Step 4. Use the default.
+        // Note: When Apache Xerces is on the classpath for Jena, javax.xml.datatype.DatatypeFactory is from that jar and
+        //  DATATYPEFACTORY_IMPLEMENTATION_CLASS is "org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl"
+        // Without an explicit Xerces, we would get "com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl"
+        // from the JDK rt.jar version of javax.xml.datatype.DatatypeFactory.
+        if (dtfClass == null) 
+            dtfClass = DatatypeFactory.DATATYPEFACTORY_IMPLEMENTATION_CLASS;
         return DatatypeFactory.newInstance(dtfClass, NodeValue.class.getClassLoader()) ;
     }
     


[2/6] jena git commit: Enable test - java bug has been fixed

Posted by an...@apache.org.
Enable test - java bug has been fixed


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/bb48c11d
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/bb48c11d
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/bb48c11d

Branch: refs/heads/master
Commit: bb48c11d393e8dc2b406cb547a874838e5480902
Parents: b64e310
Author: Andy Seaborne <an...@apache.org>
Authored: Mon Jan 30 09:58:09 2017 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Feb 8 09:34:45 2017 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/jena/tdb/store/DateTimeNode.java | 5 -----
 .../src/test/java/org/apache/jena/tdb/store/TestNodeId.java   | 7 ++++---
 2 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/bb48c11d/jena-tdb/src/main/java/org/apache/jena/tdb/store/DateTimeNode.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/store/DateTimeNode.java b/jena-tdb/src/main/java/org/apache/jena/tdb/store/DateTimeNode.java
index c5c2c20..1ce79c9 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/store/DateTimeNode.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/store/DateTimeNode.java
@@ -134,11 +134,6 @@ public class DateTimeNode
         lex = lex.trim() ;
         
         boolean containsZ = (lex.indexOf('Z') > 0 ) ;
-        
-        // Bug in Java 1.6 (build 5 at least)
-        // T24:00:00 not accepted.
-        // See also TestNodeId.nodeId_date_time_7
-        
         XMLGregorianCalendar xcal = datatypeFactory.newXMLGregorianCalendar(lex) ;
         
         if ( xcal.getFractionalSecond() != null )

http://git-wip-us.apache.org/repos/asf/jena/blob/bb48c11d/jena-tdb/src/test/java/org/apache/jena/tdb/store/TestNodeId.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/org/apache/jena/tdb/store/TestNodeId.java b/jena-tdb/src/test/java/org/apache/jena/tdb/store/TestNodeId.java
index c4d5bfd..be1b64b 100644
--- a/jena-tdb/src/test/java/org/apache/jena/tdb/store/TestNodeId.java
+++ b/jena-tdb/src/test/java/org/apache/jena/tdb/store/TestNodeId.java
@@ -152,9 +152,10 @@ public class TestNodeId extends BaseTest
     @Test public void nodeId_dateTime_06()
     { test("'2008-04-28T15:36:05.450'^^xsd:dateTime", "'2008-04-28T15:36:05.45'^^xsd:dateTime") ; }
 
-    // Java bug: T24:00:00 not accepted by DatatypeFactory.newXMLGregorianCalendar(lex)
-//    @Test public void nodeId_dateTime_07()
-//    { test("'2008-04-28T24:00:00'^^xsd:dateTime", NodeFactory.parseNode("'2008-04-29T00:00:00'^^xsd:dateTime")) ; }
+    // Old Java bug, now fixed: T24:00:00 not accepted by DatatypeFactory.newXMLGregorianCalendar(lex)
+    // Note the Jena value is an XSDDateTime so it retains the "24"/"00" next day distinction. 
+    @Test public void nodeId_dateTime_07()
+    { test("'2008-04-28T24:00:00'^^xsd:dateTime") ; }
     
     // Out of range.
     @Test public void nodeId_dateTime_08()


[5/6] jena git commit: Comment out unused code for unimplemented feature.

Posted by an...@apache.org.
Comment out unused code for unimplemented feature.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/171d16a0
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/171d16a0
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/171d16a0

Branch: refs/heads/master
Commit: 171d16a0a8478704281060084bfb057d690c0ee1
Parents: c761b91
Author: Andy Seaborne <an...@apache.org>
Authored: Thu Feb 2 16:06:33 2017 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Feb 8 09:36:16 2017 +0000

----------------------------------------------------------------------
 jena-cmds/src/main/java/riotcmd/CmdLangParse.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/171d16a0/jena-cmds/src/main/java/riotcmd/CmdLangParse.java
----------------------------------------------------------------------
diff --git a/jena-cmds/src/main/java/riotcmd/CmdLangParse.java b/jena-cmds/src/main/java/riotcmd/CmdLangParse.java
index b9a4413..e58bcd9 100644
--- a/jena-cmds/src/main/java/riotcmd/CmdLangParse.java
+++ b/jena-cmds/src/main/java/riotcmd/CmdLangParse.java
@@ -42,7 +42,6 @@ import org.apache.jena.query.ARQ ;
 import org.apache.jena.riot.* ;
 import org.apache.jena.riot.lang.LabelToNode ;
 import org.apache.jena.riot.lang.StreamRDFCounting ;
-import org.apache.jena.riot.out.NodeToLabel ;
 import org.apache.jena.riot.process.inf.InfFactory ;
 import org.apache.jena.riot.process.inf.InferenceSetupRDFS ;
 import org.apache.jena.riot.system.* ;
@@ -257,9 +256,9 @@ public abstract class CmdLangParse extends CmdGeneral
         // Also, as URI.
         final boolean labelsAsGiven = false ;
 
-        NodeToLabel labels = SyntaxLabels.createNodeToLabel() ;
-        if ( labelsAsGiven )
-            labels = NodeToLabel.createBNodeByLabelEncoded() ;
+//        NodeToLabel labels = SyntaxLabels.createNodeToLabel() ;
+//        if ( labelsAsGiven )
+//            labels = NodeToLabel.createBNodeByLabelEncoded() ;
         
         StreamRDF s = outputStream ; 
         if ( setup != null )