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 2015/04/23 21:56:39 UTC
[23/51] [partial] jena git commit: Rename com.hp.hpl.jena.* as
org.apache.jena.*
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorBase.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorBase.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorBase.java
deleted file mode 100644
index f576f0a..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorBase.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.aggregate;
-
-import java.util.HashMap ;
-import java.util.Locale ;
-import java.util.Map ;
-
-import org.apache.jena.atlas.io.IndentedLineBuffer ;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.ARQInternalErrorException ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.expr.Expr ;
-import com.hp.hpl.jena.sparql.expr.ExprList ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.graph.NodeTransform ;
-import com.hp.hpl.jena.sparql.serializer.SerializationContext ;
-import com.hp.hpl.jena.sparql.sse.writers.WriterExpr ;
-import com.hp.hpl.jena.sparql.util.ExprUtils ;
-
-/** Aggregate that does everything except the per-group aggregation that is needed for each operation */
-public abstract class AggregatorBase implements Aggregator
-{
- // Aggregator -- handles one aggregation over one group, and is the syntax unit.
-
- // AggregateFactory -- delays the creating of Aggregator so multiple mentions over the same group gives the same Aggregator
-
- // Accumulator -- the per-group, per-key accumulator for the aggregate
- // queries track their aggregators so if one is used twice, the calculataion is only done once.
- // For distinct, that means only uniquefier.
-
- // Built-ins: COUNT, SUM, MIN, MAX, AVG, GROUP_CONCAT, and SAMPLE
- // but COUNT(*) and COUNT(Expr) are different beasts
- // each in DISTINCT and non-DISTINCT versions
-
- protected final String name ;
- protected final boolean isDistinct ;
- protected final ExprList exprList ;
-
- protected AggregatorBase(String name, boolean isDistinct, Expr expr) {
- this(name, isDistinct, new ExprList(expr)) ;
- }
-
- protected AggregatorBase(String name, boolean isDistinct, ExprList exprList) {
- this.name = name ;
- this.isDistinct = isDistinct ;
- this.exprList = exprList ;
- }
-
- private Map<Binding, Accumulator> buckets = new HashMap<>() ; // Bindingkey => Accumulator
-
- @Override
- public abstract Accumulator createAccumulator() ;
-
- @Override
- public abstract Node getValueEmpty() ;
-
- public Node getValue(Binding key)
- {
- Accumulator acc = buckets.get(key) ;
- if ( acc == null )
- throw new ARQInternalErrorException("Null for accumulator") ;
- NodeValue nv = acc.getValue();
- if ( nv == null )
- return null ;
- return nv.asNode() ;
- }
-
- @Override
- public String key() { return toPrefixString() ; }
-
- @Override
- public final Aggregator copyTransform(NodeTransform transform)
- {
- ExprList e = getExprList() ;
- if ( e != null )
- e = e.applyNodeTransform(transform) ;
- return copy(e) ;
- }
-
- /** Many aggergate use a single expression.
- * This convebnience operation gets the expression if there is exactly one.
- */
- protected Expr getExpr() {
- if ( exprList != null && exprList.size() == 1 )
- return getExprList().get(0) ;
- return null ;
- }
-
- @Override
- public ExprList getExprList() { return exprList ; }
-
- @Override
- public String getName() { return name ; }
-
- @Override
- public String toString() { return asSparqlExpr(null) ; }
-
- @Override
- public String asSparqlExpr(SerializationContext sCxt) {
- IndentedLineBuffer x = new IndentedLineBuffer() ;
- x.append(getName()) ;
- x.append("(") ;
- if ( isDistinct )
- x.append("DISTINCT ") ;
- if ( getExprList() != null )
- ExprUtils.fmtSPARQL(x, getExprList(), sCxt) ;
- x.append(")") ;
- return x.asString() ;
- }
-
- @Override
- public String toPrefixString() {
- IndentedLineBuffer x = new IndentedLineBuffer() ;
- x.append("(") ;
- x.append(getName().toLowerCase(Locale.ROOT)) ;
- x.incIndent();
- if ( isDistinct )
- x.append(" distinct") ;
- for ( Expr e : getExprList() ) {
- x.append(" ");
- WriterExpr.output(x, e, null) ;
- }
- x.decIndent();
- x.append(")") ;
- return x.asString() ;
- }
-
- @Override
- public abstract int hashCode() ;
-
- @Override
- public abstract boolean equals(Object other) ;
-
- protected static final int HC_AggAvg = 0x170 ;
- protected static final int HC_AggAvgDistinct = 0x171 ;
-
- protected static final int HC_AggCount = 0x172 ;
- protected static final int HC_AggCountDistinct = 0x173 ;
-
- protected static final int HC_AggCountVar = 0x174 ;
- protected static final int HC_AggCountVarDistinct = 0x175 ;
-
- protected static final int HC_AggMin = 0x176 ;
- protected static final int HC_AggMinDistinct = 0x177 ;
-
- protected static final int HC_AggMax = 0x178 ;
- protected static final int HC_AggMaxDistinct = 0x179 ;
-
- protected static final int HC_AggSample = 0x17A ;
- protected static final int HC_AggSampleDistinct = 0x17B ;
-
- protected static final int HC_AggSum = 0x17C ;
- protected static final int HC_AggSumDistinct = 0x17D ;
-
- protected static final int HC_AggGroupConcat = 0x17E ;
- protected static final int HC_AggGroupConcatDistinct = 0x17F ;
-
- protected static final int HC_AggNull = 0x180 ;
- protected static final int HC_AggCustom = 0x181 ;
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorFactory.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorFactory.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorFactory.java
deleted file mode 100644
index 8e77371..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggregatorFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.aggregate ;
-
-import org.apache.jena.atlas.lib.NotImplemented ;
-import org.apache.jena.atlas.logging.Log ;
-
-import com.hp.hpl.jena.sparql.expr.Expr ;
-import com.hp.hpl.jena.sparql.expr.ExprList ;
-
-public class AggregatorFactory {
- public static Aggregator createCount(boolean distinct) {
- return distinct ? new AggCountDistinct() : new AggCount() ;
- }
-
- public static Aggregator createCountExpr(boolean distinct, Expr expr) {
- return distinct ? new AggCountVarDistinct(expr) : new AggCountVar(expr) ;
- }
-
- public static Aggregator createSum(boolean distinct, Expr expr) {
- return distinct ? new AggSumDistinct(expr) : new AggSum(expr) ;
- }
-
- public static Aggregator createMin(boolean distinct, Expr expr) {
- // Only remember it's DISTINCT for getting the printing right.
- return distinct ? new AggMinDistinct(expr) : new AggMin(expr) ;
- }
-
- public static Aggregator createMax(boolean distinct, Expr expr) {
- return distinct ? new AggMaxDistinct(expr) : new AggMax(expr) ;
- }
-
- public static Aggregator createAvg(boolean distinct, Expr expr) {
- return distinct ? new AggAvgDistinct(expr) : new AggAvg(expr) ;
- }
-
- public static Aggregator createSample(boolean distinct, Expr expr) {
- return distinct ? new AggSampleDistinct(expr) : new AggSample(expr) ;
- }
-
- public static Aggregator createGroupConcat(boolean distinct, Expr expr, String separator, ExprList orderedBy) {
- if ( orderedBy != null && !orderedBy.isEmpty() )
- throw new NotImplemented("GROUP_CONCAT / ORDER BY not implemented yet") ;
- return distinct ? new AggGroupConcatDistinct(expr, separator) : new AggGroupConcat(expr, separator) ;
- }
-
- public static Aggregator createAggNull() {
- return new AggNull() ;
- }
-
- public static Aggregator createCustom(String iri, ExprList a) {
- if ( ! AggregateRegistry.isRegistered(iri) )
- Log.warn(AggregatorFactory.class, "Not registered: custom aggregate <"+iri+">") ;
- return new AggCustom(iri, a) ;
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/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
deleted file mode 100644
index 70e05a3..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeFunctions.java
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue ;
-
-import java.util.Iterator ;
-import java.util.UUID ;
-
-import org.apache.jena.atlas.logging.Log ;
-import org.apache.jena.iri.IRI ;
-import org.apache.jena.iri.IRIFactory ;
-import org.apache.jena.iri.Violation ;
-
-import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.graph.NodeFactory ;
-import com.hp.hpl.jena.sparql.expr.ExprEvalException ;
-import com.hp.hpl.jena.sparql.expr.ExprTypeException ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.graph.NodeConst ;
-import com.hp.hpl.jena.sparql.util.FmtUtils ;
-import com.hp.hpl.jena.sparql.util.NodeUtils ;
-import com.hp.hpl.jena.vocabulary.XSD ;
-
-/**
- * Implementation of node-centric functions.
- */
-public class NodeFunctions {
- private static final NodeValue xsdString = NodeValue.makeNode(XSD.xstring.asNode()) ;
-
- // Helper functions
- /**
- * check and get a string (may be a simple literal, literal with language
- * tag or an XSD string).
- */
- public static Node checkAndGetStringLiteral(String label, NodeValue nv) {
- Node n = nv.asNode() ;
- if ( !n.isLiteral() )
- throw new ExprEvalException(label + ": Not a literal: " + nv) ;
- String lang = n.getLiteralLanguage() ;
-
- if ( NodeUtils.isLangString(n) )
- // Language tag. Legal.
- return n ;
-
- // No language tag : either no datatype or a datatype of xsd:string
- // Includes the case of rdf:langString and no language ==> Illegal as a compatible string.
-
- if ( nv.isString() )
- return n ;
- throw new ExprEvalException(label + ": Not a string literal: " + nv) ;
- }
-
- /**
- * Check for string operations with primary first arg and second second arg
- * (e.g. CONTAINS). The arguments are not used in the same way and the check
- * operation is not symmetric.
- * <li> "abc"@en is compatible with "abc"
- * <li> "abc" is NOT compatible with "abc"@en
- */
- public static void checkTwoArgumentStringLiterals(String label, NodeValue arg1, NodeValue arg2) {
-
- /* Quote the spec:
- * Compatibility of two arguments is defined as:
- * The arguments are simple literals or literals typed as xsd:string
- * The arguments are plain literals with identical language tags
- * The first argument is a plain literal with language tag and the second argument is a simple literal or literal typed as xsd:string
- */
-
- Node n1 = checkAndGetStringLiteral(label, arg1) ;
- Node n2 = checkAndGetStringLiteral(label, arg2) ;
- String lang1 = n1.getLiteralLanguage() ;
- String lang2 = n2.getLiteralLanguage() ;
- if ( lang1 == null )
- lang1 = "" ;
- if ( lang2 == null )
- lang2 = "" ;
-
- // Case 1
- if ( lang1.equals("") ) {
- if ( lang2.equals("") )
- return ;
- throw new ExprEvalException(label + ": Incompatible: " + arg1 + " and " + arg2) ;
- }
-
- // Case 2
- if ( lang1.equalsIgnoreCase(lang2) )
- return ;
-
- // Case 3
- if ( lang2.equals("") )
- return ;
-
- throw new ExprEvalException(label + ": Incompatible: " + arg1 + " and " + arg2) ;
-
- // ----------
-
-// if ( lang1.equals("") && !lang2.equals("") )
-// throw new ExprEvalException(label + ": Incompatible: " + arg1 + " and " + arg2) ;
-//
-//
-//
-// if ( n1.getLiteralDatatype() != null ) {
-// // n1 is an xsd string by checkAndGetString
-// if ( XSDDatatype.XSDstring.equals(n2.getLiteralDatatypeURI()) )
-// return ;
-// if ( n2.getLiteralLanguage().equals("") )
-// return ;
-// throw new ExprEvalException(label + ": Incompatible: " + arg1 + " and " + arg2) ;
-// }
-//
-// // Incompatible?
-// // arg1 simple or xsd:string, arg2 has a lang.
-// // arg1 with lang, arg2 has a different lang.
-// if ( !lang1.equals("") && (!lang2.equals("") && !lang1.equals(lang2)) )
-// throw new ExprEvalException(label + ": Incompatible: " + arg1 + " and " + arg2) ;
- }
-
- // -------- sameTerm
-
- public static NodeValue sameTerm(NodeValue nv1, NodeValue nv2) {
- return NodeValue.booleanReturn(sameTerm(nv1.asNode(), nv2.asNode())) ;
- }
-
- public static boolean sameTerm(Node n1, Node n2) {
- if ( n1.equals(n2) )
- return true ;
- if ( n1.isLiteral() && n2.isLiteral() ) {
- // But language tags are case insensitive.
- String lang1 = n1.getLiteralLanguage() ;
- String lang2 = n2.getLiteralLanguage() ;
-
- if ( !lang1.equals("") && lang1.equalsIgnoreCase(lang2) ) {
- // Two language tags, equal by case insensitivity.
- boolean b = n1.getLiteralLexicalForm().equals(n2.getLiteralLexicalForm()) ;
- if ( b )
- return true ;
- }
- }
- return false ;
- }
-
- // -------- RDFterm-equals
-
- public static NodeValue rdfTermEquals(NodeValue nv1, NodeValue nv2) {
- return NodeValue.booleanReturn(rdfTermEquals(nv1.asNode(), nv2.asNode())) ;
- }
-
- // Exact as defined by SPARQL spec.
- public static boolean rdfTermEquals(Node n1, Node n2) {
- if ( n1.equals(n2) )
- return true ;
-
- if ( n1.isLiteral() && n2.isLiteral() ) {
- // Two literals, may be sameTerm by language tag case insensitivity.
- String lang1 = n1.getLiteralLanguage() ;
- String lang2 = n2.getLiteralLanguage() ;
-
- if ( !lang1.equals("") && lang1.equalsIgnoreCase(lang2) ) {
- // Two language tags, equal by case insensitivity.
- boolean b = n1.getLiteralLexicalForm().equals(n2.getLiteralLexicalForm()) ;
- if ( b )
- return true ;
- }
- // Two literals, different terms, different language tags.
- NodeValue.raise(new ExprEvalException("Mismatch in RDFterm-equals: " + n1 + ", " + n2)) ;
- }
- // One or both not a literal.
- return false ;
- }
-
- // -------- str
- public static NodeValue str(NodeValue nv) {
- return NodeValue.makeString(str(nv.asNode())) ;
- }
-
- public static String str(Node node) {
- if ( node.isLiteral() )
- return node.getLiteral().getLexicalForm() ;
- if ( node.isURI() )
- return node.getURI() ;
- // if ( node.isBlank() ) return node.getBlankNodeId().getLabelString() ;
- // if ( node.isBlank() ) return "" ;
- if ( node.isBlank() )
- NodeValue.raise(new ExprTypeException("Blank node: " + node)) ;
-
- NodeValue.raise(new ExprEvalException("Not a string: " + node)) ;
- return "[undef]" ;
- }
-
- // -------- datatype
- public static NodeValue datatype(NodeValue nv) {
- return NodeValue.makeNode(datatype(nv.asNode())) ;
- }
-
- public static Node datatype(Node node) {
- if ( !node.isLiteral() ) {
- NodeValue.raise(new ExprTypeException("datatype: Not a literal: " + node)) ;
- return null ;
- }
-
- String s = node.getLiteralDatatypeURI() ;
- boolean plainLiteral = (s == null || s.equals("")) ;
-
- if ( plainLiteral ) {
- boolean simpleLiteral = (node.getLiteralLanguage() == null || node.getLiteralLanguage().equals("")) ;
- if ( !simpleLiteral )
- return NodeConst.rdfLangString ;
- return XSD.xstring.asNode() ;
- }
- return NodeFactory.createURI(s) ;
- }
-
- // -------- lang
-
- public static NodeValue lang(NodeValue nv) {
- return NodeValue.makeString(lang(nv.asNode())) ;
- }
-
- public static String lang(Node node) {
- if ( !node.isLiteral() )
- NodeValue.raise(new ExprTypeException("lang: Not a literal: " + FmtUtils.stringForNode(node))) ;
-
- String s = node.getLiteralLanguage() ;
- if ( s == null )
- s = "" ;
- return s ;
- }
-
- // -------- langMatches
- public static NodeValue langMatches(NodeValue nv, NodeValue nvPattern) {
- return langMatches(nv, nvPattern.getString()) ;
- }
-
- public static NodeValue langMatches(NodeValue nv, String langPattern) {
- Node node = nv.asNode() ;
- if ( !node.isLiteral() ) {
- NodeValue.raise(new ExprTypeException("langMatches: not a literal: " + node)) ;
- return null ;
- }
-
- String nodeLang = node.getLiteralLexicalForm() ;
-
- if ( langPattern.equals("*") ) {
- if ( nodeLang == null || nodeLang.equals("") )
- return NodeValue.FALSE ;
- return NodeValue.TRUE ;
- }
-
- // See RFC 3066 (it's "tag (-tag)*)"
-
- String[] langElts = nodeLang.split("-") ;
- String[] langRangeElts = langPattern.split("-") ;
-
- /*
- * Here is the logic to compare language code. There is a match if the
- * language matches the parts of the pattern - the language may be
- * longer than the pattern.
- */
-
- /*
- * RFC 4647 basic filtering.
- *
- * To do extended: 1. Remove any -*- (but not *-) 2. Compare primary
- * tags. 3. Is the remaining range a subsequence of the remaining
- * language tag?
- */
-
- // // Step one: remove "-*-" (but not "*-")
- // int j = 1 ;
- // for ( int i = 1 ; i < langRangeElts.length ; i++ )
- // {
- // String range = langRangeElts[i] ;
- // if ( range.equals("*") )
- // continue ;
- // langRangeElts[j] = range ;
- // j++ ;
- // }
- //
- // // Null fill any free space.
- // for ( int i = j ; i < langRangeElts.length ; i++ )
- // langRangeElts[i] = null ;
-
- // This is basic specific.
-
- if ( langRangeElts.length > langElts.length )
- // Lang tag longer than pattern tag => can't match
- return NodeValue.FALSE ;
- for ( int i = 0 ; i < langRangeElts.length ; i++ ) {
- String range = langRangeElts[i] ;
- if ( range == null )
- break ;
- // Language longer than range
- if ( i >= langElts.length )
- break ;
- String lang = langElts[i] ;
- if ( range.equals("*") )
- continue ;
- if ( !range.equalsIgnoreCase(lang) )
- return NodeValue.FALSE ;
- }
- return NodeValue.TRUE ;
- }
-
- // -------- isURI/isIRI
-
- public static NodeValue isIRI(NodeValue nv) {
- return NodeValue.booleanReturn(isIRI(nv.asNode())) ;
- }
-
- public static boolean isIRI(Node node) {
- if ( node.isURI() )
- return true ;
- return false ;
- }
-
- public static NodeValue isURI(NodeValue nv) {
- return NodeValue.booleanReturn(isIRI(nv.asNode())) ;
- }
-
- public static boolean isURI(Node node) {
- return isIRI(node) ;
- }
-
- // -------- isBlank
- public static NodeValue isBlank(NodeValue nv) {
- return NodeValue.booleanReturn(isBlank(nv.asNode())) ;
- }
-
- public static boolean isBlank(Node node) {
- return node.isBlank() ;
- }
-
- // -------- isLiteral
- public static NodeValue isLiteral(NodeValue nv) {
- return NodeValue.booleanReturn(isLiteral(nv.asNode())) ;
- }
-
- public static boolean isLiteral(Node node) {
- return node.isLiteral() ;
- }
-
- private static final IRIFactory iriFactory = IRIFactory.iriImplementation() ;
- public static boolean warningsForIRIs = false ;
-
- // -------- IRI
- public static NodeValue iri(NodeValue nv, String baseIRI) {
- if ( isIRI(nv.asNode()) )
- return nv ;
- Node n2 = iri(nv.asNode(), baseIRI) ;
- return NodeValue.makeNode(n2) ;
- }
-
- public static Node iri(Node nv, String baseIRI) {
- if ( nv.isURI() )
- return nv ;
-
- if ( nv.isBlank() ) {
- // Skolemization of blank nodes to IRIs : Don't ask, just don't ask.
- String x = nv.getBlankNodeLabel() ;
- return NodeFactory.createURI("_:" + x) ;
- }
-
- // Simple literal or xsd:string
- String str = simpleLiteralOrXSDString(nv) ;
- if ( str == null )
- throw new ExprEvalException("Can't make an IRI from " + nv) ;
-
- IRI iri = null ;
- String iriStr = nv.getLiteralLexicalForm() ;
-
- // Level of checking?
- if ( baseIRI != null ) {
- IRI base = iriFactory.create(baseIRI) ;
- iri = base.create(iriStr) ;
- } else
- iri = iriFactory.create(iriStr) ;
-
- if ( !iri.isAbsolute() )
- throw new ExprEvalException("Relative IRI string: " + iriStr) ;
- if ( warningsForIRIs && iri.hasViolation(false) ) {
- String msg = "unknown violation from IRI library" ;
- Iterator<Violation> iter = iri.violations(false) ;
- if ( iter.hasNext() ) {
- Violation viol = iter.next() ;
- msg = viol.getShortMessage() ;
- }
- Log.warn(NodeFunctions.class, "Bad IRI: " + msg + ": " + iri) ;
- }
- return NodeFactory.createURI(iri.toString()) ;
- }
-
- // The Jena version can vbe slow to inityailise (but is pure java)
-
- // private static UUIDFactory factory = new UUID_V4_Gen() ;
- // private static UUIDFactory factory = new UUID_V1_Gen() ;
- // public static NodeValue uuid()
- // {
- // JenaUUID uuid = factory.generate() ;
- // Node n = Node.createURI(uuid.asURN()) ;
- // return NodeValue.makeNode(n) ;
- // }
- //
- // public static NodeValue struuid()
- // {
- // JenaUUID uuid = factory.generate() ;
- // return NodeValue.makeString(uuid.asString()) ;
- // }
-
- public static NodeValue struuid() {
- return NodeValue.makeString(uuidString()) ;
- }
-
- public static NodeValue uuid() {
- String str = "urn:uuid:" + uuidString() ;
- Node n = NodeFactory.createURI(str) ;
- return NodeValue.makeNode(n) ;
- }
-
- private static String uuidString() {
- return UUID.randomUUID().toString() ;
- }
-
- private static String simpleLiteralOrXSDString(Node n) {
- if ( !n.isLiteral() )
- return null ;
-
- if ( n.getLiteralDatatype() == null ) {
- if ( n.getLiteralLanguage().equals("") )
- return n.getLiteralLexicalForm() ;
- } else if ( n.getLiteralDatatype().equals(XSDDatatype.XSDstring) )
- return n.getLiteralLexicalForm() ;
- return null ;
- }
-
- public static NodeValue strDatatype(NodeValue v1, NodeValue v2) {
- if ( !v1.isString() )
- throw new ExprEvalException("Not a string (arg 1): " + v1) ;
- if ( !v2.isIRI() )
- throw new ExprEvalException("Not an IRI (arg 2): " + v2) ;
-
- String lex = v1.asString() ;
- Node dt = v2.asNode() ;
- // Check?
-
- Node n = NodeFactory.createLiteral(lex, NodeFactory.getType(dt.getURI())) ;
- return NodeValue.makeNode(n) ;
- }
-
- public static NodeValue strLang(NodeValue v1, NodeValue v2) {
- if ( !v1.isString() )
- throw new ExprEvalException("Not a string (arg 1): " + v1) ;
- if ( !v2.isString() )
- throw new ExprEvalException("Not a string (arg 2): " + v2) ;
-
- String lex = v1.asString() ;
- String lang = v2.asString() ;
- // Check?
-
- Node n = NodeFactory.createLiteral(lex, lang) ;
- return NodeValue.makeNode(n) ;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueBoolean.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueBoolean.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueBoolean.java
deleted file mode 100644
index df1bb8c..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueBoolean.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.graph.NodeConst ;
-
-
-public class NodeValueBoolean extends NodeValue
-{
- boolean bool = false ;
-
- public NodeValueBoolean(boolean b) { super() ; bool = b ; }
- public NodeValueBoolean(boolean b, Node n) { super(n) ; bool = b ; }
-
- @Override
- public boolean isBoolean() { return true ; }
-
- @Override
- public boolean getBoolean() { return bool ; }
-
- @Override
- protected Node makeNode()
- { return bool ? NodeConst.nodeTrue : NodeConst.nodeFalse ; }
-
- @Override
- public String asString() { return toString() ; }
-
- @Override
- public String toString()
- { return bool ? "true" : "false" ; }
-
- @Override
- public void visit(NodeValueVisitor visitor) { visitor.visit(this) ; }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDT.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDT.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDT.java
deleted file mode 100644
index 71e0a1a..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDT.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDdate ;
-import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDdateTime ;
-import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDgDay ;
-import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDgMonth ;
-import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDgMonthDay ;
-import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDgYear ;
-import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDgYearMonth ;
-import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDtime ;
-
-import javax.xml.datatype.XMLGregorianCalendar ;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-
-public class NodeValueDT extends NodeValue
-{
- final private XMLGregorianCalendar datetime ;
-
- public NodeValueDT(String lex, Node n)
- {
- super(n) ;
- // Java bug : Java6 gMonth with a timezone of Z causes IllegalArgumnentException
- if ( XSDgMonth.equals(getNode().getLiteralDatatype()) )
- {
- if ( lex.endsWith("Z") )
- {
- lex = lex.substring(0, lex.length()-1) ;
- datetime = NodeValue.xmlDatatypeFactory.newXMLGregorianCalendar(lex) ;
- datetime.setTimezone(0) ;
- return ;
- }
- }
- datetime = NodeValue.xmlDatatypeFactory.newXMLGregorianCalendar(lex) ;
- }
-
- // 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()) ; }
- @Override
- public boolean isDate() { return XSDdate.equals(getNode().getLiteralDatatype()) ; }
- @Override
- public boolean isTime() { return XSDtime.equals(getNode().getLiteralDatatype()) ; }
- @Override
- public boolean isGYear() { return XSDgYear.equals(getNode().getLiteralDatatype()) ; }
- @Override
- public boolean isGYearMonth() { return XSDgYearMonth.equals(getNode().getLiteralDatatype()) ; }
- @Override
- public boolean isGMonth() { return XSDgMonth.equals(getNode().getLiteralDatatype()) ; }
- @Override
- public boolean isGMonthDay() { return XSDgMonthDay.equals(getNode().getLiteralDatatype()) ; }
- @Override
- public boolean isGDay() { return XSDgDay.equals(getNode().getLiteralDatatype()) ; }
-
- @Override
- public XMLGregorianCalendar getDateTime() { return (XMLGregorianCalendar)datetime.clone() ; }
-
-
- @Override
- protected Node makeNode()
- {
- return null ;
- }
-
- @Override
- public void visit(NodeValueVisitor visitor)
- { visitor.visit(this) ; }
-}
-
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDecimal.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDecimal.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDecimal.java
deleted file mode 100644
index f154c35..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDecimal.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-import java.math.BigDecimal ;
-
-import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.graph.NodeFactory ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.util.Utils ;
-
-
-public class NodeValueDecimal extends NodeValue
-{
- BigDecimal decimal ;
-
- public NodeValueDecimal(BigDecimal d) { decimal = d ; }
- public NodeValueDecimal(BigDecimal d, Node n) { super(n) ; decimal = d ; }
-
- @Override
- public boolean isNumber() { return true ; }
- @Override
- public boolean isDecimal() { return true ; }
- @Override
- public boolean isFloat() { return true ; }
- @Override
- public boolean isDouble() { return true ; }
-
- @Override
- public BigDecimal getDecimal() { return decimal ; }
- @Override
- public float getFloat() { return decimal.floatValue() ; }
- @Override
- public double getDouble() { return decimal.doubleValue() ; }
-
- @Override
- protected Node makeNode()
- {
- int s = decimal.scale() ;
- return NodeFactory.createLiteral(Utils.stringForm(decimal), XSDDatatype.XSDdecimal) ;
- }
-
- @Override
- public String asString() { return toString() ; }
-
- @Override
- public String toString()
- {
- // Preserve lexical form.
- if ( getNode() != null ) return super.asString() ;
- return Utils.stringForm(decimal) ;
- }
-
- @Override
- public void visit(NodeValueVisitor visitor) { visitor.visit(this) ; }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDouble.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDouble.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDouble.java
deleted file mode 100644
index fbab82a..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDouble.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-//import java.math.BigDecimal;
-
-import java.math.BigDecimal ;
-
-import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.graph.NodeFactory ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.util.Utils ;
-
-
-public class NodeValueDouble extends NodeValue
-{
- double value = Double.NaN ;
-
- public NodeValueDouble(double d) { super() ; value = d ; }
- public NodeValueDouble(double d, Node n) { super(n) ; value = d ; }
-
- @Override
- public boolean isNumber() { return true ; }
- @Override
- public boolean isDouble() { return true ; }
-
- // Does not provide getFloat
- @Override
- public double getDouble() { return value ; }
-
- @Override
- public BigDecimal getDecimal() { return BigDecimal.valueOf(value) ; }
-
- @Override
- protected Node makeNode()
- { return NodeFactory.createLiteral(Utils.stringForm(value), XSDDatatype.XSDdouble) ; }
-
- @Override
- public String asString() { return toString() ; }
-
- @Override
- public String toString()
- {
- // Preserve lexical form
- if ( getNode() != null ) return super.asString() ;
- return Utils.stringForm(value) ;
- }
-
- @Override
- public void visit(NodeValueVisitor visitor) { visitor.visit(this) ; }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDuration.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDuration.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDuration.java
deleted file mode 100644
index 79961ac..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueDuration.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-import javax.xml.datatype.Duration ;
-
-import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.graph.NodeFactory ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-
-/** XSD Duration */
-
-public class NodeValueDuration extends NodeValue
-{
- Duration duration ;
-
- public NodeValueDuration(Duration dt)
- {
- duration = dt ;
- }
-
- public NodeValueDuration(Duration dt, Node n) { super(n) ; duration = dt ; }
-
- @Override
- public boolean isDuration() { return true ; }
- @Override
- public Duration getDuration() { return duration ; }
-
- @Override
- protected Node makeNode()
- {
- String lex = duration.toString() ;
- return NodeFactory.createLiteral(lex, XSDDatatype.XSDduration) ;
- }
-
- @Override
- public void visit(NodeValueVisitor visitor) { visitor.visit(this) ; }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueFloat.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueFloat.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueFloat.java
deleted file mode 100644
index ea72ba3..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueFloat.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.graph.NodeFactory ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.util.Utils ;
-
-
-public class NodeValueFloat extends NodeValue
-{
- float value = Float.NaN ;
-
- public NodeValueFloat(float f) { super() ; value = f ; }
- public NodeValueFloat(float f, Node n) { super(n) ; value = f ; }
-
- @Override
- public boolean isNumber() { return true ; }
- @Override
- public boolean isFloat() { return true ; }
- @Override
- public boolean isDouble() { return true ; }
-
- @Override
- public float getFloat() { return value ; }
- @Override
- public double getDouble() { return value ; }
-
- @Override
- protected Node makeNode()
- { return NodeFactory.createLiteral(Utils.stringForm(value), XSDDatatype.XSDfloat) ; }
-
- @Override
- public String asString() { return toString() ; }
-
- @Override
- public String toString()
- {
- // Preserve lexical form
- if ( getNode() != null ) return super.asString() ;
- return Float.toString(value) ;
- }
-
- @Override
- public void visit(NodeValueVisitor visitor) { visitor.visit(this) ; }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueInteger.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueInteger.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueInteger.java
deleted file mode 100644
index 9f3cc06..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueInteger.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-import java.math.BigDecimal ;
-import java.math.BigInteger ;
-
-import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.graph.NodeFactory ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-
-
-public class NodeValueInteger extends NodeValue
-{
- //long integer = Integer.MIN_VALUE ;
- // The performance impact of this seems to be very low
- // After all, much of the work is pattern matching.
- BigInteger integer ;
-
- public NodeValueInteger(BigInteger i) { super() ; integer = i ; }
- public NodeValueInteger(BigInteger i, Node n) { super(n) ; integer = i ; }
-// public NodeValueInteger(long i, Node n) { super(n) ; integer = new BigInteger(Long.toString(i)) ; }
- public NodeValueInteger(long i) { super() ; integer = new BigInteger(Long.toString(i)) ; }
-
- @Override
- public boolean isNumber() { return true ; }
- @Override
- public boolean isInteger() { return true ; }
- @Override
- public boolean isDecimal() { return true ; }
- @Override
- public boolean isFloat() { return true ; }
- @Override
- public boolean isDouble() { return true ; }
-
- @Override
- public BigInteger getInteger() { return integer ; }
- @Override
- public double getDouble() { return integer.doubleValue() ; }
- @Override
- public float getFloat() { return integer.floatValue() ; }
- @Override
- public BigDecimal getDecimal() { return new BigDecimal(integer) ; }
-
- @Override
- protected Node makeNode()
- { return NodeFactory.createLiteral(integer.toString(), XSDDatatype.XSDinteger) ; }
-
- @Override
- public String asString() { return toString() ; }
-
- @Override
- public String toString()
- {
- // Preserve lexical form
- if ( getNode() != null ) return super.asString() ; // str()
- return integer.toString() ;
- }
-
- @Override
- public void visit(NodeValueVisitor visitor) { visitor.visit(this) ; }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueNode.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueNode.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueNode.java
deleted file mode 100644
index 2ac4b70..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueNode.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-
-
-/** A NodeValue that isn't anything else - unrecognized literals, URIs and blank nodes.
- * Unrecognized literals includes ones with a known type but wrong lexical form */
-
-public class NodeValueNode extends NodeValue
-{
- // ??? subclasses for NodeValueUnknownLiteralType, NodeValueLiteralBadLexicalForm
-
- public NodeValueNode(Node n) { super(n) ; }
-
- @Override
- protected Node makeNode()
- { return asNode() ; }
-
- @Override
- public void visit(NodeValueVisitor visitor) { visitor.visit(this) ; }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueOps.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueOps.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueOps.java
deleted file mode 100644
index ab6058d..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueOps.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/**
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSD ;
-import static com.hp.hpl.jena.sparql.expr.ValueSpaceClassification.VSPACE_DATE ;
-import static com.hp.hpl.jena.sparql.expr.ValueSpaceClassification.VSPACE_DATETIME ;
-import static com.hp.hpl.jena.sparql.expr.ValueSpaceClassification.VSPACE_DURATION ;
-import static com.hp.hpl.jena.sparql.expr.ValueSpaceClassification.VSPACE_NUM ;
-import static com.hp.hpl.jena.sparql.expr.ValueSpaceClassification.VSPACE_STRING ;
-import static com.hp.hpl.jena.sparql.expr.ValueSpaceClassification.VSPACE_TIME ;
-import static javax.xml.datatype.DatatypeConstants.FIELD_UNDEFINED ;
-
-import java.math.BigDecimal ;
-import java.util.GregorianCalendar ;
-
-import javax.xml.datatype.Duration ;
-import javax.xml.datatype.XMLGregorianCalendar ;
-
-import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.expr.ExprEvalTypeException ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.expr.ValueSpaceClassification ;
-import com.hp.hpl.jena.sparql.util.NodeFactoryExtra ;
-
-/** The code parts of arithmetic opperations on Nodevlaues.
- */
-public class NodeValueOps
-{
- /* Date/time/duration coverage
- * add, subtract (duration, duration)
- *
-(xsd:duration, xsd:duration) -> xsd:duration
- 10.6.1 op:add-yearMonthDurations
- 10.6.2 op:subtract-yearMonthDurations
-(xsd:duration, xsd:duration) -> xsd:duration
- 10.6.6 op:add-dayTimeDurations
- 10.6.7 op:subtract-dayTimeDurations
-** Java has general duration subtract
-
- * Subtract two date/times
-
-(xsd:dateTime, xsd:dateTime) -> xsd:duration
- 10.8.1 op:subtract-dateTimes -> xsd:dayTimeDuration
-(xsd:date, xsd:date) -> xsd:duration
- 10.8.2 op:subtract-dates
-(xsd:time, xsd:time) -> xsd:duration
- 10.8.3 op:subtract-times
-
- * Date/time and duration
-** Java has general duration subtract (error needed?)
-
-(xsd:dateTime, xsd:duration) -> xsd:dateTime
- 10.8.4 op:add-yearMonthDuration-to-dateTime
- 10.8.5 op:add-dayTimeDuration-to-dateTime
- 10.8.6 op:subtract-yearMonthDuration-from-dateTime
- 10.8.7 op:subtract-dayTimeDuration-from-dateTime
-
-(xsd:date, xsd:duration) -> xsd:date
- 10.8.8 op:add-yearMonthDuration-to-date
- 10.8.9 op:add-dayTimeDuration-to-date
- 10.8.10 op:subtract-yearMonthDuration-from-date
- 10.8.11 op:subtract-dayTimeDuration-from-date
-
-(xsd:time, xsd:duration) -> xsd:time
- 10.8.12 op:add-dayTimeDuration-to-time
- 10.8.13 op:subtract-dayTimeDuration-from-time
-
-(xsd:duration, xsd:double) -> xsd:duration
- 10.6.8 op:multiply-dayTimeDuration
- */
-
- /* Missing:
-(xsd:duration, xsd:double) -> xsd:duration
- 10.6.9 op:divide-dayTimeDuration
-
-(xsd:duration, xsd:duration) -> xsd:decimal
- 10.6.10 op:divide-dayTimeDuration-by-dayTimeDuration
- */
- /* Notes:
- * Does not consider whether a duration is dayTime or yearMonth
- * for addition and subtraction.
- * As per the Java (Xerces) implementation, it just work on durations.
- */
-
- // Until part of Jena datatypes.
- private static final String dtXSDdateTimeStamp = XSD+"#dateTimeStamp" ;
- private static final String dtXSDdayTimeDuration = XSD+"#dayTimeDuration" ;
- private static final String dtXSDyearMonthDuration = XSD+"#yearMonthDuration" ;
-
- public static NodeValue additionNV(NodeValue nv1, NodeValue nv2)
- {
- ValueSpaceClassification vs1 = nv1.getValueSpace() ;
- ValueSpaceClassification vs2 = nv2.getValueSpace() ;
-
- if ( vs1.equals(VSPACE_NUM) && vs2.equals(VSPACE_NUM) )
- return XSDFuncOp.numAdd(nv1, nv2) ;
-
- if ( vs1.equals(VSPACE_STRING) && vs2.equals(VSPACE_STRING) )
- return NodeValue.makeString(nv1.asString()+nv2.asString()) ;
- if ( vs1.equals(VSPACE_DURATION) && vs2.equals(VSPACE_DURATION) )
- {
- // A lot of testing to keep it as derived types.
- boolean isDTDur = dtXSDdayTimeDuration.equals(nv1.getDatatypeURI()) &&
- dtXSDdayTimeDuration.equals(nv2.getDatatypeURI()) ;
- boolean isYMDur = dtXSDyearMonthDuration.equals(nv1.getDatatypeURI()) &&
- dtXSDyearMonthDuration.equals(nv2.getDatatypeURI()) ;
- Duration d3 = nv1.getDuration().add(nv2.getDuration()) ;
- String lex = d3.toString() ;
- Node n ;
- if ( isDTDur )
- n = NodeFactoryExtra.createLiteralNode(lex, null, dtXSDdayTimeDuration) ;
- else if ( isYMDur )
- n = NodeFactoryExtra.createLiteralNode(lex, null, dtXSDyearMonthDuration) ;
- else
- n = com.hp.hpl.jena.graph.NodeFactory.createLiteral(lex, XSDDatatype.XSDduration) ;
- return NodeValue.makeNodeDuration(d3, n) ;
- }
-
- // Loose style. Add any duration to any date or time value.
- if ( vs1.equals(VSPACE_DATETIME) && vs2.equals(VSPACE_DURATION) )
- {
- XMLGregorianCalendar cal = nv1.getDateTime() ;
- XMLGregorianCalendar result = xsd_add(cal, nv2.getDuration()) ;
- NodeValue r = NodeValue.makeDateTime(result) ;
- return r ;
- }
- // Loose style. Add any duration to any date or time value.
- if ( vs1.equals(VSPACE_DATE) && vs2.equals(VSPACE_DURATION) )
- {
- XMLGregorianCalendar cal = nv1.getDateTime() ;
- XMLGregorianCalendar result = xsd_add(cal, nv2.getDuration()) ;
- NodeValue r = NodeValue.makeDate(result) ;
- return r ;
- }
- // Loose style. Add any duration to any date or time value.
- if ( vs1.equals(VSPACE_TIME) && vs2.equals(VSPACE_DURATION) )
- {
- // ONLY dayTime.
- XMLGregorianCalendar cal = nv1.getDateTime() ;
- XMLGregorianCalendar result = xsd_add(cal, nv2.getDuration()) ;
- NodeValue r = NodeValue.makeNode(result.toXMLFormat(), XSDDatatype.XSDtime) ;
- return r ;
- }
-
- if ( isDT(vs2) && vs1.equals(VSPACE_DURATION) )
- // Carefully ...
- return additionNV(nv2, nv1) ;
- throw new ExprEvalTypeException("Operator '+' : Undefined addition: "+nv1+" and "+nv2) ;
- }
-
- // NodeFunctions
- public static NodeValue subtractionNV(NodeValue nv1, NodeValue nv2)
- {
- ValueSpaceClassification vs1 = nv1.getValueSpace() ;
- ValueSpaceClassification vs2 = nv2.getValueSpace() ;
-
- if ( vs1.equals(VSPACE_NUM) && vs2.equals(VSPACE_NUM) )
- return XSDFuncOp.numSubtract(nv1, nv2) ;
-
- if ( vs1.equals(VSPACE_DURATION) && vs2.equals(VSPACE_DURATION) )
- {
- // A lot of testing to keep it as derived types.
- boolean isDTDur = dtXSDdayTimeDuration.equals(nv1.getDatatypeURI()) &&
- dtXSDdayTimeDuration.equals(nv2.getDatatypeURI()) ;
- boolean isYMDur = dtXSDyearMonthDuration.equals(nv1.getDatatypeURI()) &&
- dtXSDyearMonthDuration.equals(nv2.getDatatypeURI()) ;
- Duration d3 = nv1.getDuration().subtract(nv2.getDuration()) ;
- String lex = d3.toString() ;
- Node n ;
- if ( isDTDur )
- n = NodeFactoryExtra.createLiteralNode(lex, null, dtXSDdayTimeDuration) ;
- else if ( isYMDur )
- n = NodeFactoryExtra.createLiteralNode(lex, null, dtXSDyearMonthDuration) ;
- else
- n = com.hp.hpl.jena.graph.NodeFactory.createLiteral(lex, XSDDatatype.XSDduration) ;
- return NodeValue.makeNodeDuration(d3, n) ;
- }
-
- if ( isDT(vs1) && isDT(vs2) )
- {
- XMLGregorianCalendar cal1 = nv1.getDateTime() ;
- XMLGregorianCalendar cal2 = nv2.getDateTime() ;
- boolean isDef1 = ( cal1.getTimezone() == FIELD_UNDEFINED ) ;
- boolean isDef2 = ( cal2.getTimezone() == FIELD_UNDEFINED ) ;
- if ( ( isDef1 && !isDef2 ) || ( !isDef1 && isDef2 ) )
- throw new ExprEvalTypeException("Operator '-': can't substract timezone/non-timezone values") ;
- // Inspect duration and force to better type? xsd:dayTimeDuration
- return NodeValue.makeDuration(xsd_substract(cal1, cal2));
- }
-
- // Loose style. Subtract any duration to any date or time value.
- if ( vs1.equals(VSPACE_DATETIME) && vs2.equals(VSPACE_DURATION) )
- {
- XMLGregorianCalendar cal = nv1.getDateTime() ;
- // add-negation
- XMLGregorianCalendar result = xsd_subtract(cal, nv2.getDuration()) ;
- NodeValue r = NodeValue.makeDateTime(result) ;
- return r ;
- }
- if ( vs1.equals(VSPACE_DATE) && vs2.equals(VSPACE_DURATION) )
- {
- XMLGregorianCalendar cal = nv1.getDateTime() ;
- // add-negation
- XMLGregorianCalendar result = xsd_subtract(cal, nv2.getDuration()) ;
- NodeValue r = NodeValue.makeDate(result) ;
- return r ;
- }
- if ( vs1.equals(VSPACE_TIME) && vs2.equals(VSPACE_DURATION) )
- {
- XMLGregorianCalendar cal = nv1.getDateTime() ;
- // add-negation
- XMLGregorianCalendar result = xsd_subtract(cal, nv2.getDuration()) ;
- NodeValue r = NodeValue.makeNode(result.toXMLFormat(), XSDDatatype.XSDtime) ;
- return r ;
- }
-
- throw new ExprEvalTypeException("Operator '-' : Undefined subtraction: "+nv1+" and "+nv2) ;
- }
-
- public static NodeValue multiplicationNV(NodeValue nv1, NodeValue nv2)
- {
- ValueSpaceClassification vs1 = nv1.getValueSpace() ;
- ValueSpaceClassification vs2 = nv2.getValueSpace() ;
-
- if ( vs1.equals(VSPACE_NUM) && vs2.equals(VSPACE_NUM) )
- return XSDFuncOp.numMultiply(nv1, nv2) ;
-
- if ( vs1.equals(VSPACE_DURATION) && vs2.equals(VSPACE_NUM) )
- {
- // ONLY defined for dayTime.
- Duration dur = nv1.getDuration() ;
- boolean valid = XSDFuncOp.isDayTime(dur) ;
- if ( ! valid )
- throw new ExprEvalTypeException("Operator '*': only dayTime duration. Got: "+nv1) ;
- BigDecimal dec = nv2.getDecimal() ;
- Duration r = dur.multiply(dec) ;
- Node n = NodeFactoryExtra.createLiteralNode(r.toString(), null, dtXSDdayTimeDuration) ;
- return NodeValue.makeNodeDuration(r, n) ;
- }
- throw new ExprEvalTypeException("Operator '*' : Undefined multiply: "+nv1+" and "+nv2) ;
- }
-
- public static NodeValue divisionNV(NodeValue nv1, NodeValue nv2)
- {
- ValueSpaceClassification vs1 = nv1.getValueSpace() ;
- ValueSpaceClassification vs2 = nv2.getValueSpace() ;
-
- if ( vs1.equals(VSPACE_NUM) && vs2.equals(VSPACE_NUM) )
- return XSDFuncOp.numDivide(nv1, nv2) ;
-
- throw new ExprEvalTypeException("Operator '/' : Undefined division: "+nv1+" and "+nv2) ;
- }
-
-
- private static boolean isDT(ValueSpaceClassification vs)
- {
- switch (vs)
- {
- case VSPACE_DATETIME:
- case VSPACE_DATE:
- case VSPACE_TIME:
- case VSPACE_G_YEAR:
- case VSPACE_G_YEARMONTH:
- case VSPACE_G_MONTHDAY:
- case VSPACE_G_MONTH:
- case VSPACE_G_DAY:
- return true ;
- default:
- return false ;
- }
- }
-
- private static XMLGregorianCalendar xsd_add(XMLGregorianCalendar cal, Duration duration)
- {
- //if ( ! isYearMonth(duration) && ! isDayTime(duration) )
-
- XMLGregorianCalendar result = (XMLGregorianCalendar)cal.clone() ;
- result.add(duration) ;
- return result ;
- }
-
- private static XMLGregorianCalendar xsd_subtract(XMLGregorianCalendar cal, Duration duration)
- {
- return xsd_add(cal, duration.negate()) ;
- }
-
- private static Duration xsd_substract(XMLGregorianCalendar cal1, XMLGregorianCalendar cal2)
- {
- GregorianCalendar gcal1 = cal1.toGregorianCalendar() ;
- GregorianCalendar gcal2 = cal2.toGregorianCalendar() ;
- long x1 = gcal1.getTimeInMillis() ;
- long x2 = gcal2.getTimeInMillis() ;
- return NodeValue.xmlDatatypeFactory.newDuration(x1-x2) ;
- }
-
-
-}
-
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueString.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueString.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueString.java
deleted file mode 100644
index 33b2f03..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueString.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.graph.NodeFactory ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.util.FmtUtils ;
-
-
-public class NodeValueString extends NodeValue
-{
- // A plain string, no language tag or xsd:string.
-
- private String string ;
-
- public NodeValueString(String str) { string = str ; }
- public NodeValueString(String str, Node n) { super(n) ; string = str ; }
-
- @Override
- public boolean isString() { return true ; }
-
- @Override
- public String getString() { return string ; }
-
- @Override
- public String asString() { return string ; }
-
- @Override
- public String toString()
- {
- if ( getNode() != null )
- {
- // Can be a plain string or an xsd:string.
- return FmtUtils.stringForNode(getNode()) ;
- }
- return '"'+string+'"' ;
- }
-
- @Override
- protected Node makeNode()
- { return NodeFactory.createLiteral(string) ; }
-
- @Override
- public void visit(NodeValueVisitor visitor) { visitor.visit(this) ; }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueVisitor.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueVisitor.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueVisitor.java
deleted file mode 100644
index 4507739..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NodeValueVisitor.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-public interface NodeValueVisitor
-{
- public void visit(NodeValueBoolean nv) ;
-// public void visit(NodeValueDate nv) ;
-// public void visit(NodeValueDateTime nv) ;
- public void visit(NodeValueDecimal nv) ;
- public void visit(NodeValueDouble nv) ;
- public void visit(NodeValueFloat nv) ;
- public void visit(NodeValueInteger nv) ;
- public void visit(NodeValueNode nv) ;
- public void visit(NodeValueString nv) ;
- public void visit(NodeValueDT nv) ;
-// public void visit(NodeValueTime nv) ;
- public void visit(NodeValueDuration nodeValueDuration);
-
-// public void visit(NodeValueGYear nv) ;
-// public void visit(NodeValueGYearMonth nv) ;
-// public void visit(NodeValueGMonth nv) ;
-// public void visit(NodeValueGMonthDay nv) ;
-// public void visit(NodeValueGDay nv) ;
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NumericType.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NumericType.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NumericType.java
deleted file mode 100644
index 89c2250..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/nodevalue/NumericType.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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 com.hp.hpl.jena.sparql.expr.nodevalue;
-
-public enum NumericType { OP_INTEGER, OP_DECIMAL, OP_DOUBLE, OP_FLOAT}