Package com.complexible.common.rdf.random

# Class RandomValueGenerator

java.lang.Object
com.google.common.collect.UnmodifiableIterator<Value>
com.complexible.common.rdf.random.RandomValueGenerator

All Implemented Interfaces:
  `Iterator<Value>`

public class RandomValueGenerator extends com.google.common.collect.UnmodifiableIterator<Value>
Generates an infinite sequence of random RDF terms. Configuration options can be used to control what kind of terms are generated. When `next()` is called the `value probabilites` are used to decide if a URI, bnode, or a literal will be generated. The `literal probabilities` are used to decide what kind of literal is generated. Only plain, integer, float, double, or dateTime literals will be generated. Setting any probability to 0 will disable generation of that type.

Since:
  0.9.6
Version:
  3.1.2
Author:
  Evren Sirin

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RandomValueGenerator()`
  Creates a value generator with a single namespace.
  `RandomValueGenerator(int nameSpaceCount)`
  Creates a value generator with the requested number of namespaces.
  `RandomValueGenerator(long randomSeed, int nameSpaceCount)`
  Creates a value generator with the given seed and the requested number of namespaces.
  `RandomValueGenerator(long randomSeed, String[] nameSpaces)`
  Creates a value generator with the given seed and namespaces.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `float`
  `getBnodeProbability()`
  `float`
  `getDateProbability()`
  `float`
  `getDoubleProbability()`
  `float`
  `getFloatProbability()`
  `float`
  `getIntProbability()`
  `float`
  `getLangStringProbability()`
  `float`
  `getLiteralProbability()`
  `int`
  `getMaxBnodeLength()`
  `int`
  `getMaxLiteralLength()`
  `int`
  `getMaxLocalNameLength()`
  `int`
  `getMinBnodeLength()`
  `int`
  `getMinLiteralLength()`
  `int`
  `getMinLocalNameLength()`
  `String[]`
  `getNameSpaces()`
  `float`
  `getStringProbability()`
  `float`
  `getURIProbability()`
  `boolean`
  `hasNext()`
  `boolean`
  `isBuiltinBnode()`
  `static void`
  `main(String[] args)`
  `Value`
  `next()`
  `BNode`
  `nextBnode()`
  `boolean`
  `nextBoolean()`
  `float`
  `nextFloat()`
  `int`
  `nextInt(int bound)`
  `Literal`
  `nextLiteral()`
  `Resource`
  `nextResource()`
  `Literal`
  `nextString(int length)`
  `IRI`
  `nextURI()`
  `void`
  `setBuiltinBnode(boolean builtinBnode)`
  `void`
  `setLiteralProbability(float stringProbability, float langStringProbability, float intProbability, float floatProbability, float doubleProbability, float dateProbability)`
  `void`
  `setMaxBnodeLength(int maxBnodeLength)`
  `void`
  `setMaxLiteralLength(int maxLiteralLength)`
  `void`
  `setMaxLocalNameLength(int maxLocalNameLength)`
  `void`
  `setMinBnodeLength(int minBnodeLength)`
  `void`
  `setMinLiteralLength(int minLiteralLength)`
  `void`
  `setMinLocalNameLength(int minLocalNameLength)`
  `void`
  `setSeed(long theSeed)`
  The general contract of setSeed is that it alters the state to be in exactly the same state as if it had just been created with the argument seed as a seed.
  `void`
  `setValueProbability(float uriProbability, float bnodeProbability, float literalProbability)`

  ### Methods inherited from class com.google.common.collect.UnmodifiableIterator

  `remove`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.Iterator

  `forEachRemaining`

- ## Constructor Details

  - ### RandomValueGenerator

    public RandomValueGenerator()
    Creates a value generator with a single namespace.

  - ### RandomValueGenerator

    public RandomValueGenerator(int nameSpaceCount)
    Creates a value generator with the requested number of namespaces.

  - ### RandomValueGenerator

    public RandomValueGenerator(long randomSeed, int nameSpaceCount)
    Creates a value generator with the given seed and the requested number of namespaces.

  - ### RandomValueGenerator

    public RandomValueGenerator(long randomSeed, String[] nameSpaces)
    Creates a value generator with the given seed and namespaces.

- ## Method Details

  - ### getNameSpaces

    public String[] getNameSpaces()

  - ### hasNext

    public boolean hasNext()

  - ### next

    public Value next()

  - ### nextResource

    public Resource nextResource()

  - ### nextLiteral

    public Literal nextLiteral()

  - ### nextString

    public Literal nextString(int length)

  - ### nextURI

    public IRI nextURI()

  - ### nextBnode

    public BNode nextBnode()

  - ### setSeed

    public void setSeed(long theSeed)
    The general contract of setSeed is that it alters the state to be in exactly the same state as if it had just been created with the argument seed as a seed.

  - ### nextFloat

    public float nextFloat()

  - ### nextInt

    public int nextInt(int bound)

  - ### nextBoolean

    public boolean nextBoolean()

  - ### getMinLiteralLength

    public int getMinLiteralLength()

  - ### setMinLiteralLength

    public void setMinLiteralLength(int minLiteralLength)

  - ### getMaxLiteralLength

    public int getMaxLiteralLength()
    Returns:
      max string literal length

  - ### setMaxLiteralLength

    public void setMaxLiteralLength(int maxLiteralLength)

  - ### getMinLocalNameLength

    public int getMinLocalNameLength()

  - ### setMinLocalNameLength

    public void setMinLocalNameLength(int minLocalNameLength)

  - ### getMaxLocalNameLength

    public int getMaxLocalNameLength()

  - ### setMaxLocalNameLength

    public void setMaxLocalNameLength(int maxLocalNameLength)

  - ### getMinBnodeLength

    public int getMinBnodeLength()

  - ### setMinBnodeLength

    public void setMinBnodeLength(int minBnodeLength)

  - ### getMaxBnodeLength

    public int getMaxBnodeLength()

  - ### setMaxBnodeLength

    public void setMaxBnodeLength(int maxBnodeLength)

  - ### isBuiltinBnode

    public boolean isBuiltinBnode()

  - ### setBuiltinBnode

    public void setBuiltinBnode(boolean builtinBnode)

  - ### getLiteralProbability

    public float getLiteralProbability()

  - ### getBnodeProbability

    public float getBnodeProbability()

  - ### getURIProbability

    public float getURIProbability()

  - ### setValueProbability

    public void setValueProbability(float uriProbability, float bnodeProbability, float literalProbability)

  - ### setLiteralProbability

    public void setLiteralProbability(float stringProbability, float langStringProbability, float intProbability, float floatProbability, float doubleProbability, float dateProbability)

  - ### getIntProbability

    public float getIntProbability()

  - ### getFloatProbability

    public float getFloatProbability()

  - ### getDoubleProbability

    public float getDoubleProbability()

  - ### getDateProbability

    public float getDateProbability()

  - ### getLangStringProbability

    public float getLangStringProbability()

  - ### getStringProbability

    public float getStringProbability()

  - ### main

    public static void main(String[] args)