Skip to content

Instantly share code, notes, and snippets.

@geneorama
Last active December 6, 2018 20:01
Show Gist options
  • Save geneorama/c03a2db1463b32622f07e8779a8cb712 to your computer and use it in GitHub Desktop.
Save geneorama/c03a2db1463b32622f07e8779a8cb712 to your computer and use it in GitHub Desktop.
flattening `ls.socrata`

Flatten return values Socrata's data view

You can get the list of data sets in a Socrata domain with the data.json route, for example; "http://soda.demo.socrata.com/data.json".

However there are some very nested objects that are inconvenient for R. This is just an example of how to flatten specifically the data.json return value from Socrata.

This is not tested. This was a demo in conjunction with work on ls.socrata in the package https://github.com/Chicago/RSocrata/

ls.socrata <- function(url) {
  url <- as.character(url)
  parsedUrl <- httr::parse_url(url)
  if(is.null(parsedUrl$scheme) | is.null(parsedUrl$hostname))
    stop(url, " does not appear to be a valid URL.")
  parsedUrl$path <- "data.json"
  data_dot_json <- jsonlite::fromJSON(httr::build_url(parsedUrl))
  data_df <- as.data.frame(data_dot_json$dataset)
  
  # separate distribution information
  distro <- data_df[, "distribution"]
  data_df[, "distribution"] <- NULL
  distro <- lapply(1:length(distro), function(i)
    distro[[i]] <- cbind(landingPage = data_df$landingPage[i], distro[[i]], 
                         stringsAsFactors = FALSE) )
  distro <- do.call(rbind, distro)
  
  # clean up keywords
  keywords <- data_df$keyword
  data_df$keyword <- NA_character_
  for(i in 1:nrow(data_df)){
    if(!is.null(keywords[[i]])){
      data_df$keyword[i] <- jsonlite::toJSON(keywords[[i]])
    }
  }
  
  # Clean up theme
  themes <- data_df$theme
  data_df$theme <- NA_character_
  for(i in 1:nrow(data_df)){
    if(!is.null(keywords[[i]])){
      data_df$theme[i] <- jsonlite::toJSON(themes[[i]])
    }
  }
  
  # Flatten "contactPoint" field
  cp <- do.call(cbind, data_df[, "contactPoint"])
  colnames(cp) <- paste0("contactPoint:", colnames(cp))
  data_df$contactPoint <- NULL
  data_df <- data.frame(data_df, cp, stringsAsFactors = FALSE, check.names = F)
  
  # Flatten "publisher" field
  pub <- do.call(cbind, data_df[, "publisher"])
  colnames(pub) <- paste0("publisher:", colnames(pub))
  data_df$publisher <- NULL
  data_df <- data.frame(data_df, pub, stringsAsFactors = FALSE, check.names = F)
  
  # Assign Catalog Fields as attributes
  attr(data_df, "@context") <- data_dot_json$`@context`
  attr(data_df, "@id") <- data_dot_json$`@id`
  attr(data_df, "@type") <- data_dot_json$`@type`
  attr(data_df, "conformsTo") <- data_dot_json$conformsTo
  attr(data_df, "describedBy") <- data_dot_json$describedBy
  attr(data_df, "distribution") <- distro
  # Convert dates (strings) to POSIX-formatted dates
  data_df$issued <- as.POSIXct(data_df$issued)
  data_df$modified <- as.POSIXct(data_df$modified)
  data_df$theme <- as.character(data_df$theme)
  return(data_df)
}

Structure of return value:

