Class RandomStatementGenerator
java.lang.Object
com.google.common.collect.UnmodifiableIterator<Statement>
com.complexible.common.rdf.random.RandomStatementGenerator
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 -
Method Summary
Modifier and TypeMethodDescriptionintintintintbooleanhasNext()static voidnext()Returns the next random triple.static <T> TrandomGraph(Random rnd, int numNodes, int numEdges, List<IRI> predicates) A utility method to generate a simple random graph with the given number of nodes and edges chosen at random from the provided list of predicates.randomSubjects(Set<Statement> data, Random rnd, int size) voidsetNumberOfDistinctClasses(int theNumberOfDistinctClasses) Sets the number of distinct classes to be used as types.voidsetNumberOfDistinctProperties(int theNumberOfDistinctProperties) Sets the number of distinct properties to be used.voidsetNumberOfStatementsPerSubject(int theNumberOfStatementsPerSubject) Sets the number of statements to be generated for a given subject.voidsetNumberOfSubjectsPerGraph(int theNumberOfSubjectsPerGraph) Sets the number of subjects generated per graph.Methods inherited from class com.google.common.collect.UnmodifiableIterator
removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
RandomStatementGenerator
public RandomStatementGenerator() -
RandomStatementGenerator
-
-
Method Details
-
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:typetriples 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_VALUEto generate a single named graph. -
next
Returns the next random triple. -
randomGraph
public static Set<Statement> randomGraph(Random rnd, int numNodes, int numEdges, List<IRI> predicates) A utility method to generate a simple random graph with the given number of nodes and edges chosen at random from the provided list of predicates. Should not be used for any kind of performance tests because the graph is unlikely to exhibit realistic properties. -
randomSubjects
-
pickFrom
-
main
-