/*
 * 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 org.apache.jena.sparql.graph;

import org.apache.jena.datatypes.RDFDatatype ;
import org.apache.jena.datatypes.xsd.XSDDatatype ;
import org.apache.jena.graph.Node ;
import org.apache.jena.graph.NodeFactory ;
import org.apache.jena.system.JenaSystem ;
import org.apache.jena.vocabulary.OWL ;
import org.apache.jena.vocabulary.RDF ;

/** Some node constants */
public class NodeConst
{
    static { JenaSystem.init(); }
    public static final Node nodeTrue       = NodeFactory.createLiteral("true", XSDDatatype.XSDboolean) ; 
    public static final Node nodeFalse      = NodeFactory.createLiteral("false",XSDDatatype.XSDboolean) ; 
    public static final Node nodeZero       = NodeFactory.createLiteral("0",    XSDDatatype.XSDinteger) ;
    public static final Node nodeOne        = NodeFactory.createLiteral("1",    XSDDatatype.XSDinteger) ;
    public static final Node nodeTwo        = NodeFactory.createLiteral("2",    XSDDatatype.XSDinteger) ;
    public static final Node nodeMinusOne   = NodeFactory.createLiteral("-1",   XSDDatatype.XSDinteger) ;
    public static final Node emptyString    = NodeFactory.createLiteral("") ;
    
    public static final Node nodeRDFType    = RDF.Nodes.type ;
    public static final Node nodeFirst      = RDF.Nodes.first ;
    public static final Node nodeRest       = RDF.Nodes.rest ;
    public static final Node nodeNil        = RDF.Nodes.nil ;
    public static final Node nodeANY        = Node.ANY ;
    
    // Avoid OWL.sameAs.asNode() ;
    public static final Node nodeOwlSameAs          = OWL.sameAs.asNode() ; // NodeFactory.createURI("http://www.w3.org/2002/07/owl#sameAs") ;
    public static final Node rdfLangString          = RDF.Nodes.langString ;
    public static final RDFDatatype dtLangString    = RDF.dtLangString ;
}

@@ -1020,51 +1020,8 @@
 y ;%0A
-import org.apache.jena.system.JenaSystem ;%0A
 impo
@@ -1157,37 +1157,231 @@
     
-static %7B JenaSystem.init(); %7D
+private static Node literal(String lex, RDFDatatype dt) %7B%0A        return NodeFactory.createLiteral(lex, dt) ;%0A    %7D%0A    %0A    private static Node uri(String uriStr) %7B%0A        return NodeFactory.createURI(uriStr) ;%0A    %7D%0A    
 %0A   
@@ -1423,35 +1423,17 @@
       = 
-NodeFactory.createL
+l
 iteral(%22
@@ -1438,16 +1438,17 @@
 (%22true%22,
+ 
  XSDData
@@ -1513,35 +1513,17 @@
       = 
-NodeFactory.createL
+l
 iteral(%22
@@ -1529,16 +1529,17 @@
 %22false%22,
+ 
 XSDDatat
@@ -1603,35 +1603,17 @@
       = 
-NodeFactory.createL
+l
 iteral(%22
@@ -1615,16 +1615,17 @@
 ral(%220%22,
+ 
     XSDD
@@ -1692,35 +1692,17 @@
       = 
-NodeFactory.createL
+l
 iteral(%22
@@ -1704,16 +1704,17 @@
 ral(%221%22,
+ 
     XSDD
@@ -1781,35 +1781,17 @@
       = 
-NodeFactory.createL
+l
 iteral(%22
@@ -1793,16 +1793,17 @@
 ral(%222%22,
+ 
     XSDD
@@ -1870,35 +1870,17 @@
 One   = 
-NodeFactory.createL
+l
 iteral(%22
@@ -1883,16 +1883,17 @@
 al(%22-1%22,
+ 
    XSDDa
@@ -1992,24 +1992,102 @@
 (%22%22) ;%0A    %0A
+    // It should be safe to use RDF.Nodes.%0A    // Falback code %22just in case%22%0A
     public s
@@ -2136,16 +2136,41 @@
 s.type ;
+  //uri(RDF.uri+%22type%22) ;
 %0A    pub
@@ -2221,24 +2221,49 @@
 odes.first ;
+ //uri(RDF.uri+%22first%22) ;
 %0A    public 
@@ -2313,16 +2313,41 @@
 s.rest ;
+  //uri(RDF.uri+%22rest%22) ;
 %0A    pub
@@ -2398,16 +2398,41 @@
 odes.nil
+;    //uri(RDF.uri+%22nil%22)
  ;%0A    p
@@ -2492,43 +2492,8 @@
    %0A
-    // Avoid OWL.sameAs.asNode() ;%0A
     
@@ -2566,17 +2566,16 @@
 e() ; //
- 
 NodeFact

Tidy up file - add notes about initialization.