> str(ls.socrata("https://soda.demo.socrata.com"))
'data.frame':	42 obs. of  15 variables:
 $ accessLevel       : chr  "public" "public" "public" "public" ...
 $ landingPage       : chr  "https://soda.demo.socrata.com/d/m9tk-n3mn" "https://soda.demo.socrata.com/d/4tka-6guv" "https://soda.demo.socrata.com/d/ppbu-8a96" "https://soda.demo.socrata.com/d/3vrn-tvhb" ...
 $ issued            : POSIXct, format: "2016-08-05" "2016-05-02" "2016-04-12" "2016-02-16" ...
 $ @type             : chr  "dcat:Dataset" "dcat:Dataset" "dcat:Dataset" "dcat:Dataset" ...
 $ modified          : POSIXct, format: "2016-08-05" "2016-09-02" "2016-04-12" "2016-02-16" ...
 $ identifier        : chr  "https://soda.demo.socrata.com/api/views/m9tk-n3mn" "https://soda.demo.socrata.com/api/views/4tka-6guv" "https://soda.demo.socrata.com/api/views/ppbu-8a96" "https://soda.demo.socrata.com/api/views/3vrn-tvhb" ...
 $ description       : chr  "What's my max again?" "Real-time, worldwide earthquake list for the past 7 days (not actually real-time)" "<script type=\"application/javascript\">alert(\"Yup!\");</script>\r\n\r\n<em>Bold!</em> Not bold!" "See https://github.com/marks/cdc-cruise-ship-inspections for more information and the code that produced this file" ...
 $ title             : chr  "What's my max again?" "My super awesome Earthquakes dataset" "earthquakes.csv" "CDC/VSP Cruise Ship Inspection Scores - Deficiencies File (19900101thru20160131)" ...
 $ keyword           : chr  NA NA NA "[\"cdc\",\"cruise ship\",\"inspection\"]" ...
 $ theme             : chr  NA NA NA "[\"Government\"]" ...
 $ license           : chr  NA NA NA NA ...
 $ contactPoint:@type: chr  "vcard:Contact" "vcard:Contact" "vcard:Contact" "vcard:Contact" ...
 $ contactPoint:fn   : chr  "<Nobody>" "<Nobody>" "<Nobody>" "<Nobody>" ...
 $ publisher:@type   : chr  "org:Organization" "org:Organization" "org:Organization" "org:Organization" ...
 $ publisher:name    : chr  "soda.demo.socrata.com" "soda.demo.socrata.com" "soda.demo.socrata.com" "soda.demo.socrata.com" ...
 - attr(*, "@context")= chr "https://project-open-data.cio.gov/v1.1/schema/catalog.jsonld"
 - attr(*, "@id")= chr "https://soda.demo.socrata.com/data.json"
 - attr(*, "@type")= chr "dcat:Catalog"
 - attr(*, "conformsTo")= chr "https://project-open-data.cio.gov/v1.1/schema"
 - attr(*, "describedBy")= chr "https://project-open-data.cio.gov/v1.1/schema/catalog.json"
 - attr(*, "distribution")='data.frame':	188 obs. of  4 variables:
  ..$ landingPage: chr  "https://soda.demo.socrata.com/d/m9tk-n3mn" "https://soda.demo.socrata.com/d/m9tk-n3mn" "https://soda.demo.socrata.com/d/m9tk-n3mn" "https://soda.demo.socrata.com/d/m9tk-n3mn" ...
  ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" ...
  ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/m9tk-n3mn/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/m9tk-n3mn/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/m9tk-n3mn/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/m9tk-n3mn/rows.xml?accessType=DOWNLOAD" ...
  ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml" ...

structure without flattening:

