diff --git a/solrdf/src/main/java/org/gazzax/labs/solrdf/NTriples.java b/solrdf/src/main/java/org/gazzax/labs/solrdf/NTriples.java index 5698900..f4a9ce6 100644 --- a/solrdf/src/main/java/org/gazzax/labs/solrdf/NTriples.java +++ b/solrdf/src/main/java/org/gazzax/labs/solrdf/NTriples.java @@ -7,7 +7,7 @@ import com.hp.hpl.jena.rdf.model.AnonId; /** - * Booch utility for parsing RDF resources. + * Booch utility for parsing NTriples. * * @author Andrea Gazzarini * @since 1.0 diff --git a/solrdf/src/main/java/org/gazzax/labs/solrdf/Strings.java b/solrdf/src/main/java/org/gazzax/labs/solrdf/Strings.java index a67e84e..105ebdf 100644 --- a/solrdf/src/main/java/org/gazzax/labs/solrdf/Strings.java +++ b/solrdf/src/main/java/org/gazzax/labs/solrdf/Strings.java @@ -27,6 +27,13 @@ public static boolean isNullOrEmpty(final String value) { return value == null || value.trim().length() == 0; } + /** + * Removes unnecessary decimal zeros from a numeric string. + * As an extreme case, where all decimals are 0, it ends with an integer string (e.g 10.000 = 10) + * + * @param numericStringValue the numeric string. + * @return a new string with unnecessary decimal zeros removed. + */ public static String round(final String numericStringValue) { final int indexOfDot = numericStringValue.indexOf("."); if (indexOfDot == -1) { diff --git a/solrdf/src/main/java/org/gazzax/labs/solrdf/Utility.java b/solrdf/src/main/java/org/gazzax/labs/solrdf/Utility.java deleted file mode 100644 index babba70..0000000 --- a/solrdf/src/main/java/org/gazzax/labs/solrdf/Utility.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.gazzax.labs.solrdf; - -import com.google.common.hash.HashCode; -import com.google.common.hash.HashFunction; -import com.google.common.hash.Hashing; -import com.hp.hpl.jena.graph.Node; - -/** - * General-purposes Booch utility. - * - * @author Andrea Gazzarini - * @since 1.0 - */ -public abstract class Utility { - private static final HashFunction MURMUR_HASH_3 = Hashing.murmur3_128(); - - /** - * Returns the local name part of the given URI. - * Basically here because I didn't understand how Node.getLocalName() works. - * - * @param uri the URI. - * @return the local name part of the given URI. - */ - public static String localName(final String uri) { - return uri.substring(startIndexOfLocalName(uri) + 1); - } - - /** - * Returns the local name part of the given URI. - * Basically here because I didn't understand how Node.getLocalName() works. - * - * @param uri the URI. - * @return the local name part of the given URI. - */ - public static String localName(final Node uri) { - return localName(uri.getURI()); - } - - /** - * Returns the domain part of the given URI. - * Basically here because I didn't understand how Node.getNameSpace() works. - * - * @param uri the URI. - * @return the domain part of the given URI. - */ - public static String namespace(final String uri) { - return uri.substring(0, startIndexOfLocalName(uri) + 1); - } - - /** - * Returns the domain part of the given URI. - * Basically here because I didn't understand how Node.getNameSpace() works. - * - * @param uri the URI. - * @return the domain part of the given URI. - */ - public static String namespace(final Node uri) { - return namespace(uri.getURI()); - } - - /** - * Returns true if the given byte array represents a variable. The incoming - * value is considered a variable if - * - *