Class RdfUtilities


  • public final class RdfUtilities
    extends java.lang.Object
    Author:
    Fabrizio Giudici
    • Constructor Summary

      Constructors 
      Constructor Description
      RdfUtilities()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static it.tidalwave.util.Id createSha1Id​(java.lang.String string)  
      static it.tidalwave.util.Id createSha1IdNew​(java.lang.String string)  
      static java.lang.String emptyWhenNull​(java.lang.String string)  
      static void exportToFile​(org.eclipse.rdf4j.model.Model model, java.nio.file.Path path)
      Exports the repository to the given file.
      static org.eclipse.rdf4j.model.Value literalFor​(float value)  
      static org.eclipse.rdf4j.model.Value literalFor​(int value)  
      static org.eclipse.rdf4j.model.Value literalFor​(long value)  
      static org.eclipse.rdf4j.model.Value literalFor​(short value)  
      static org.eclipse.rdf4j.model.Value literalFor​(it.tidalwave.util.Id id)  
      static org.eclipse.rdf4j.model.Value literalFor​(java.lang.String string)  
      static org.eclipse.rdf4j.model.Value literalFor​(java.nio.file.Path path)  
      static org.eclipse.rdf4j.model.Value literalFor​(java.time.Instant instant)  
      static java.util.Optional<org.eclipse.rdf4j.model.Value> literalFor​(java.util.Optional<java.lang.String> optionalString)  
      static java.util.Optional<org.eclipse.rdf4j.model.Value> literalForFloat​(java.util.Optional<java.lang.Float> optionalFloat)  
      static java.util.Optional<org.eclipse.rdf4j.model.Value> literalForInt​(java.util.Optional<java.lang.Integer> optionalInteger)  
      static java.util.Optional<org.eclipse.rdf4j.model.Value> literalForLong​(java.util.Optional<java.lang.Long> optionalLong)  
      static <T,​X extends java.lang.RuntimeException>
      java.util.stream.Stream<T>
      streamOf​(org.eclipse.rdf4j.common.iteration.Iteration<T,​X> iteration)  
      static org.eclipse.rdf4j.model.IRI uriFor​(it.tidalwave.util.Id id)  
      static org.eclipse.rdf4j.model.IRI uriFor​(java.lang.String id)  
      static org.eclipse.rdf4j.model.IRI uriFor​(java.net.URL url)  
      static java.net.URL urlFor​(org.eclipse.rdf4j.model.IRI uri)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RdfUtilities

        public RdfUtilities()
    • Method Detail

      • exportToFile

        public static void exportToFile​(@Nonnull
                                        org.eclipse.rdf4j.model.Model model,
                                        @Nonnull
                                        java.nio.file.Path path)
                                 throws org.eclipse.rdf4j.rio.RDFHandlerException,
                                        java.io.IOException,
                                        org.eclipse.rdf4j.repository.RepositoryException
        Exports the repository to the given file. FIXME: duplicated in DefaultPerstistence
        Throws:
        org.eclipse.rdf4j.rio.RDFHandlerException
        java.io.IOException
        org.eclipse.rdf4j.repository.RepositoryException
      • streamOf

        @Nonnull
        public static <T,​X extends java.lang.RuntimeException> java.util.stream.Stream<T> streamOf​(@Nonnull
                                                                                                         org.eclipse.rdf4j.common.iteration.Iteration<T,​X> iteration)
      • literalFor

        @Nonnull
        public static org.eclipse.rdf4j.model.Value literalFor​(java.nio.file.Path path)
      • literalFor

        @Nonnull
        public static org.eclipse.rdf4j.model.Value literalFor​(java.lang.String string)
      • literalFor

        @Nonnull
        public static java.util.Optional<org.eclipse.rdf4j.model.Value> literalFor​(java.util.Optional<java.lang.String> optionalString)
      • literalFor

        @Nonnull
        public static org.eclipse.rdf4j.model.Value literalFor​(it.tidalwave.util.Id id)
      • literalFor

        @Nonnull
        public static org.eclipse.rdf4j.model.Value literalFor​(int value)
      • literalForInt

        @Nonnull
        public static java.util.Optional<org.eclipse.rdf4j.model.Value> literalForInt​(java.util.Optional<java.lang.Integer> optionalInteger)
      • literalFor

        @Nonnull
        public static org.eclipse.rdf4j.model.Value literalFor​(long value)
      • literalForLong

        @Nonnull
        public static java.util.Optional<org.eclipse.rdf4j.model.Value> literalForLong​(java.util.Optional<java.lang.Long> optionalLong)
      • literalFor

        @Nonnull
        public static org.eclipse.rdf4j.model.Value literalFor​(short value)
      • literalFor

        @Nonnull
        public static org.eclipse.rdf4j.model.Value literalFor​(float value)
      • literalForFloat

        @Nonnull
        public static java.util.Optional<org.eclipse.rdf4j.model.Value> literalForFloat​(java.util.Optional<java.lang.Float> optionalFloat)
      • literalFor

        @Nonnull
        public static org.eclipse.rdf4j.model.Value literalFor​(@Nonnull
                                                               java.time.Instant instant)
      • uriFor

        @Nonnull
        public static org.eclipse.rdf4j.model.IRI uriFor​(@Nonnull
                                                         it.tidalwave.util.Id id)
      • uriFor

        @Nonnull
        public static org.eclipse.rdf4j.model.IRI uriFor​(@Nonnull
                                                         java.lang.String id)
      • uriFor

        @Nonnull
        public static org.eclipse.rdf4j.model.IRI uriFor​(@Nonnull
                                                         java.net.URL url)
      • urlFor

        @Nonnull
        public static java.net.URL urlFor​(@Nonnull
                                          org.eclipse.rdf4j.model.IRI uri)
                                   throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException
      • emptyWhenNull

        @Nonnull
        public static java.lang.String emptyWhenNull​(@Nullable
                                                     java.lang.String string)
      • createSha1Id

        @Nonnull
        public static it.tidalwave.util.Id createSha1Id​(@Nonnull
                                                        java.lang.String string)
      • createSha1IdNew

        @Nonnull
        public static it.tidalwave.util.Id createSha1IdNew​(@Nonnull
                                                           java.lang.String string)