
658 F.3d 662 (2011)
EDGENET, INC., Plaintiff-Appellant,
v.
HOME DEPOT U.S.A., INC., and James Musial, Defendants-Appellees.
No. 10-1335.
United States Court of Appeals, Seventh Circuit.
Argued September 28, 2010.
Decided September 2, 2011.
Order Awarding Attorney's Fees and Denying Rehearing October 5, 2011.
*663 Jerold S. Solovy, Barry Levenstam (argued), Attorneys, Jenner & Block LLP, Chicago, IL, for Plaintiff-Appellant.
Jack R. Bierig (argued), Attorney, Sidley Austin LLP, Chicago, IL, Michael D. Huitink, Attorney, Godfrey & Kahn, Milwaukee, WI, for Defendants-Appellees.
Before EASTERBROOK, Chief Judge, and SYKES and TINDER, Circuit Judges.
EASTERBROOK, Chief Judge.
Home Depot has more than 2,000 retail stores, each of which stocks thousands of items. Customers can buy more than 250,000 items on Home Depot's web site, or by special order at a retail outlet. It would be impossible to manage such a complex inventory without a computer databaseand setting up a database requires a classification of its contents into categories, such as hand tools and appliances. Each classification comprises subclassifications (e.g., both hammers and screwdrivers are hand tools, and there are many types of each). The database also needs information about each product's attributes, such as the length of the screwdriver's blade and whether its handle is made of wood, metal, or rubber.
Manufacturers supply electronic records detailing their products' attributes. In 2004 Home Depot contracted with Edgenet, Inc., to develop a classification system, *664 which the parties call a taxonomy, that would be used to organize Home Depot's database. This contract provides that Edgenet would own the intellectual-property rights in the taxonomy and would license Home Depot to use it, while the products' manufacturers would own intellectual-property rights in their wares' attributes. A supplemental agreement in 2006 provides that Home Depot has a no-cost license to use "the product collection taxonomy" as long as Edgenet remains Home Depot's data-pool vendor and Home Depot continues paying for services. The license terminates with the contract, and Home Depot then must "immediately" stop using the taxonomy unless it exercises its option to purchase a perpetual license for $100,000.
In 2008 Home Depot began to develop an in-house database, incorporating the taxonomy that Edgenet had created. Edgenet got wind of Home Depot's preparations and registered a copyright on what it called the "Big Hammer Master Collection Taxonomy and Attributes 2008." On February 26, 2009, Home Depot told Edgenet that their business relationship would end soon. A check for $100,000 to purchase a perpetual license was enclosed with the letter. Home Depot instructed its suppliers to transmit their product data to its in-house system, HomeDepotLink, rather than to Edgenetwhich did not acquiesce in the transition. It returned the check and filed this suit. But the district judge dismissed the complaint under Fed. R.Civ.P. 12(b)(6), concluding that the 2006 contract, combined with Home Depot's tender of the $100,000 payment, meant that Home Depot can continue to use the taxonomy. 2010 U.S. Dist. LEXIS 2276 (E.D.Wis. Jan. 12, 2010).
Whether this case belongs in federal court depends on how we understand Edgenet's grievance. Is it seeking to enforce a copyright and obtain a remedy provided by federal law, or is it arguing that Home Depot failed to keep its promises and obtain a remedy for breach of contract? If the former, then the claim arises under federal law, and 28 U.S.C. § 1331 supplies jurisdiction. If the latter, then jurisdiction would depend on diversity of citizenship, because the fact that a copyright is a contract's subject matter does not change the status of a claim that arises under the contract. See T.B. Harms Co. v. Eliscu, 339 F.2d 823 (2d Cir.1964); Gaiman v. McFarlane, 360 F.3d 644, 652 (7th Cir. 2004); cf. International Armor & Limousine Co. v. Moloney Coachbuilders, Inc., 272 F.3d 912 (7th Cir.2001) (collecting decisions that apply the approach of T.B. Harms to trademark disputes). Both litigants are incorporated in Delaware, so the diversity jurisdiction of 28 U.S.C. § 1332 is unavailable.
Because neither side mentioned the T.B. Harms principle, we called for supplemental briefs. The parties' responses show that Edgenet's claim arises under the copyright law and that Home Depot has invoked the 2006 contract's offer of a perpetual license as an affirmative defense. This means that § 1331 supplies subject-matter jurisdiction. See also Nova Design Build, Inc. v. Grace Hotels, LLC, 652 F.3d 814 (7th Cir.2011). But the status of the contract as an affirmative defense calls into question the district court's use of Rule 12(b)(6).
Edgenet contends that HomeDepotLink infringes its copyright on the "Big Hammer Master Collection Taxonomy and Attributes 2008." Complaints can't be dismissed just because they ignore potential defenses; the time to deal with an affirmative defense is after it has been raised. See, e.g., Gomez v. Toledo, 446 U.S. 635, 100 S.Ct. 1920, 64 L.Ed.2d 572 (1980); United States v. Northern Trust Co., 372 F.3d 886 (7th Cir.2004). What is more, if *665 a motion to dismiss a complaint raises matters outside the original pleadingthe termination letter, the $100,000 check, the details of HomeDepotLink's derivation and operation, and a few more facts that we mention laterthe district court is supposed to treat the motion to dismiss as a motion for summary judgment. Fed. R.Civ.P. 12(d). When the complaint itself contains everything needed to show that the defendant must prevail on an affirmative defense, then the court can resolve the suit on the pleadings under Rule 12(c). See Brooks v. Ross, 578 F.3d 574 (7th Cir.2009). Here the district court relied on matters in addition to Edgenet's complaint, so it should have acted under Rule 56.
No harm was done, however. Edgenet does not dispute any of the material allegations in, or attached to, Home Depot's motion to dismiss. Edgenet had plenty of time to respond to Home Depot's arguments. It did not file a declaration or affidavit under Rule 56(d) specifying matters on which it needed discovery. Neither side has proffered any parol evidence that could assist with potentially ambiguous terms in the 2006 contract. The facts are essentially uncontested and present a question of law, for judges rather than juries interpret contracts when there is no extrinsic evidence. See Licciardi v. Kropp Forge Division Employees' Retirement Plan, 990 F.2d 979, 981 (7th Cir.1993).
Home Depot concedes that it used Edgenet's taxonomy, which makes HomeDepotLink a derivative work. But Edgenet promised Home Depot that for $100,000 it could have a perpetual license of "the product collection taxonomy". Home Depot tendered that payment. What's left to dispute?
Edgenet thinks that it has three answers. First, it contends, Home Depot infringed its copyright before paying the $100,000, which invalidates its option to license the taxonomy. Second, Edgenet maintains, it never promised to license the "Big Hammer Master Collection Taxonomy and Attributes 2008," which it says differs from "the product collection taxonomy" (the phrase in the 2006 contract); according to Edgenet, "the product collection taxonomy" means the taxonomy developed under the 2004 contract, not the revised version in use by 2008. Third, Edgenet observes that in 2008 Home Depot's Canadian affiliate stopped using Edgenet's taxonomy, and it believes that, by not paying $100,000 "immediately" thereafter, Home Depot forfeited its option to acquire a perpetual license. We analyze these contentions sequentially.
Home Depot didn't do anything wrong by copying the taxonomy before paying $100,000. Both the 2004 contract and the 2006 contract give Home Depot permission to employ the taxonomy as long as Edgenet remained its database-service provider. During the entire time that Home Depot developed HomeDepot-Link, Edgenet played that role, so Home Depot could use the taxonomy as it pleased. Neither contract limits the way in which Home Depot could use the taxonomy, and the exclusive rights under copyright law (unlike patent law) do not attach to the product into which a copyrighted work may be incorporated. All Home Depot needed were the rights to copy the taxonomy and prepare a derivative work, see 17 U.S.C. § 106(1), (2); the unrestricted license gave it those rights.
Any limits on what Home Depot could do with the classification system depended on a contract, see ProCD, Inc. v. Zeidenberg, 86 F.3d 1447 (7th Cir.1996), and the absence of limits is dispositive. What the contracts did forbid was any effort to decompile or reverse engineer Edgenet's software. Although it once suspected that Home Depot had done this, Edgenet no *666 longer contends that Home Depot broke its promise to refrain from reverse engineering or decompiling. It used only the taxonomy itselfwhich from the beginning has been accessible without decompilers. (The taxonomy is visible to the general public; both Home Depot and customers use it to navigate the product database.)
Home Depot had an option to acquire a perpetual license to "the product collection taxonomy." Edgenet's argument that this means only the 2004 or 2006 version of the taxonomy amounts to a contention that it mousetrapped its customer. We are surprised that a firm seeking good relations with other customers would advance such an ignoble position. The taxonomy was a work in progress. As Home Depot added or dropped products, the taxonomy changed. If, as Edgenet now says, its 2006 promise meant only that for $100,000 Home Depot could use an old version of the taxonomy, then it was offering nothing that Home Depot would want to buy. This would imply, too, that Home Depot violated the copyright laws continually even while the contract was in force, for Home Depot always used the taxonomy's current version rather than the outdated one Edgenet now says it licensed.
Yet the 2006 contract speaks of "the product collection taxonomy" (emphasis added)and this use of the definite article is appropriate only if there is just one taxonomy. That singular taxonomy must be the current version. Whatever Home Depot was entitled to use while the contract was in force, it was entitled to license for the future by exercising its option.
That the registered copyright covers a taxonomy "and Attributes" does not affect the analysis. Edgenet was not responsible for the "attributes"; these came from the products' vendors, and Edgenet could not claim any intellectual-property interest in them just by sorting them into bins using a classification system. Cf. Feist Publications, Inc. v. Rural Telephone Service Co., 499 U.S. 340, 111 S.Ct. 1282, 113 L.Ed.2d 358 (1991). Edgenet's interest is in the classification system that it created. See American Dental Association v. Delta Dental Plans Association, 126 F.3d 977 (7th Cir.1997) (holding that taxonomies are copyrightable). And the 2006 contract gave Home Depot an option to acquire a perpetual license to that classification system.
Perhaps by "attributes" all Edgenet means is the detailed subclassifications. Thus a particular screwdriver part might be classified under tools / manual / screwdriver / Phillips / bits / metal. Edgenet contends that it created "nodes" (subcategories) and told products' vendors which details their submissions of raw data had to include in order to ensure that products could be classified properly in the database. Because this hierarchy of categories and nodesrather than the characteristics of a given product such as a Lisle # 3 Phillips screwdriver bit # 29550is what Edgenet means by "attributes," however, the attributes are part of the taxonomy under the contract. The 2006 contract does not distinguish between the top-level categories (such as "tools") and the more specific ones (such as "bits"). Home Depot's option covers the taxonomy from top to bottom.
Finally comes the fact that in 2008 Home Depot's Canadian affiliate dropped Edgenet. Why this should entitle Edgenet to any relief against Home Depot U.S.A., Inc., the principal defendant, is a puzzle. The Home Depot, Inc., the top level of the corporate structure, has operating subsidiaries in the United States, Canada, and other nations. Edgenet does not contend that any of the firms has ignored corporate formalities or that there is any other reason to hold Home Depot U.S.A. responsible for a decision made by Home Depot Canada.
*667 When Home Depot Canada stopped using Edgenet's services, The Home Depot, Inc. (the parent) lost the right to a no-cost license and thus could not pass that right to Home Depot U.S.A. The contract called for The Home Depot, Inc., to use Edgenet's services in both the U.S. and Canada, and the no-extra-cost license granted by § 5 of the 2006 contract was contingent on both subsidiaries using Edgenet's services. Yet Edgenet never asked The Home Depot, Inc., for additional payment after the Canadian subsidiary switched providers. Perhaps Edgenet could have treated the Canadian subsidiary's defection as breach of contract and revoked the license. Had it done that (which it didn't), then the $100,000 payment would have become due "immediately" if Home Depot wanted a perpetual license. For the option to take a perpetual license is in § 2B of the 2006 contract, not § 5, and what the contract requires be done "immediately" is to cease using the taxonomy if the license ends.
The only reason why payment would need to be "immediate" is if Home Depot wanted to use the taxonomy after Edgenet declared the license over. Edgenet never did that; Edgenet went on providing data services to Home Depot until it sent its letter in February 2009. A check for $100,000 accompanied the letter. Termination of the contract lay a few months in the future; it required advance notice, which Home Depot gave. When Home Depot exercised its option, the copyright license for the taxonomy was in force. Thus Home Depot has not been in violation of the copyright laws for even one day.
AFFIRMED

ORDER
Home Depot has requested an award of attorneys' fees under 17 U.S.C. § 505. A prevailing defendant in a copyright suit is presumptively entitled to an award. See, e.g., Woodhaven Homes & Realty, Inc. v. Hotz, 396 F.3d 822, 824 (7th Cir.2005). Edgenet has not given us any persuasive reason to depart from that outcome. Although this is fundamentally a contract suit, under which attorneys' fees would be unavailable, Edgenet invoked the copyright laws and insisted that the suit remain in federal court even after the judges questioned that choice. It must bear the consequences of that decision. Home Depot seeks an award of $72,795, the amount it paid its appellate lawyer. Edgenet has not taken issue with that figure, and we therefore award Home Depot $72,795 as attorneys' fees under § 505.
Plaintiff-appellant filed a petition for rehearing and rehearing en banc on September 16, 2011. No judge in regular active service has requested a vote on the petition for rehearing en banc,[*] and all of the judges on the panel have voted to deny rehearing. The petition for rehearing is therefore DENIED.
NOTES
[*]  Judge Williams did not participate in the consideration of this petition.
