jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rve...@apache.org
Subject [25/48] jena git commit: Add constant for rdf:langString
Date Tue, 25 Nov 2014 16:26:47 GMT
Add constant for rdf:langString

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

Branch: refs/heads/hadoop-rdf
Commit: ee2ec7965be9a88290ccf26904e196e066c6a921
Parents: 909f0e1
Author: Andy Seaborne <andy@apache.org>
Authored: Fri Nov 21 16:50:55 2014 +0000
Committer: Andy Seaborne <andy@apache.org>
Committed: Fri Nov 21 16:50:55 2014 +0000

----------------------------------------------------------------------
 .../com/hp/hpl/jena/sparql/expr/nodevalue/NodeFunctions.java   | 2 +-
 .../src/main/java/com/hp/hpl/jena/sparql/graph/NodeConst.java  | 4 ++--
 .../java/com/hp/hpl/jena/sparql/expr/TestNodeFunctions.java    | 6 +++---
 jena-core/src/main/java/com/hp/hpl/jena/vocabulary/RDF.java    | 4 ++++
 4 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/ee2ec796/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeFunctions.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeFunctions.java
b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeFunctions.java
index a83b333..94013ff 100644
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeFunctions.java
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeFunctions.java
@@ -181,7 +181,7 @@ public class NodeFunctions {
         if ( plainLiteral ) {
             boolean simpleLiteral = (node.getLiteralLanguage() == null || node.getLiteralLanguage().equals(""))
;
             if ( !simpleLiteral )
-                return NodeConst.dtRDFlangString ;
+                return NodeConst.rdfLangString ;
             return XSD.xstring.asNode() ;
         }
         return NodeFactory.createURI(s) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/ee2ec796/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/NodeConst.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/NodeConst.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/NodeConst.java
index 940fc1d..a6f56eb 100644
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/NodeConst.java
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/graph/NodeConst.java
@@ -24,6 +24,7 @@ import com.hp.hpl.jena.graph.NodeFactory ;
 import com.hp.hpl.jena.vocabulary.OWL ;
 import com.hp.hpl.jena.vocabulary.RDF ;
 
+/** Some node constants */
 public class NodeConst
 {
     public static final Node nodeTrue       = NodeFactory.createLiteral("true", null,  XSDDatatype.XSDboolean)
; 
@@ -41,6 +42,5 @@ public class NodeConst
     public static final Node nodeANY        = Node.ANY ;
     
     public static final Node nodeOwlSameAs  = OWL.sameAs.asNode() ;
-    public static final Node dtRDFlangString = NodeFactory.createURI(RDF.getURI()+"langString")
;
-
+    public static final Node rdfLangString  = RDF.Nodes.langString ;
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/ee2ec796/jena-arq/src/test/java/com/hp/hpl/jena/sparql/expr/TestNodeFunctions.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/com/hp/hpl/jena/sparql/expr/TestNodeFunctions.java b/jena-arq/src/test/java/com/hp/hpl/jena/sparql/expr/TestNodeFunctions.java
index 8c1803e..3e0bd4e 100644
--- a/jena-arq/src/test/java/com/hp/hpl/jena/sparql/expr/TestNodeFunctions.java
+++ b/jena-arq/src/test/java/com/hp/hpl/jena/sparql/expr/TestNodeFunctions.java
@@ -144,13 +144,13 @@ public class TestNodeFunctions extends BaseTest {
         NodeValue nv = NodeValue.makeNode("abc", "fr", (String)null) ;
         // SPARQL 1.0
         // try {
-        // NodeValue r = NodeFunctions.datatype(nv) ;
-        // fail("Expect a type exception but call succeeded") ;
+        //   NodeValue r = NodeFunctions.datatype(nv) ;
+        //   fail("Expect a type exception but call succeeded") ;
         // }
         // catch (ExprTypeException ex) {}
         // SPARQL 1.1 / RDF 1.1
         NodeValue r = NodeFunctions.datatype(nv) ;
-        NodeValue e = NodeValue.makeNode(NodeConst.dtRDFlangString) ;
+        NodeValue e = NodeValue.makeNode(NodeConst.rdfLangString) ;
         assertEquals(e, r) ;
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/ee2ec796/jena-core/src/main/java/com/hp/hpl/jena/vocabulary/RDF.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/com/hp/hpl/jena/vocabulary/RDF.java b/jena-core/src/main/java/com/hp/hpl/jena/vocabulary/RDF.java
index 51b51fd..2241c91 100644
--- a/jena-core/src/main/java/com/hp/hpl/jena/vocabulary/RDF.java
+++ b/jena-core/src/main/java/com/hp/hpl/jena/vocabulary/RDF.java
@@ -59,6 +59,9 @@ public class RDF{
     public static final Property object = property( "object" );
     public static final Property type = property( "type" );
     public static final Property value = property( "value" );
+    
+    // RDF 1.1 - the datatype of language strings
+    public static final Resource langString = resource("langString") ;
 
     /**
         The same items of vocabulary, but at the Node level, parked inside a
@@ -80,6 +83,7 @@ public class RDF{
         public static final Node object = RDF.object.asNode();
         public static final Node type = RDF.type.asNode();
         public static final Node value = RDF.value.asNode();
+        public static final Node langString = RDF.langString.asNode();
         }
 
 }


Mime
View raw message