jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rve...@apache.org
Subject [16/19] jena git commit: Robust against RDF 1.0 and RDF 1.1
Date Mon, 01 Dec 2014 16:04:00 GMT
Robust against RDF 1.0 and RDF 1.1

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

Branch: refs/heads/hadoop-rdf
Commit: e17f8b8f24cd8e3560c21b092f7aa544aa3d39d1
Parents: cbdb84e
Author: Andy Seaborne <andy@apache.org>
Authored: Sun Nov 30 14:31:10 2014 +0000
Committer: Andy Seaborne <andy@apache.org>
Committed: Sun Nov 30 14:31:10 2014 +0000

----------------------------------------------------------------------
 .../src/main/java/com/hp/hpl/jena/sparql/expr/NodeValue.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/e17f8b8f/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/NodeValue.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/NodeValue.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/NodeValue.java
index b7180f6..8e2c71d 100644
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/NodeValue.java
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/NodeValue.java
@@ -96,6 +96,7 @@ import com.hp.hpl.jena.sparql.graph.NodeConst ;
 import com.hp.hpl.jena.sparql.graph.NodeTransform ;
 import com.hp.hpl.jena.sparql.serializer.SerializationContext ;
 import com.hp.hpl.jena.sparql.util.* ;
+import com.hp.hpl.jena.vocabulary.RDF ;
 
 public abstract class NodeValue extends ExprNode
 {
@@ -980,7 +981,7 @@ public abstract class NodeValue extends ExprNode
             // Not a literal - no value to extract
             return new NodeValueNode(node) ;
 
-        boolean hasLangTag = ( node.getLiteralLanguage() != null && ! node.getLiteralLanguage().equals(""))
;
+        boolean hasLangTag = NodeUtils.isLangString(node) ;
         boolean isPlainLiteral = ( node.getLiteralDatatypeURI() == null && ! hasLangTag
) ; 
             
         if ( isPlainLiteral )
@@ -988,7 +989,8 @@ public abstract class NodeValue extends ExprNode
 
         if ( hasLangTag )
         {
-            if ( node.getLiteralDatatypeURI() != null )
+            // Works for RDF 1.0 and RDF 1.1
+            if ( node.getLiteralDatatype() != null && ! RDF.dtLangString.equals(node.getLiteralDatatype())
)
             {
                 if ( NodeValue.VerboseWarnings )
                     Log.warn(NodeValue.class, "Lang tag and datatype (datatype ignored)")
;


Mime
View raw message