Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle complex addresses with schema.org/PostalAddress?

Let's say I have an address which includes a parent building or other additional address info, for example:

Barnes & Noble
Union Square
33 E 17th St
New York, NY 10003

OR

Koi Restaurant
Bryant Park Hotel
40 W 40th St
New York, NY 10018

How should I markup the "Union Square" or "Bryant Park Hotel" part of the address using schema.org? Is this considered part of the street address? Yelp seems to put it all in the street address, e.g.:

<span itemprop="streetAddress">Union Square<br>33 E 17th St</span>
like image 705
User Avatar asked Oct 23 '12 06:10

User


2 Answers

That extra info is called the Firm Name, and can sometimes yield a better result when searching for a particular address or verifying it (trust me).

However, there seem to be two lines of "Firm Name" in each of the above addresses, which is extraneous and wouldn't yield helpful results.

As far as microdata goes, they don't have a "Firm Name" field, but they do have a "Name" field. The Schema.org example is thus:

<div itemscope itemtype="http://schema.org/PostalAddress">
 <span itemprop="name">Google Inc.</span>
 P.O. Box<span itemprop="postOfficeBoxNumber">1234</span>
 <span itemprop="addressLocality">Mountain View</span>,
 <span itemprop="addressRegion">CA</span>
 <span itemprop="postalCode">94043</span>
 <span itemprop="addressCountry">United States</span>
</div>

Notice that Google Inc. is in the "Name" field. That's where I'd put the extra info (if you have to have two lines of firm name, then do it there... but to use it for actual mailing or verification, take out the extra name.)

like image 66
Matt Avatar answered Nov 23 '22 00:11

Matt


Matt is correct about the firm name.

In both your examples, it looks like the input data is consistent, with the first line being more precise than the second line. If that is always the case with your data then you are golden. Stick with the first line as the recipient (or firm name) and the second line as "extra data". That "extra data" is really irrelevant from an address validation perspective since the address would get to the location regardless of the "extra data". The USPS relies on the address data more than "referential data" (except in the case of the North Pole, which we all know has only one valid address).

I took the liberty of submitting some variations of your addresses to be validated against the USPS data. I was looking to see if the USPS had the Firm Name attached to the address in either of these two cases. Nope.

barnes & noble union square 33 e 17th st 10003

barnes & noble union square 33 e 17th st 10003

barnes & noble 33 e 17th st 10003

union square barnes & noble 33 e 17th st 10003

Koi Restaurant Bryant Park Hotel 40 W 40th St 10018

Bryant Park Hotel Koi Restaurant 40 W 40th St 10018

Bryant Park Hotel Koi Restaurant 40 W 40th St 10018

In each case the address was parsed out correctly while the addressee AND the "extra data" was ignored. I hope that gives a little insight into how the USPS address validation process works.

like image 27
Jeffrey Avatar answered Nov 22 '22 23:11

Jeffrey