public class YamlFixtureLoader extends Object implements FixtureLoader
The YAML fixture format is almost identical to the plain bundle format, but has some extensions to a) allow for creating non-dependent relationships, and b) allow for single relations to be more naturally expressed. For example, while, in the bundle format the relations for a given relation type is always a list (even if there is typically only one), the YAML format allows using a single item and it will be loaded as if it were a list containing just one item, i.e, instead of writing
relationships: heldBy: - some-repo
we can just write:
relationships: heldBy: some-repo
Constructor and Description |
---|
YamlFixtureLoader(com.tinkerpop.frames.FramedGraph<?> graph)
Constructor.
|
YamlFixtureLoader(com.tinkerpop.frames.FramedGraph<?> graph,
boolean initialize)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
loadTestData()
Load the default fixtures.
|
void |
loadTestData(InputStream stream)
Load test data from an input stream.
|
void |
loadTestData(String resourceNameOrPath)
Load fixtures from a resource or file path.
|
YamlFixtureLoader |
setInitializing(boolean initialize)
Perform graph initialization (creating the event log structure and
default nodes) prior to importing fixtures.
|
public YamlFixtureLoader(com.tinkerpop.frames.FramedGraph<?> graph, boolean initialize)
graph
- The graphinitialize
- Whether or not to initialize the graphpublic YamlFixtureLoader(com.tinkerpop.frames.FramedGraph<?> graph)
graph
- The graphpublic YamlFixtureLoader setInitializing(boolean initialize)
setInitializing
in interface FixtureLoader
initialize
- Whether or not to initialize the graph: default
public void loadTestData(String resourceNameOrPath)
loadTestData
in interface FixtureLoader
resourceNameOrPath
- Either a classloader-accessible
resource, or a local file path.public void loadTestData(InputStream stream)
loadTestData
in interface FixtureLoader
stream
- A input stream of valid YAML data.public void loadTestData()
FixtureLoader
loadTestData
in interface FixtureLoader
Copyright © 2018 The European Holocaust Research Infrastructure (EHRI). All rights reserved.