> str(ls.socrata("https://soda.demo.socrata.com"))
'data.frame':	42 obs. of  14 variables:
 $ accessLevel : chr  "public" "public" "public" "public" ...
 $ landingPage : chr  "https://soda.demo.socrata.com/d/m9tk-n3mn" "https://soda.demo.socrata.com/d/4tka-6guv" "https://soda.demo.socrata.com/d/ppbu-8a96" "https://soda.demo.socrata.com/d/3vrn-tvhb" ...
 $ issued      : POSIXct, format: "2016-08-05" "2016-05-02" "2016-04-12" "2016-02-16" ...
 $ @type       : chr  "dcat:Dataset" "dcat:Dataset" "dcat:Dataset" "dcat:Dataset" ...
 $ modified    : POSIXct, format: "2016-08-05" "2016-09-02" "2016-04-12" "2016-02-16" ...
 $ contactPoint:'data.frame':	42 obs. of  2 variables:
  ..$ @type: chr  "vcard:Contact" "vcard:Contact" "vcard:Contact" "vcard:Contact" ...
  ..$ fn   : chr  "<Nobody>" "<Nobody>" "<Nobody>" "<Nobody>" ...
 $ identifier  : chr  "https://soda.demo.socrata.com/api/views/m9tk-n3mn" "https://soda.demo.socrata.com/api/views/4tka-6guv" "https://soda.demo.socrata.com/api/views/ppbu-8a96" "https://soda.demo.socrata.com/api/views/3vrn-tvhb" ...
 $ publisher   :'data.frame':	42 obs. of  2 variables:
  ..$ @type: chr  "org:Organization" "org:Organization" "org:Organization" "org:Organization" ...
  ..$ name : chr  "soda.demo.socrata.com" "soda.demo.socrata.com" "soda.demo.socrata.com" "soda.demo.socrata.com" ...
 $ description : chr  "What's my max again?" "Real-time, worldwide earthquake list for the past 7 days (not actually real-time)" "<script type=\"application/javascript\">alert(\"Yup!\");</script>\r\n\r\n<em>Bold!</em> Not bold!" "See https://github.com/marks/cdc-cruise-ship-inspections for more information and the code that produced this file" ...
 $ title       : chr  "What's my max again?" "My super awesome Earthquakes dataset" "earthquakes.csv" "CDC/VSP Cruise Ship Inspection Scores - Deficiencies File (19900101thru20160131)" ...
 $ distribution:List of 42
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/m9tk-n3mn/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/m9tk-n3mn/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/m9tk-n3mn/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/m9tk-n3mn/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/4tka-6guv/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/4tka-6guv/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/4tka-6guv/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/4tka-6guv/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/ppbu-8a96/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ppbu-8a96/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ppbu-8a96/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ppbu-8a96/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/3vrn-tvhb/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/3vrn-tvhb/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/3vrn-tvhb/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/3vrn-tvhb/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/akuf-5ck2/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/akuf-5ck2/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/akuf-5ck2/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/akuf-5ck2/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/f45n-c7cd/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/f45n-c7cd/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/f45n-c7cd/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/f45n-c7cd/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	24 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" ...
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/geospatial/xq4d-dbqz?method=export&format=KML" "https://soda.demo.socrata.com/api/geospatial/xq4d-dbqz?method=export&format=KMZ" "https://soda.demo.socrata.com/api/geospatial/xq4d-dbqz?method=export&format=Shapefile" "https://soda.demo.socrata.com/api/geospatial/xq4d-dbqz?method=export&format=Original" ...
  .. ..$ mediaType  : chr  "application/vnd.google-earth.kml+xml" "application/vnd.google-earth.kmz" "application/zip" "application/zip" ...
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/xh6g-yugi/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/xh6g-yugi/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/xh6g-yugi/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/xh6g-yugi/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/kc76-ybeq/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/kc76-ybeq/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/kc76-ybeq/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/kc76-ybeq/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/tkyh-bzyg/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/tkyh-bzyg/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/tkyh-bzyg/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/tkyh-bzyg/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/ky8v-m6ra/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ky8v-m6ra/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ky8v-m6ra/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ky8v-m6ra/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/qw6e-rjj4/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/qw6e-rjj4/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/qw6e-rjj4/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/qw6e-rjj4/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/2646-ez2p/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/2646-ez2p/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/2646-ez2p/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/2646-ez2p/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/2asz-g9qq/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/2asz-g9qq/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/2asz-g9qq/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/2asz-g9qq/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/dq6t-d2dy/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/dq6t-d2dy/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/dq6t-d2dy/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/dq6t-d2dy/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/7pnm-wy53/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/7pnm-wy53/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/7pnm-wy53/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/7pnm-wy53/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/u59d-ba67/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/u59d-ba67/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/u59d-ba67/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/u59d-ba67/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/dq9c-sexm/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/dq9c-sexm/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/dq9c-sexm/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/dq9c-sexm/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/5cwr-8yx3/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/5cwr-8yx3/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/5cwr-8yx3/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/5cwr-8yx3/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/8m5u-egj4/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/8m5u-egj4/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/8m5u-egj4/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/8m5u-egj4/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/j5i2-7ftt/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/j5i2-7ftt/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/j5i2-7ftt/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/j5i2-7ftt/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/ximz-z9ju/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ximz-z9ju/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ximz-z9ju/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ximz-z9ju/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/e39b-rz36/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/e39b-rz36/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/e39b-rz36/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/e39b-rz36/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/haux-c2uc/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/haux-c2uc/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/haux-c2uc/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/haux-c2uc/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/cg2v-hnmg/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/cg2v-hnmg/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/cg2v-hnmg/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/cg2v-hnmg/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/9v9f-4dmi/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/9v9f-4dmi/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/9v9f-4dmi/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/9v9f-4dmi/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/3z6a-7qtw/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/3z6a-7qtw/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/3z6a-7qtw/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/3z6a-7qtw/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/etih-7ix2/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/etih-7ix2/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/etih-7ix2/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/etih-7ix2/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/ixhf-s364/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ixhf-s364/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ixhf-s364/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/ixhf-s364/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/jfs5-7tmq/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/jfs5-7tmq/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/jfs5-7tmq/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/jfs5-7tmq/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/jatp-jqxg/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/jatp-jqxg/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/jatp-jqxg/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/jatp-jqxg/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/irft-er6i/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/irft-er6i/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/irft-er6i/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/irft-er6i/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/3wfw-mdbc/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/3wfw-mdbc/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/3wfw-mdbc/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/3wfw-mdbc/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/sz7t-v658/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/sz7t-v658/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/sz7t-v658/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/sz7t-v658/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/kmin-k6sj/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/kmin-k6sj/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/kmin-k6sj/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/kmin-k6sj/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/4334-bgaj/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/4334-bgaj/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/4334-bgaj/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/4334-bgaj/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/93p8-sh74/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/93p8-sh74/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/93p8-sh74/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/93p8-sh74/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/emdb-u46w/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/emdb-u46w/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/emdb-u46w/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/emdb-u46w/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/dz6q-hdkn/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/dz6q-hdkn/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/dz6q-hdkn/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/dz6q-hdkn/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/6xzm-fzcu/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/6xzm-fzcu/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/6xzm-fzcu/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/6xzm-fzcu/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/9d3p-tn9t/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/9d3p-tn9t/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/9d3p-tn9t/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/9d3p-tn9t/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
  ..$ :'data.frame':	4 obs. of  3 variables:
  .. ..$ @type      : chr  "dcat:Distribution" "dcat:Distribution" "dcat:Distribution" "dcat:Distribution"
  .. ..$ downloadURL: chr  "https://soda.demo.socrata.com/api/views/qqtv-szd7/rows.csv?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/qqtv-szd7/rows.rdf?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/qqtv-szd7/rows.json?accessType=DOWNLOAD" "https://soda.demo.socrata.com/api/views/qqtv-szd7/rows.xml?accessType=DOWNLOAD"
  .. ..$ mediaType  : chr  "text/csv" "application/rdf+xml" "application/json" "application/xml"
 $ keyword     :List of 42
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : chr  "cdc" "cruise ship" "inspection"
  ..$ : chr  "cdc" "cruise ship" "inspection"
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : chr "ipa api beer"
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
  ..$ : NULL
 $ theme       : chr  "NULL" "NULL" "NULL" "Government" ...
 $ license     : chr  NA NA NA NA ...
 - attr(*, "@context")= chr "https://project-open-data.cio.gov/v1.1/schema/catalog.jsonld"
 - attr(*, "@id")= chr "https://soda.demo.socrata.com/data.json"
 - attr(*, "@type")= chr "dcat:Catalog"
 - attr(*, "conformsTo")= chr "https://project-open-data.cio.gov/v1.1/schema"
 - attr(*, "describedBy")= chr "https://project-open-data.cio.gov/v1.1/schema/catalog.json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment