Supported file formats

Input files for BSDS Management Tool can be either CSV or XML files. Sample input files can be found in <folder_name> folder.

CSV

CSV input files for BSDS Management Tool should comply to following rules:
  • Every line consists of one entity's properties' values separated by predefined delimiter i.e. comma, tab, pipe (standard .csv);
  • First line of input file should describe properties for entities stored in following lines:
    • Each attribute in the first line describes entity property and its type;
    • Exactly one property should be marked as primary key.
  • In every file format property value may contain ',' character however in case of comma-separated csv the whole value should be put in quotation marks.

Sample input file in csv (comma separated format) has been presented below.
Note that EntityID property of type Edm.Int64 has been marked as primary key. What is more last entity BusinessName contains ',' character so its value has been quoted.

EntityID(Edm.Int64@primaryKey),Latitude(Edm.Double),Longitude(Edm.Double),BusinessName(Edm.String),AddressLine(Edm.String),PrimaryCity(Edm.String)
1,40.725186,-73.997171,Infusion New York,599 Broadway,New York
2,43.64700225,-79.38837472,Infusion Toronto,276 King Street West,Toronto
3,51.50142121,-0.02345032,Infusion UK - London,40 Marsh Wall,London
4,42.362858,-71.083763,Infusion  Boston,1 Broadway,Cambridge
5,25.10046,55.16972,Infusion UAE - Dubai,3301-B Business Central Towers,Dubai
6,29.746175,-95.559407,Infusion Houston,2000 West Sam Houston Pkwy South,Houston
7,50.064817,19.95218,"Infusion Poland, Krakow",Lubicz 23A,Krakow

XML

XML input file's format should follow Bing Maps schema definition http://msdn.microsoft.com/en-us/library/gg585138.aspx.
If any of values present in the xml file contain special characters shuch as & or " they are automatically escaped ("&" -> "&amp;", """ -> "&quote;").

Sample XML input file has been presented below.
<?xml version="1.0" standalone="yes"?>

<BSDSData>
  <xs:schema id="BSDSSchema" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="dataSourceName" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="BsdsEntity">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="EntityID" type="xs:long" minOccurs="0" />
                <xs:element name="Latitude" type="xs:double" minOccurs="0" />
                <xs:element name="Longitude" type="xs:double" minOccurs="0" />
                <xs:element name="BusinessName" type="xs:string" minOccurs="0" />
                <xs:element name="AddressLine" type="xs:string" minOccurs="0" />
                <xs:element name="PrimaryCity" type="xs:string" minOccurs="0" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
      <xs:unique name="Constraint1" msdata:PrimaryKey="true">
        <xs:selector xpath=".//BsdsEntity" />
        <xs:field xpath="EntityID" />
      </xs:unique>
    </xs:element>
  </xs:schema>
  <BsdsEntity>
    <EntityID>1</EntityID>
    <Latitude>40.725186</Latitude>
    <Longitude>-73.997171</Longitude>
    <BusinessName>Infusion New York</BusinessName>
    <AddressLine>599 Broadway</AddressLine>
    <PrimaryCity>New York</PrimaryCity>
  </BsdsEntity>
  <BsdsEntity>
    <EntityID>2</EntityID>
    <Latitude>43.64700225</Latitude>
    <Longitude>-79.38837472</Longitude>
    <BusinessName>Infusion Toronto</BusinessName>
    <AddressLine>276 King Street West</AddressLine>
    <PrimaryCity>Toronto</PrimaryCity>
  </BsdsEntity>
  <BsdsEntity>
    <EntityID>3</EntityID>
    <Latitude>51.50142121</Latitude>
    <Longitude>-0.02345032</Longitude>
    <BusinessName>Infusion UK - London</BusinessName>
    <AddressLine>40 Marsh Wall</AddressLine>
    <PrimaryCity>London</PrimaryCity>
  </BsdsEntity>
  <BsdsEntity>
    <EntityID>4</EntityID>
    <Latitude>42.362858</Latitude>
    <Longitude>-71.083763</Longitude>
    <BusinessName>Infusion  Boston</BusinessName>
    <AddressLine>1 Broadway</AddressLine>
    <PrimaryCity>Cambridge</PrimaryCity>
  </BsdsEntity>
  <BsdsEntity>
    <EntityID>5</EntityID>
    <Latitude>25.10046</Latitude>
    <Longitude>55.16972</Longitude>
    <BusinessName>Infusion UAE - Dubai</BusinessName>
    <AddressLine>3301-B Business Central Towers</AddressLine>
    <PrimaryCity>Dubai</PrimaryCity>
  </BsdsEntity>
  <BsdsEntity>
    <EntityID>6</EntityID>
    <Latitude>29.746175</Latitude>
    <Longitude>-95.559407</Longitude>
    <BusinessName>Infusion Houston</BusinessName>
    <AddressLine>2000 West Sam Houston Pkwy South</AddressLine>
    <PrimaryCity>Houston</PrimaryCity>
  </BsdsEntity>
  <BsdsEntity>
    <EntityID>7</EntityID>
    <Latitude>50.064817</Latitude>
    <Longitude>19.95218</Longitude>
    <BusinessName>Infusion Poland, Krakow</BusinessName>
    <AddressLine>Lubicz 23A</AddressLine>
    <PrimaryCity>Krakow</PrimaryCity>
  </BsdsEntity>
</BSDSData>

Last edited Jun 30, 2011 at 1:21 PM by bwasielak, version 13

Comments

No comments yet.