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:36 UTC
[20/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/function/library/date.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/date.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/date.java
deleted file mode 100644
index 7f33467..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/date.java
+++ /dev/null
@@ -1,61 +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.function.library;
-
-import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
-import com.hp.hpl.jena.sparql.expr.ExprEvalException ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.function.FunctionBase1 ;
-
-import org.apache.jena.atlas.logging.Log ;
-
-/** date(expression) => XSD dateTime
- * Attempt to convert an expression to an XSD dateTime.
- * Supported conversions: Date as yyyy-mm-dd
- */
-
-public class date extends FunctionBase1
-{
- public date() { }
-
- @Override
- public NodeValue exec(NodeValue v)
- {
- if ( ! v.isString() )
- {
- Log.warn(this, "date: argument not a string: "+v) ;
- throw new ExprEvalException("date: argument not a string: "+v) ;
- }
-
- String lexicalForm = v.getString() ;
-
- // Quite picky about format
- if ( ! lexicalForm.matches("\\d{4}-\\d{2}-\\d{2}") )
- {
- Log.warn(this, "date: argument not in date format: "+v) ;
- throw new ExprEvalException("date: argument not in date format: "+v) ;
- }
-
- lexicalForm=lexicalForm+"T00:00:00Z" ;
-
- NodeValue nv = NodeValue.makeNode(lexicalForm, XSDDatatype.XSDdateTime) ;
- return nv ;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/e.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/e.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/e.java
deleted file mode 100644
index 3098178..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/e.java
+++ /dev/null
@@ -1,33 +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.function.library;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.function.FunctionBase0 ;
-
-/** Value of e */
-
-public class e extends FunctionBase0
-{
- static NodeValue value_e = NodeValue.makeDouble(Math.E) ;
-
- @Override
- public NodeValue exec() { return value_e ; }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/eval.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/eval.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/eval.java
deleted file mode 100644
index 094a6fc..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/eval.java
+++ /dev/null
@@ -1,71 +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.function.library;
-
-
-//import org.apache.commons.logging.*;
-import com.hp.hpl.jena.query.QueryBuildException ;
-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.ExprEvalException ;
-import com.hp.hpl.jena.sparql.expr.ExprList ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.function.Function ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
-
-/** Function that evaluates an expression - catches evaluation failures
- * and returns false.
- * Mainly used in extensions.
- * Would be better if that were eval and this were "safe" or somesuch */
-
-public class eval implements Function
-{
- @Override
- public void build(String uri, ExprList args)
- {
- if ( args.size() != 1 )
- throw new QueryBuildException("'eval' takes one argument") ;
- }
-
-
- /** Processes unevaluated arguments */
-
- @Override
- public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env)
- {
- if ( args == null )
- // The contract on the function interface is that this should not happen.
- throw new ARQInternalErrorException("function eval: Null args list") ;
-
- if ( args.size() != 1 )
- throw new ARQInternalErrorException("function eval: Arg list not of size 1") ;
-
- Expr ex = args.get(0) ;
- try {
- NodeValue v = ex.eval(binding, env) ;
- return v ;
- } catch (ExprEvalException evalEx)
- {
- return NodeValue.FALSE ;
- }
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/evenInteger.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/evenInteger.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/evenInteger.java
deleted file mode 100644
index 2ca55a9..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/evenInteger.java
+++ /dev/null
@@ -1,42 +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.function.library;
-
-//import org.apache.commons.logging.*;
-import com.hp.hpl.jena.sparql.expr.ExprEvalException ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.function.FunctionBase1 ;
-
-/** Example function - checks for even integers. */
-
-public class evenInteger extends FunctionBase1
-{
- @Override
- public NodeValue exec(NodeValue x)
- {
- if ( ! x.isInteger() )
- throw new ExprEvalException("evenInteger: Not an intger: "+x) ;
- int i = x.getInteger().getLowestSetBit() ;
-
- boolean b = (i == -1) || ( i != 0 ) ;
-
- return NodeValue.makeNodeBoolean( b ) ;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/langeq.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/langeq.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/langeq.java
deleted file mode 100644
index e38e919..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/langeq.java
+++ /dev/null
@@ -1,34 +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.function.library;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.expr.nodevalue.NodeFunctions ;
-import com.hp.hpl.jena.sparql.function.FunctionBase2 ;
-
-
-public class langeq extends FunctionBase2
-{
- @Override
- public NodeValue exec(NodeValue v1, NodeValue v2)
- {
- return NodeFunctions.langMatches(NodeFunctions.lang(v1), v2) ;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/LeviathanConstants.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/LeviathanConstants.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/LeviathanConstants.java
deleted file mode 100644
index 59e9348..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/LeviathanConstants.java
+++ /dev/null
@@ -1,39 +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.function.library.leviathan;
-
-/**
- * Constants related to support for the <a href=
- * "https://bitbucket.org/dotnetrdf/dotnetrdf/wiki/DeveloperGuide/SPARQL/Leviathan%20Functions"
- * >Leviathan Function Library</a> which is a library of extension functions
- * originally implemented by the <a href="http://www.dotnetrdf.org">dotNetRDF Project</a>.
- *
- */
-public class LeviathanConstants {
-
- /**
- * Leviathan Function Library URI
- */
- public static final String LeviathanFunctionLibraryURI = "http://www.dotnetrdf.org/leviathan#";
-
- /**
- * Leviathan Function Library package
- */
- public static final String LeviathanFunctionLibrary = "java:com.hp.hpl.jena.sparql.function.library.leviathan.";
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cartesian.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cartesian.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cartesian.java
deleted file mode 100644
index 942891f..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cartesian.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.function.library.leviathan;
-
-import java.util.List;
-
-import com.hp.hpl.jena.query.QueryBuildException;
-import com.hp.hpl.jena.sparql.expr.ExprEvalException;
-import com.hp.hpl.jena.sparql.expr.ExprList;
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase;
-import com.hp.hpl.jena.sparql.util.Utils;
-
-public class cartesian extends FunctionBase {
-
- @Override
- public NodeValue exec(List<NodeValue> args) {
- if (args.size() != 4 && args.size() != 6)
- throw new ExprEvalException("Incorrect number of arguments");
-
- switch (args.size()) {
- case 4: {
- double dX = args.get(0).getDouble() - args.get(2).getDouble();
- double dY = args.get(1).getDouble() - args.get(3).getDouble();
-
- return NodeValue.makeDouble(Math.sqrt(Math.pow(dX, 2) + Math.pow(dY, 2)));
- }
- case 6: {
- double dX = args.get(0).getDouble() - args.get(3).getDouble();
- double dY = args.get(1).getDouble() - args.get(4).getDouble();
- double dZ = args.get(2).getDouble() - args.get(5).getDouble();
-
- return NodeValue.makeDouble(Math.sqrt(Math.pow(dX, 2) + Math.pow(dY, 2) + Math.pow(dZ, 2)));
- }
- default:
- throw new ExprEvalException("Incorrect number of arguments");
- }
- }
-
- @Override
- public void checkBuild(String uri, ExprList args) {
- if (args.size() != 4 && args.size() != 6)
- throw new QueryBuildException("Function '" + Utils.className(this) + "' takes 4 or 6 argument(s)");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cos.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cos.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cos.java
deleted file mode 100644
index 899fc67..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cos.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class cos extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.cos(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cos1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cos1.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cos1.java
deleted file mode 100644
index 1d201a5..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cos1.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class cos1 extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.acos(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec.java
deleted file mode 100644
index 3a8f895..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec.java
+++ /dev/null
@@ -1,32 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class cosec extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- // cosec x = 1 / sin x
- return NodeValue.makeDouble(1 / Math.sin(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec1.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec1.java
deleted file mode 100644
index d4004e7..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cosec1.java
+++ /dev/null
@@ -1,32 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class cosec1 extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- // acosec x = asin (1 / x)
- return NodeValue.makeDouble(Math.asin(1 / v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot.java
deleted file mode 100644
index 1396182..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot.java
+++ /dev/null
@@ -1,33 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class cot extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- // cot x = sin x / cos x
- double x = v.getDouble();
- return NodeValue.makeDouble(Math.sin(x) / Math.cos(x));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot1.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot1.java
deleted file mode 100644
index d8b1cf8..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cot1.java
+++ /dev/null
@@ -1,32 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class cot1 extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- // acot x = atan (1 / x)
- return NodeValue.makeDouble(Math.atan(1 / v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cube.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cube.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cube.java
deleted file mode 100644
index 0b78822..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/cube.java
+++ /dev/null
@@ -1,49 +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.function.library.leviathan;
-
-import java.math.BigInteger;
-
-import com.hp.hpl.jena.sparql.ARQInternalErrorException;
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.expr.nodevalue.XSDFuncOp;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class cube extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- switch (XSDFuncOp.classifyNumeric("cube", v))
- {
- case OP_INTEGER:
- BigInteger i = v.getInteger();
- return NodeValue.makeInteger( i.pow(3) );
- case OP_DECIMAL:
- double dec = v.getDecimal().doubleValue() ;
- return NodeValue.makeDecimal( Math.pow(dec, 3d)) ;
- case OP_FLOAT:
- // TODO Should cubing a float keep it a float?
- case OP_DOUBLE:
- return NodeValue.makeDouble( Math.pow(v.getDouble(), 3d) ) ;
- default:
- throw new ARQInternalErrorException("Unrecognized numeric operation : "+v) ;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/degreesToRadians.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/degreesToRadians.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/degreesToRadians.java
deleted file mode 100644
index 73d6368..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/degreesToRadians.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class degreesToRadians extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.toRadians(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/e.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/e.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/e.java
deleted file mode 100644
index f5cdb08..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/e.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class e extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.exp(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/factorial.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/factorial.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/factorial.java
deleted file mode 100644
index 4a20aa4..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/factorial.java
+++ /dev/null
@@ -1,53 +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.function.library.leviathan;
-
-import java.math.BigInteger;
-
-import com.hp.hpl.jena.sparql.expr.ExprEvalException;
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class factorial extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- BigInteger i = v.getInteger();
-
- switch (i.compareTo(BigInteger.ZERO)) {
- case 0:
- // 0! is 1
- return NodeValue.makeInteger(BigInteger.ONE);
- case -1:
- // Negative factorial is error
- throw new ExprEvalException("Cannot evaluate a negative factorial");
- case 1:
- BigInteger res = i.add(BigInteger.ZERO);
- i = i.subtract(BigInteger.ONE);
- while (i.compareTo(BigInteger.ZERO) != 0) {
- res = res.multiply(i);
- i = i.subtract(BigInteger.ONE);
- }
- return NodeValue.makeInteger(res);
- default:
- throw new ExprEvalException("Unexpecte comparison result");
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/ln.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/ln.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/ln.java
deleted file mode 100644
index db73d94..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/ln.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class ln extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.log(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/log.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/log.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/log.java
deleted file mode 100644
index c63628e..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/log.java
+++ /dev/null
@@ -1,57 +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.function.library.leviathan;
-
-import java.util.List;
-
-import com.hp.hpl.jena.query.QueryBuildException;
-import com.hp.hpl.jena.sparql.expr.ExprEvalException;
-import com.hp.hpl.jena.sparql.expr.ExprList;
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase;
-import com.hp.hpl.jena.sparql.util.Utils;
-
-public class log extends FunctionBase {
-
- @Override
- public NodeValue exec(List<NodeValue> args) {
- if (args.size() < 1 || args.size() > 2)
- throw new ExprEvalException("Invalid number of arguments");
-
- NodeValue v = args.get(0);
-
- if (args.size() == 1) {
- // Log base 10
- return NodeValue.makeDouble(Math.log10(v.getDouble()));
- } else {
- // Log with arbitrary base
- // See http://en.wikipedia.org/wiki/List_of_logarithmic_identities#Changing_the_base
- NodeValue base = args.get(1);
-
- return NodeValue.makeDouble(Math.log10(v.getDouble()) / Math.log10(base.getDouble()));
- }
- }
-
- @Override
- public void checkBuild(String uri, ExprList args) {
- if (args.size() < 1 || args.size() > 2)
- throw new QueryBuildException("Function '" + Utils.className(this) + "' takes one/two argument(s)");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/md5hash.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/md5hash.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/md5hash.java
deleted file mode 100644
index 0038893..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/md5hash.java
+++ /dev/null
@@ -1,35 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.E_MD5;
-import com.hp.hpl.jena.sparql.expr.ExprDigest;
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class md5hash extends FunctionBase1 {
-
- private ExprDigest digest = new E_MD5(NodeValue.makeBoolean(true).getExpr());
-
- @Override
- public NodeValue exec(NodeValue v) {
- return digest.eval(v);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/pow.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/pow.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/pow.java
deleted file mode 100644
index fdb8e8a..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/pow.java
+++ /dev/null
@@ -1,49 +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.function.library.leviathan;
-
-import java.math.BigInteger ;
-
-import com.hp.hpl.jena.sparql.ARQInternalErrorException ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.expr.nodevalue.XSDFuncOp ;
-import com.hp.hpl.jena.sparql.function.FunctionBase2 ;
-
-public class pow extends FunctionBase2 {
-
- @Override
- public NodeValue exec(NodeValue v1, NodeValue v2) {
- switch (XSDFuncOp.classifyNumeric("pow", v1))
- {
- case OP_INTEGER:
- BigInteger i = v1.getInteger();
- return NodeValue.makeInteger( i.pow(v2.getInteger().intValue()) );
- case OP_DECIMAL:
- double dec = v1.getDecimal().doubleValue() ;
- return NodeValue.makeDecimal( Math.pow(dec, v2.getDouble())) ;
- case OP_FLOAT:
- // TODO Should raising a float to a power keep it a float?
- case OP_DOUBLE:
- return NodeValue.makeDouble( Math.pow(v1.getDouble(), v2.getDouble()) ) ;
- default:
- throw new ARQInternalErrorException("Unrecognized numeric operation : "+ v1) ;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/pythagoras.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/pythagoras.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/pythagoras.java
deleted file mode 100644
index c4b7a34..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/pythagoras.java
+++ /dev/null
@@ -1,34 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase2;
-
-public class pythagoras extends FunctionBase2 {
-
- @Override
- public NodeValue exec(NodeValue v1, NodeValue v2) {
- double a = v1.getDouble();
- double b = v2.getDouble();
-
- return NodeValue.makeDouble(Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2)));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/radiansToDegrees.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/radiansToDegrees.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/radiansToDegrees.java
deleted file mode 100644
index 1d6e93d..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/radiansToDegrees.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class radiansToDegrees extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.toDegrees(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/reciprocal.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/reciprocal.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/reciprocal.java
deleted file mode 100644
index 5ced66f..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/reciprocal.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class reciprocal extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(1d / v.getDouble());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/rnd.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/rnd.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/rnd.java
deleted file mode 100644
index fe36ba8..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/rnd.java
+++ /dev/null
@@ -1,70 +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.function.library.leviathan;
-
-import java.util.List;
-
-import org.apache.jena.atlas.lib.RandomLib;
-
-import com.hp.hpl.jena.query.QueryBuildException;
-import com.hp.hpl.jena.sparql.expr.ExprEvalException;
-import com.hp.hpl.jena.sparql.expr.ExprList;
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase;
-import com.hp.hpl.jena.sparql.util.Utils;
-
-public class rnd extends FunctionBase {
-
- @Override
- public NodeValue exec(List<NodeValue> args) {
- if (args.size() > 2)
- throw new ExprEvalException("Too many arguments");
-
- switch (args.size()) {
- case 0:
- return NodeValue.makeDouble(RandomLib.random.nextDouble());
- case 1: {
- double max = args.get(0).getDouble();
- if (max <= 0d)
- throw new ExprEvalException("Max must be > 0");
- return NodeValue.makeDouble(RandomLib.random.nextDouble() * max);
- }
- case 2: {
- double min = args.get(0).getDouble();
- double max = args.get(1).getDouble();
- if (min > max)
- throw new ExprEvalException("Min cannot be greater than the max");
-
- double range = max - min;
- double value = min + (RandomLib.random.nextDouble() * range);
- return NodeValue.makeDouble(value);
- }
- default:
- throw new ExprEvalException("Too many arguments");
- }
- }
-
- @Override
- public void checkBuild(String uri, ExprList args) {
- if (args.size() > 2)
- throw new QueryBuildException("Function '" + Utils.className(this)
- + "' takes between 0, 1 or 2 argument(s)");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/root.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/root.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/root.java
deleted file mode 100644
index 9159704..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/root.java
+++ /dev/null
@@ -1,34 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase2;
-
-public class root extends FunctionBase2 {
-
- @Override
- public NodeValue exec(NodeValue v1, NodeValue v2) {
- double value = v1.getDouble();
- double root = v2.getDouble();
-
- return NodeValue.makeDouble(Math.pow(value, 1d / root));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec.java
deleted file mode 100644
index e834319..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec.java
+++ /dev/null
@@ -1,32 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class sec extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- // sec x = 1 / cos x
- return NodeValue.makeDouble(1 / Math.cos(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec1.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec1.java
deleted file mode 100644
index 331ca3a..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sec1.java
+++ /dev/null
@@ -1,32 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class sec1 extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- // arcsec x = acos (1 / x)
- return NodeValue.makeDouble(Math.acos(1 / v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sha256hash.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sha256hash.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sha256hash.java
deleted file mode 100644
index cb74913..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sha256hash.java
+++ /dev/null
@@ -1,35 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.E_SHA256;
-import com.hp.hpl.jena.sparql.expr.ExprDigest;
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class sha256hash extends FunctionBase1 {
-
- private ExprDigest digest = new E_SHA256(NodeValue.makeBoolean(true).getExpr());
-
- @Override
- public NodeValue exec(NodeValue v) {
- return digest.eval(v);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin.java
deleted file mode 100644
index c184167..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class sin extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.sin(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin1.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin1.java
deleted file mode 100644
index 425e506..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sin1.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class sin1 extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.asin(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sq.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sq.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sq.java
deleted file mode 100644
index c7b04fe..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sq.java
+++ /dev/null
@@ -1,49 +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.function.library.leviathan;
-
-import java.math.BigInteger;
-
-import com.hp.hpl.jena.sparql.ARQInternalErrorException;
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.expr.nodevalue.XSDFuncOp;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class sq extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- switch (XSDFuncOp.classifyNumeric("sq", v))
- {
- case OP_INTEGER:
- BigInteger i = v.getInteger();
- return NodeValue.makeInteger( i.pow(2) );
- case OP_DECIMAL:
- double dec = v.getDecimal().doubleValue() ;
- return NodeValue.makeDecimal( Math.pow(dec, 2d)) ;
- case OP_FLOAT:
- // TODO Should squaring a float keep it a float?
- case OP_DOUBLE:
- return NodeValue.makeDouble( Math.pow(v.getDouble(), 2d) ) ;
- default:
- throw new ARQInternalErrorException("Unrecognized numeric operation : "+v) ;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sqrt.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sqrt.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sqrt.java
deleted file mode 100644
index ca948f7..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/sqrt.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class sqrt extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.sqrt(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan.java
deleted file mode 100644
index 7d46624..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class tan extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.tan(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan1.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan1.java
deleted file mode 100644
index 63e8ea3..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/tan1.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class tan1 extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.atan(v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/ten.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/ten.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/ten.java
deleted file mode 100644
index c43c40c..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/leviathan/ten.java
+++ /dev/null
@@ -1,31 +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.function.library.leviathan;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue;
-import com.hp.hpl.jena.sparql.function.FunctionBase1;
-
-public class ten extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue v) {
- return NodeValue.makeDouble(Math.pow(10d, v.getDouble()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/localname.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/localname.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/localname.java
deleted file mode 100644
index a4fd462..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/localname.java
+++ /dev/null
@@ -1,42 +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.function.library;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.expr.ExprEvalException ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.function.FunctionBase1 ;
-import com.hp.hpl.jena.sparql.util.FmtUtils ;
-
-/** localname(expression) */
-
-public class localname extends FunctionBase1
-{
- public localname() { super() ; }
-
- @Override
- public NodeValue exec(NodeValue v)
- {
- Node n = v.asNode() ;
- if ( ! n.isURI() )
- throw new ExprEvalException("Not a URI: "+FmtUtils.stringForNode(n)) ;
- String str = n.getLocalName() ;
- return NodeValue.makeString(str) ;
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/max.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/max.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/max.java
deleted file mode 100644
index d485c4a..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/max.java
+++ /dev/null
@@ -1,36 +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.function.library;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.expr.nodevalue.XSDFuncOp ;
-import com.hp.hpl.jena.sparql.function.FunctionBase2 ;
-
-/** max(expression, expression) */
-
-public class max extends FunctionBase2
-{
- public max() { super() ; }
-
- @Override
- public NodeValue exec(NodeValue nv1, NodeValue nv2)
- {
- return XSDFuncOp.max(nv1, nv2) ;
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/min.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/min.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/min.java
deleted file mode 100644
index 4c8b5aa..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/min.java
+++ /dev/null
@@ -1,36 +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.function.library;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.expr.nodevalue.XSDFuncOp ;
-import com.hp.hpl.jena.sparql.function.FunctionBase2 ;
-
-/** min(expression, expression) */
-
-public class min extends FunctionBase2
-{
- public min() { super() ; }
-
- @Override
- public NodeValue exec(NodeValue nv1, NodeValue nv2)
- {
- return XSDFuncOp.min(nv1, nv2) ;
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/namespace.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/namespace.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/namespace.java
deleted file mode 100644
index fc99a18..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/namespace.java
+++ /dev/null
@@ -1,42 +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.function.library;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.expr.ExprEvalException ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.function.FunctionBase1 ;
-import com.hp.hpl.jena.sparql.util.FmtUtils ;
-
-/** namespace(expression) */
-
-public class namespace extends FunctionBase1
-{
- public namespace() { super() ; }
-
- @Override
- public NodeValue exec(NodeValue v)
- {
- Node n = v.asNode() ;
- if ( ! n.isURI() )
- throw new ExprEvalException("Not a URI: "+FmtUtils.stringForNode(n)) ;
- String str = n.getNameSpace() ;
- return NodeValue.makeString(str) ;
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/now.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/now.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/now.java
deleted file mode 100644
index 4759db9..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/now.java
+++ /dev/null
@@ -1,30 +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.function.library;
-
-//import org.apache.commons.logging.*;
-
-import com.hp.hpl.jena.sparql.ARQConstants ;
-
-/** Function that accesses the current time (the time the query started). */
-
-public class now extends SystemVar
-{
- public now() { super(ARQConstants.sysCurrentTime) ; }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/pi.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/pi.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/pi.java
deleted file mode 100644
index 63af766..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/pi.java
+++ /dev/null
@@ -1,32 +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.function.library;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.function.FunctionBase0 ;
-
-/** Value of pi */
-
-public class pi extends FunctionBase0
-{
- static NodeValue value_pi = NodeValue.makeDouble(Math.PI) ;
-
- @Override
- public NodeValue exec() { return value_pi ; }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/print.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/print.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/print.java
deleted file mode 100644
index fb026e9..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/print.java
+++ /dev/null
@@ -1,35 +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.function.library;
-
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.function.FunctionBase1 ;
-
-/** Function that prints it's argument to stdout (debugging aid) */
-public class print extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue nv)
- {
- String s = nv.asString() ;
- System.out.println(s) ;
- System.out.flush() ;
- return NodeValue.TRUE ;
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/sha1sum.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/sha1sum.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/sha1sum.java
deleted file mode 100644
index bc0cb70..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/sha1sum.java
+++ /dev/null
@@ -1,48 +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.function.library;
-// Contribution from Leigh Dodds
-
-import com.hp.hpl.jena.sparql.expr.E_SHA1 ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.expr.nodevalue.NodeFunctions ;
-import com.hp.hpl.jena.sparql.function.FunctionBase1 ;
-
-/**
- * ARQ Extension Function that will calculate the
- * SHA1 sum of any literal. Useful for working with
- * FOAF data.
- */
-public class sha1sum extends FunctionBase1
-{
- // This exists for compatibility.
- // SPARQL 1.1 has a SHA1(expression) function.
- // This stub implements afn:sha1(expr) as an indirection to that function.
-
- private E_SHA1 sha1 = new E_SHA1(null) ;
-
- public sha1sum() {}
-
- @Override
- public NodeValue exec(NodeValue nodeValue)
- {
- nodeValue = NodeFunctions.str(nodeValue) ;
- return sha1.eval(nodeValue) ;
- }
-}