C# Class Socrata.Dataset

A Socrata dataset and associated rows/columns/metadata
Inheritance: ApiBase
Afficher le fichier Open project: socrata-archive/socrata-csharp-deprecated Class Usage Examples

Méthodes publiques

Méthode Description
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)

Private Methods

Méthode Description
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

Method Details

addColumn() public méthode

public addColumn ( String name ) : bool
name String
Résultat bool

addColumn() public méthode

public addColumn ( String name, String description ) : bool
name String
description String
Résultat bool

addColumn() public méthode

public addColumn ( String name, String description, String type ) : bool
name String
description String
type String
Résultat bool

addColumn() public méthode

public addColumn ( String name, String description, String type, int width ) : bool
name String
description String
type String
width int
Résultat bool

addColumn() public méthode

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
Résultat bool

addRow() public méthode

Add a row to the dataset
public addRow ( string>.Dictionary row ) : bool
row string>.Dictionary A dictionary of column/celldata values
Résultat bool

append() public méthode

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
Résultat bool

append() public méthode

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
Résultat bool

attach() public méthode

Attach to a given UID for a dataset that already exists
public attach ( string id ) : void
id string The Socrata UID
Résultat void

attached() public méthode

Check to see if the dataset is associated with a valid UID.
public attached ( ) : bool
Résultat bool

columns() public méthode

Gets a JSON representation of the columns
public columns ( ) : Newtonsoft.Json.Linq.JArray
Résultat Newtonsoft.Json.Linq.JArray

copy() public méthode

Make a working copy of a published dataset, with all row data copied.
public copy ( ) : String
Résultat String

copySchema() public méthode

Make a working copy of only the schema of a published dataset, with all row data omitted.
public copySchema ( ) : String
Résultat String

create() public méthode

Creates a new, blank dataset with only a name.
public create ( String name ) : bool
name String The title of the dataset
Résultat bool

create() public méthode

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
Résultat bool

delayAddRow() public méthode

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
Résultat void

delete() public méthode

Deletes (irreversibly) the current dataset
public delete ( ) : bool
Résultat bool

importFile() public méthode

Creates a new dataset by importing a file
public importFile ( String filename ) : bool
filename String The location of the file on disk
Résultat bool

metadata() public méthode

Gets the metadata associated with the dataset
public metadata ( ) : Newtonsoft.Json.Linq.JObject
Résultat Newtonsoft.Json.Linq.JObject

publish() public méthode

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
Résultat bool

refresh() public méthode

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
Résultat bool

refresh() public méthode

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
Résultat bool

rows() public méthode

Gets a JSON Array of the rows in the dataset
public rows ( ) : Newtonsoft.Json.Linq.JArray
Résultat Newtonsoft.Json.Linq.JArray

setAttribution() public méthode

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
Résultat void

setDescription() public méthode

Sets the dataset's description
public setDescription ( String description ) : void
description String The description
Résultat void

setPublic() public méthode

Sets the dataset's visibility
public setPublic ( bool isPublic ) : bool
isPublic bool Whether or not it should be publicly viewable
Résultat bool

shortUrl() public méthode

Gets an href to the dataset, shortened.
public shortUrl ( ) : String
Résultat String

uploadFile() public méthode

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
Résultat String