def METHOD_NAME(tmpdir, runner, project, subdirectory):
    """Test output of graph export for dataset add."""
    result = runner.invoke(cli, ["dataset", "create", "my-dataset"])
    assert 0 == result.exit_code, format_result_exception(result)
    paths = []
    test_paths = []
    for i in range(3):
        new_file = tmpdir.join(f"file_{i}")
        new_file.write(str(i))
        paths.append(str(new_file))
        test_paths.append(os.path.relpath(str(new_file), str(project.path)))
    # add data
    result = runner.invoke(cli, ["dataset", "add", "--copy", "my-dataset"] + paths)
    assert 0 == result.exit_code, format_result_exception(result)
    result = runner.invoke(cli, ["graph", "export", "--strict", "--format=json-ld", "--revision", "HEAD"])
    assert 0 == result.exit_code, format_result_exception(result)
    assert all(p in result.output for p in test_paths), result.output
    # check that only most recent dataset is exported
    assert 1 == result.output.count("http://schema.org/Dataset")
    # NOTE: Don't pass ``--full`` to check it's the default action.
    result = runner.invoke(cli, ["graph", "export", "--strict", "--format=json-ld"])
    assert 0 == result.exit_code, format_result_exception(result)
    assert all(p in result.output for p in test_paths), result.output
    # check that all datasets are exported
    assert 2 == result.output.count("http://schema.org/Dataset")
    # remove and readd dataset
    result = runner.invoke(cli, ["dataset", "rm", "my-dataset"])
    assert 0 == result.exit_code, format_result_exception(result)
    result = runner.invoke(cli, ["dataset", "create", "my-dataset"])
    assert 0 == result.exit_code, format_result_exception(result)
    result = runner.invoke(cli, ["graph", "export", "--strict", "--format=json-ld"])
    assert 0 == result.exit_code, format_result_exception(result)
    assert all(p in result.output for p in test_paths), result.output
    # check that all datasets are exported
    assert 4 == result.output.count("http://schema.org/Dataset")
    assert 1 == result.output.count("invalidatedAtTime")