C# Класс Socrata.Dataset

A Socrata dataset and associated rows/columns/metadata
Наследование: ApiBase
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addColumn ( String name ) : bool
addColumn ( String name, String description ) : bool
addColumn ( String name, String description, String type ) : bool
addColumn ( String name, String description, String type, int width ) : bool
addColumn ( String name, String description, String type, int width, bool hidden ) : bool

Adds a column to the dataset

addRow ( string>.Dictionary row ) : bool

Add a row to the dataset

append ( String filename ) : bool

Append the data in the given file to an existing dataset

append ( String filename, bool skipHeaders ) : bool

Replaces the data in the existing attached dataset with the contents of the file

attach ( string id ) : void

Attach to a given UID for a dataset that already exists

attached ( ) : bool

Check to see if the dataset is associated with a valid UID.

columns ( ) : Newtonsoft.Json.Linq.JArray

Gets a JSON representation of the columns

copy ( ) : String

Make a working copy of a published dataset, with all row data copied.

copySchema ( ) : String

Make a working copy of only the schema of a published dataset, with all row data omitted.

create ( String name ) : bool

Creates a new, blank dataset with only a name.

create ( String name, String description ) : bool

Creates a new, blank dataset.

delayAddRow ( string>.Dictionary row ) : void

Like addRow, but doesn't immediately send the data away. Instead, it stores it in a queue, which can be flushed with sendBatchRequest

delete ( ) : bool

Deletes (irreversibly) the current dataset

importFile ( String filename ) : bool

Creates a new dataset by importing a file

metadata ( ) : Newtonsoft.Json.Linq.JObject

Gets the metadata associated with the dataset

publish ( ) : bool

Performs a publish operation on a working copy dataset, to commit the changes you've made to the working copy to the published copy. Note that this should be called on the working copy, not the published version.

refresh ( String filename ) : bool

Replaces the data in the existing attached dataset with the contents of the file

refresh ( String filename, bool skipHeaders ) : bool

Replaces the data in the existing attached dataset with the contents of the file

rows ( ) : Newtonsoft.Json.Linq.JArray

Gets a JSON Array of the rows in the dataset

setAttribution ( String attribution, String url ) : void

Sets the dataset's attribution, e.g. "provided by"

setDescription ( String description ) : void

Sets the dataset's description

setPublic ( bool isPublic ) : bool

Sets the dataset's visibility

shortUrl ( ) : String

Gets an href to the dataset, shortened.

uploadFile ( String filename ) : String

Upload a file to the dataset for use in a cell (e.g. image)

Приватные методы

Метод Описание
copyWithMethod ( String method ) : String
isValidId ( String id ) : bool

Checks if the given string represents a valid 4-4 Socrata UID

multipartAppendOrRefresh ( String filename, String method ) : bool
multipartUpload ( String url, String filename ) : Newtonsoft.Json.Linq.JObject

Multipart upload a file

putRequest ( String body ) : void

Описание методов

addColumn() публичный Метод

public addColumn ( String name ) : bool
name String
Результат bool

addColumn() публичный Метод

public addColumn ( String name, String description ) : bool
name String
description String
Результат bool

addColumn() публичный Метод

public addColumn ( String name, String description, String type ) : bool
name String
description String
type String
Результат bool

addColumn() публичный Метод

public addColumn ( String name, String description, String type, int width ) : bool
name String
description String
type String
width int
Результат bool

addColumn() публичный Метод

Adds a column to the dataset
public addColumn ( String name, String description, String type, int width, bool hidden ) : bool
name String The name of the column
description String An optional description
type String The column type. See API docs vor valid types
width int How many pixels wide to make the column
hidden bool If true, don't show the column in views, just store the data
Результат bool

addRow() публичный Метод

Add a row to the dataset
public addRow ( string>.Dictionary row ) : bool
row string>.Dictionary A dictionary of column/celldata values
Результат bool

append() публичный Метод

Append the data in the given file to an existing dataset
public append ( String filename ) : bool
filename String The location of the file on disk
Результат bool

append() публичный Метод

Replaces the data in the existing attached dataset with the contents of the file
public append ( String filename, bool skipHeaders ) : bool
filename String The location of the file to add to the dataset
skipHeaders bool Whether to skip the first row of your import file
Результат bool

attach() публичный Метод

Attach to a given UID for a dataset that already exists
public attach ( string id ) : void
id string The Socrata UID
Результат void

attached() публичный Метод

Check to see if the dataset is associated with a valid UID.
public attached ( ) : bool
Результат bool

columns() публичный Метод

Gets a JSON representation of the columns
public columns ( ) : Newtonsoft.Json.Linq.JArray
Результат Newtonsoft.Json.Linq.JArray

copy() публичный Метод

Make a working copy of a published dataset, with all row data copied.
public copy ( ) : String
Результат String

copySchema() публичный Метод

Make a working copy of only the schema of a published dataset, with all row data omitted.
public copySchema ( ) : String
Результат String

create() публичный Метод

Creates a new, blank dataset with only a name.
public create ( String name ) : bool
name String The title of the dataset
Результат bool

create() публичный Метод

Creates a new, blank dataset.
public create ( String name, String description ) : bool
name String The name of the dataset (must be unique)
description String On optional description
Результат bool

delayAddRow() публичный Метод

Like addRow, but doesn't immediately send the data away. Instead, it stores it in a queue, which can be flushed with sendBatchRequest
public delayAddRow ( string>.Dictionary row ) : void
row string>.Dictionary A dictionary of column/celldata values
Результат void

delete() публичный Метод

Deletes (irreversibly) the current dataset
public delete ( ) : bool
Результат bool

importFile() публичный Метод

Creates a new dataset by importing a file
public importFile ( String filename ) : bool
filename String The location of the file on disk
Результат bool

metadata() публичный Метод

Gets the metadata associated with the dataset
public metadata ( ) : Newtonsoft.Json.Linq.JObject
Результат Newtonsoft.Json.Linq.JObject

publish() публичный Метод

Performs a publish operation on a working copy dataset, to commit the changes you've made to the working copy to the published copy. Note that this should be called on the working copy, not the published version.
public publish ( ) : bool
Результат bool

refresh() публичный Метод

Replaces the data in the existing attached dataset with the contents of the file
public refresh ( String filename ) : bool
filename String The location of the file to overwrite the dataset with
Результат bool

refresh() публичный Метод

Replaces the data in the existing attached dataset with the contents of the file
public refresh ( String filename, bool skipHeaders ) : bool
filename String The location of the file to overwrite the dataset with
skipHeaders bool Whether to skip the first row of your import file
Результат bool

rows() публичный Метод

Gets a JSON Array of the rows in the dataset
public rows ( ) : Newtonsoft.Json.Linq.JArray
Результат Newtonsoft.Json.Linq.JArray

setAttribution() публичный Метод

Sets the dataset's attribution, e.g. "provided by"
public setAttribution ( String attribution, String url ) : void
attribution String Name of the data source/organization
url String An optional link to the data source
Результат void

setDescription() публичный Метод

Sets the dataset's description
public setDescription ( String description ) : void
description String The description
Результат void

setPublic() публичный Метод

Sets the dataset's visibility
public setPublic ( bool isPublic ) : bool
isPublic bool Whether or not it should be publicly viewable
Результат bool

shortUrl() публичный Метод

Gets an href to the dataset, shortened.
public shortUrl ( ) : String
Результат String

uploadFile() публичный Метод

Upload a file to the dataset for use in a cell (e.g. image)
public uploadFile ( String filename ) : String
filename String Where the file is located on disk
Результат String