Class RandomStatementGenerator
- java.lang.Object
-
- com.google.common.collect.UnmodifiableIterator<Statement>
-
- com.complexible.common.rdf.random.RandomStatementGenerator
-
- All Implemented Interfaces:
java.util.Iterator<Statement>
public class RandomStatementGenerator extends com.google.common.collect.UnmodifiableIterator<Statement>
Generates an infinite sequence of random RDF triples. Configuration options can be used to control what kind of triples are generated.- Since:
- 3.1.2
- Version:
- 6.0
- Author:
- Evren Sirin
-
-
Constructor Summary
Constructors Constructor Description RandomStatementGenerator()
RandomStatementGenerator(RandomValueGenerator theRandomValueGenerator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNumberOfDistinctClasses()
int
getNumberOfDistinctProperties()
int
getNumberOfStatementsPerSubject()
int
getNumberOfSubjectsPerGraph()
boolean
hasNext()
static void
main(java.lang.String[] args)
Statement
next()
Returns the next random triple.void
setNumberOfDistinctClasses(int theNumberOfDistinctClasses)
Sets the number of distinct classes to be used as types.void
setNumberOfDistinctProperties(int theNumberOfDistinctProperties)
Sets the number of distinct properties to be used.void
setNumberOfStatementsPerSubject(int theNumberOfStatementsPerSubject)
Sets the number of statements to be generated for a given subject.void
setNumberOfSubjectsPerGraph(int theNumberOfSubjectsPerGraph)
Sets the number of subjects generated per graph.
-
-
-
Constructor Detail
-
RandomStatementGenerator
public RandomStatementGenerator()
-
RandomStatementGenerator
public RandomStatementGenerator(RandomValueGenerator theRandomValueGenerator)
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
getNumberOfDistinctProperties
public int getNumberOfDistinctProperties()
-
setNumberOfDistinctProperties
public void setNumberOfDistinctProperties(int theNumberOfDistinctProperties)
Sets the number of distinct properties to be used. If set to 0, completely random set of properties will be generated.
-
getNumberOfStatementsPerSubject
public int getNumberOfStatementsPerSubject()
-
setNumberOfStatementsPerSubject
public void setNumberOfStatementsPerSubject(int theNumberOfStatementsPerSubject)
Sets the number of statements to be generated for a given subject. Set to 0 to use completely random set of properties.
-
getNumberOfDistinctClasses
public int getNumberOfDistinctClasses()
-
setNumberOfDistinctClasses
public void setNumberOfDistinctClasses(int theNumberOfDistinctClasses)
Sets the number of distinct classes to be used as types. If set to 0, nordf:type
triples will be generated.
-
getNumberOfSubjectsPerGraph
public int getNumberOfSubjectsPerGraph()
-
setNumberOfSubjectsPerGraph
public void setNumberOfSubjectsPerGraph(int theNumberOfSubjectsPerGraph)
Sets the number of subjects generated per graph. Default is 0 which means no named graphs are generated. Set toInteger.MAX_VALUE
to generate a single named graph.
-
next
public Statement next()
Returns the next random triple.
-
main
public static void main(java.lang.String[] args)
-
-