meta_oxide 0.1.1

Universal metadata extraction library supporting 13 formats (HTML Meta, Open Graph, Twitter Cards, JSON-LD, Microdata, Microformats, RDFa, Dublin Core, Web App Manifest, oEmbed, rel-links, Images, SEO) with 7 language bindings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
# Structured Data Formats - Complete Guide

This document provides a comprehensive overview of all structured data formats that MetaOxide extracts from web pages.

## Table of Contents

- [Format Comparison]#format-comparison
- [Microformats2]#microformats2
- [Open Graph Protocol]#open-graph-protocol
- [Twitter Cards]#twitter-cards
- [Schema.org JSON-LD]#schemaorg-json-ld
- [Microdata]#microdata
- [RDFa]#rdfa
- [Standard HTML Meta Tags]#standard-html-meta-tags
- [Which Format Should I Use?]#which-format-should-i-use

---

## Format Comparison

| Format | Adoption | Primary Use Case | Complexity | SEO Impact | Social Impact |
|--------|----------|-----------------|------------|------------|---------------|
| **Open Graph** | 60%+ | Facebook/social sharing | Low | Medium | High |
| **Twitter Cards** | 45% | Twitter/X sharing | Low | Low | High |
| **JSON-LD** | 41% | Google Rich Results, AI | Medium | Very High | Low |
| **Microdata** | 26% | SEO (older sites) | Medium | High | Low |
| **Microformats** | 5-10% | IndieWeb, semantic web | Low | Low | Low |
| **RDFa** | <10% | Government, academic | High | Medium | Low |
| **Meta Tags** | 100% | Basic metadata | Very Low | Medium | Low |

### When Each Format is Used

```
┌─────────────────────────────────────────────────────────────┐
│                    Modern Website (2024)                     │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  <head>                                                      │
│    <!-- Standard Meta (100% of sites) -->                   │
│    <meta name="description" content="...">                  │
│    <link rel="canonical" href="...">                        │
│                                                              │
│    <!-- Open Graph (60%+ of sites) -->                      │
│    <meta property="og:title" content="...">                 │
│    <meta property="og:image" content="...">                 │
│                                                              │
│    <!-- Twitter Cards (45% of sites) -->                    │
│    <meta name="twitter:card" content="...">                 │
│                                                              │
│    <!-- JSON-LD (41% of sites, growing fast) -->            │
│    <script type="application/ld+json">                      │
│    {                                                         │
│      "@context": "https://schema.org",                      │
│      "@type": "Article",                                    │
│      "headline": "..."                                       │
│    }                                                         │
│    </script>                                                 │
│  </head>                                                     │
│                                                              │
│  <body>                                                      │
│    <!-- Microformats2 (5-10% of sites) -->                  │
│    <article class="h-entry">                                │
│      <h1 class="p-name">Title</h1>                          │
│    </article>                                                │
│                                                              │
│    <!-- Microdata (26% of sites, declining) -->             │
│    <div itemscope itemtype="https://schema.org/Person">    │
│      <span itemprop="name">John</span>                      │
│    </div>                                                    │
│  </body>                                                     │
└─────────────────────────────────────────────────────────────┘
```

---

## Microformats2

**Adoption**: 5-10% of websites
**Primary Use**: IndieWeb, semantic HTML, decentralized social web
**Location**: HTML body (class attributes)

### What It Is

Microformats are simple conventions for embedding structured data in HTML using class names.

### Example

```html
<div class="h-card">
  <span class="p-name">Jane Doe</span>
  <a class="u-email" href="mailto:jane@example.com">Email</a>
  <img class="u-photo" src="photo.jpg">
  <p class="p-note">Software engineer</p>
</div>
```

### Supported Types (Current + Planned)

- **h-card** - People and organizations
-**h-entry** - Blog posts, articles, notes
-**h-event** - Events
- 🔜 **h-feed** - Feeds of entries
- 🔜 **h-review** - Reviews
- 🔜 **h-product** - Products
- 🔜 **h-recipe** - Recipes
- 🔜 **h-adr** - Addresses
- 🔜 **h-geo** - Geographic coordinates

### Property Prefixes

- `p-*` - Plain text properties (name, summary)
- `u-*` - URL properties (url, photo)
- `dt-*` - DateTime properties (published, updated)
- `e-*` - Embedded HTML properties (content)

### Best For

- Personal websites and blogs
- IndieWeb applications
- Decentralized social networks
- Semantic HTML markup

### Pros & Cons

**Pros:**
- Simple to implement
- Human-readable HTML
- No external schema required
- Works well for small sites

**Cons:**
- Lower adoption
- Not recognized by Google for Rich Results
- Limited social media support

---

## Open Graph Protocol

**Adoption**: 60%+ of websites
**Primary Use**: Facebook, LinkedIn, social sharing
**Location**: HTML head (meta tags with property attribute)

### What It Is

Created by Facebook, Open Graph turns web pages into rich objects in social graphs. When you share a link on Facebook/LinkedIn, this is what controls how it appears.

### Example

```html
<head>
  <!-- Basic -->
  <meta property="og:title" content="The Best Article Ever">
  <meta property="og:type" content="article">
  <meta property="og:url" content="https://example.com/article">
  <meta property="og:image" content="https://example.com/image.jpg">
  <meta property="og:description" content="This article is amazing...">
  <meta property="og:site_name" content="My Website">

  <!-- Article-specific -->
  <meta property="article:published_time" content="2024-01-01T12:00:00Z">
  <meta property="article:author" content="Jane Doe">
  <meta property="article:section" content="Technology">
  <meta property="article:tag" content="Rust">

  <!-- Image details -->
  <meta property="og:image:width" content="1200">
  <meta property="og:image:height" content="630">
  <meta property="og:image:alt" content="Article hero image">
</head>
```

### Supported Types

**Basic Types:**
- article
- website
- profile
- book
- music.song, music.album, music.playlist
- video.movie, video.tv_show, video.episode

**Properties by Type:**

**Article:**
```
article:published_time
article:modified_time
article:author
article:section
article:tag
```

**Profile:**
```
profile:first_name
profile:last_name
profile:username
profile:gender
```

**Video:**
```
video:url
video:secure_url
video:type
video:width
video:height
video:duration
```

### Best For

- Social media sharing
- Link previews on Facebook, LinkedIn, Slack
- Controlling how your content appears when shared
- Any content that might be shared socially

### Pros & Cons

**Pros:**
- Widely supported (60%+ of websites)
- Controls social sharing appearance
- Simple to implement
- Works across multiple platforms

**Cons:**
- No direct SEO benefit
- Duplicates other metadata
- Image size requirements (1200x630 recommended)

---

## Twitter Cards

**Adoption**: 45% of websites
**Primary Use**: Twitter/X link previews
**Location**: HTML head (meta tags with name attribute)

### What It Is

Twitter's metadata format for rich link previews. Similar to Open Graph but Twitter-specific.

### Example

```html
<head>
  <!-- Card type -->
  <meta name="twitter:card" content="summary_large_image">

  <!-- Basic info -->
  <meta name="twitter:title" content="The Best Article Ever">
  <meta name="twitter:description" content="This article is amazing...">
  <meta name="twitter:image" content="https://example.com/image.jpg">
  <meta name="twitter:image:alt" content="Article hero image">

  <!-- Attribution -->
  <meta name="twitter:site" content="@mywebsite">
  <meta name="twitter:creator" content="@janedoe">

  <!-- App card (for mobile apps) -->
  <meta name="twitter:app:id:iphone" content="123456789">
  <meta name="twitter:app:id:googleplay" content="com.example.app">
</head>
```

### Card Types

**summary**
- Title, description, thumbnail image
- Small square image (120x120)
- Good for: Articles, blog posts

**summary_large_image**
- Title, description, large image
- Large image (280x150)
- Good for: Featured articles, visual content

**app**
- Mobile app information
- Download links for iOS/Android
- Good for: App promotion

**player**
- Video/audio player embed
- Good for: Video content, podcasts

### Best For

- Twitter/X sharing
- Content with strong visual component
- Mobile apps
- Video/audio content

### Pros & Cons

**Pros:**
- Controls Twitter appearance
- Fallback to Open Graph if missing
- Multiple card types for different content

**Cons:**
- Twitter/X only
- Image size requirements
- Duplicates Open Graph data

### Twitter vs Open Graph

Twitter will fall back to Open Graph tags if Twitter tags are missing:

```
twitter:title → og:title → <title>
twitter:description → og:description → <meta name="description">
twitter:image → og:image
```

**Best practice**: Use both for maximum compatibility.

---

## Schema.org JSON-LD

**Adoption**: 41% of websites (growing rapidly)
**Primary Use**: Google Rich Results, AI/LLM training, SEO
**Location**: HTML head or body (script tag)

### What It Is

JSON-LD (JavaScript Object Notation for Linked Data) is Google's preferred format for structured data. It's a script tag containing JSON describing your page content.

### Why It Matters

- **Google Rich Results**: Recipe cards, event listings, product reviews
- **AI Training**: Used to train LLMs (ChatGPT, Claude, etc.)
- **Knowledge Graphs**: Powers Google's Knowledge Graph
- **Voice Search**: Enables voice assistants to understand content

### Example

```html
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "The Best Article Ever",
  "description": "This article is amazing...",
  "image": "https://example.com/image.jpg",
  "datePublished": "2024-01-01T12:00:00Z",
  "dateModified": "2024-01-02T10:00:00Z",
  "author": {
    "@type": "Person",
    "name": "Jane Doe",
    "url": "https://example.com/authors/jane"
  },
  "publisher": {
    "@type": "Organization",
    "name": "My Website",
    "logo": {
      "@type": "ImageObject",
      "url": "https://example.com/logo.png"
    }
  }
}
</script>
```

### Common Types

#### Content Types

**Article / NewsArticle / BlogPosting**
```json
{
  "@type": "Article",
  "headline": "...",
  "datePublished": "...",
  "author": {...},
  "image": "...",
  "articleBody": "..."
}
```

**WebPage / WebSite**
```json
{
  "@type": "WebSite",
  "name": "My Website",
  "url": "https://example.com",
  "potentialAction": {
    "@type": "SearchAction",
    "target": "https://example.com/search?q={search_term}",
    "query-input": "required name=search_term"
  }
}
```

#### People & Organizations

**Person**
```json
{
  "@type": "Person",
  "name": "Jane Doe",
  "jobTitle": "Software Engineer",
  "image": "https://example.com/jane.jpg",
  "sameAs": [
    "https://twitter.com/janedoe",
    "https://github.com/janedoe"
  ]
}
```

**Organization / LocalBusiness**
```json
{
  "@type": "LocalBusiness",
  "name": "Joe's Coffee Shop",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "123 Main St",
    "addressLocality": "Seattle",
    "addressRegion": "WA",
    "postalCode": "98101"
  },
  "telephone": "+1-206-555-1234",
  "openingHours": "Mo-Fr 08:00-17:00"
}
```

#### Products & Commerce

**Product**
```json
{
  "@type": "Product",
  "name": "Amazing Widget",
  "image": "https://example.com/widget.jpg",
  "description": "The best widget ever made",
  "brand": {
    "@type": "Brand",
    "name": "WidgetCo"
  },
  "offers": {
    "@type": "Offer",
    "price": "29.99",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.5",
    "reviewCount": "123"
  }
}
```

#### Events

**Event**
```json
{
  "@type": "Event",
  "name": "Tech Conference 2024",
  "startDate": "2024-09-10T09:00:00-07:00",
  "endDate": "2024-09-12T17:00:00-07:00",
  "location": {
    "@type": "Place",
    "name": "Convention Center",
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "123 Convention Blvd",
      "addressLocality": "Seattle",
      "addressRegion": "WA"
    }
  },
  "offers": {
    "@type": "Offer",
    "price": "299.00",
    "priceCurrency": "USD",
    "url": "https://example.com/tickets"
  }
}
```

#### Recipes

**Recipe**
```json
{
  "@type": "Recipe",
  "name": "Chocolate Chip Cookies",
  "image": "https://example.com/cookies.jpg",
  "author": {
    "@type": "Person",
    "name": "Jane Doe"
  },
  "datePublished": "2024-01-01",
  "description": "The best chocolate chip cookies",
  "prepTime": "PT15M",
  "cookTime": "PT10M",
  "totalTime": "PT25M",
  "recipeYield": "24 cookies",
  "recipeIngredient": [
    "2 cups flour",
    "1 cup butter",
    "1 cup chocolate chips"
  ],
  "recipeInstructions": [
    {
      "@type": "HowToStep",
      "text": "Mix flour and butter"
    },
    {
      "@type": "HowToStep",
      "text": "Add chocolate chips"
    }
  ],
  "nutrition": {
    "@type": "NutritionInformation",
    "calories": "150 calories"
  }
}
```

#### Navigation

**BreadcrumbList**
```json
{
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://example.com"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Category",
      "item": "https://example.com/category"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "Article",
      "item": "https://example.com/category/article"
    }
  ]
}
```

#### FAQ

**FAQPage**
```json
{
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is MetaOxide?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "MetaOxide is a Rust library for extracting structured data from web pages."
      }
    }
  ]
}
```

### Best For

- SEO and Google Rich Results
- E-commerce sites (products, reviews)
- Content sites (articles, recipes)
- Local businesses
- Events
- Any site wanting better search visibility

### Pros & Cons

**Pros:**
- Google's preferred format
- Rich Results eligibility
- Clean separation from HTML
- Multiple schemas on one page
- AI/LLM training data
- Growing adoption (41% and rising)

**Cons:**
- Can be verbose
- Requires validation
- No direct social media benefit
- Learning curve for complex types

---

## Microdata

**Adoption**: 26% of websites (declining)
**Primary Use**: SEO (older sites)
**Location**: HTML body (attributes on elements)

### What It Is

HTML5 specification for embedding structured data using HTML attributes. Uses same Schema.org vocabulary as JSON-LD but inline in HTML.

### Example

```html
<div itemscope itemtype="https://schema.org/Person">
  <span itemprop="name">Jane Doe</span>
  <span itemprop="jobTitle">Software Engineer</span>
  <div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
    <span itemprop="streetAddress">123 Main St</span>
    <span itemprop="addressLocality">Seattle</span>
    <span itemprop="addressRegion">WA</span>
  </div>
  <a href="mailto:jane@example.com" itemprop="email">Email</a>
</div>
```

### Best For

- Legacy sites already using microdata
- When you want markup inline with content
- When JSON-LD is not an option

### Pros & Cons

**Pros:**
- Same Schema.org vocabulary as JSON-LD
- Inline with content
- Google supports it

**Cons:**
- Declining adoption (JSON-LD preferred)
- Clutters HTML
- Harder to maintain
- More verbose than microformats

**Migration**: Google recommends migrating from Microdata to JSON-LD.

---

## RDFa

**Adoption**: <10% of websites
**Primary Use**: Government sites, academic institutions
**Location**: HTML body (attributes on elements)

### What It Is

Resource Description Framework in Attributes. A W3C recommendation for embedding RDF data in HTML.

### Example

```html
<div vocab="https://schema.org/" typeof="Person">
  <span property="name">Jane Doe</span>
  <span property="jobTitle">Software Engineer</span>
  <a href="https://example.com" property="url">Website</a>
</div>
```

### Best For

- Government websites
- Academic/research sites
- Semantic web applications
- When RDF compatibility is required

### Pros & Cons

**Pros:**
- W3C standard
- RDF compatibility
- Flexible vocabularies

**Cons:**
- Low adoption
- Complex syntax
- JSON-LD/Microdata preferred by Google
- Steeper learning curve

---

## Standard HTML Meta Tags

**Adoption**: 100% of websites
**Primary Use**: Basic metadata, SEO
**Location**: HTML head

### What It Is

Standard HTML meta tags and link elements. The foundation of web metadata.

### Examples

```html
<head>
  <!-- Page info -->
  <title>Page Title</title>
  <meta name="description" content="Page description for search results">
  <meta name="keywords" content="keyword1, keyword2">
  <meta name="author" content="Jane Doe">

  <!-- SEO -->
  <link rel="canonical" href="https://example.com/page">
  <meta name="robots" content="index, follow">

  <!-- Viewport (mobile) -->
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <!-- Favicons -->
  <link rel="icon" type="image/png" href="/favicon.png">
  <link rel="apple-touch-icon" href="/apple-touch-icon.png">

  <!-- Feeds -->
  <link rel="alternate" type="application/rss+xml" href="/feed.xml" title="RSS Feed">

  <!-- Theme -->
  <meta name="theme-color" content="#ffffff">

  <!-- Pagination -->
  <link rel="prev" href="https://example.com/page/1">
  <link rel="next" href="https://example.com/page/3">
</head>
```

### Best For

- Every website (required!)
- Basic SEO
- Browser features
- Feed discovery

---

## Which Format Should I Use?

### Recommended Stack for Modern Websites (2024)

```html
<head>
  <!-- 1. REQUIRED: Standard Meta (everyone) -->
  <title>Your Page Title</title>
  <meta name="description" content="...">
  <link rel="canonical" href="https://example.com/page">

  <!-- 2. RECOMMENDED: Open Graph (social sharing) -->
  <meta property="og:title" content="...">
  <meta property="og:description" content="...">
  <meta property="og:image" content="...">
  <meta property="og:url" content="...">

  <!-- 3. RECOMMENDED: Twitter Cards (Twitter/X) -->
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:title" content="...">
  <meta name="twitter:image" content="...">

  <!-- 4. HIGHLY RECOMMENDED: JSON-LD (SEO, AI) -->
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "Article",
    "headline": "...",
    "author": {...}
  }
  </script>

  <!-- 5. OPTIONAL: Microformats (IndieWeb) -->
</head>
<body>
  <article class="h-entry">
    <h1 class="p-name">...</h1>
  </article>
</body>
```

### Decision Matrix

| Your Goal | Use These Formats |
|-----------|------------------|
| **Maximum social sharing** | Open Graph + Twitter Cards |
| **Best SEO** | JSON-LD + Standard Meta |
| **E-commerce** | JSON-LD (Product, Offer, Review) |
| **Blog/Content site** | JSON-LD + Open Graph + Twitter |
| **IndieWeb** | Microformats + Open Graph |
| **Local business** | JSON-LD (LocalBusiness) |
| **Events** | JSON-LD + Microformats (h-event) |
| **Recipes** | JSON-LD (Recipe) |
| **AI/LLM optimization** | JSON-LD + Microformats |

### Priority Order

1. **Standard Meta** (required)
2. **Open Graph** (social)
3. **Twitter Cards** (Twitter/X)
4. **JSON-LD** (SEO, AI)
5. **Microformats** (optional, semantic)

---

## Testing Your Structured Data

### Google

- [Rich Results Test]https://search.google.com/test/rich-results
- [Schema Markup Validator]https://validator.schema.org/

### Facebook

- [Sharing Debugger]https://developers.facebook.com/tools/debug/

### Twitter

- [Card Validator]https://cards-dev.twitter.com/validator

### Microformats

- [Microformats Parser]https://microformats.io/

---

## References

- [Microformats.org]http://microformats.org/
- [Open Graph Protocol]https://ogp.me/
- [Twitter Cards]https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards
- [Schema.org]https://schema.org/
- [Google Search Central]https://developers.google.com/search/docs/appearance/structured-data
- [W3C Microdata]https://www.w3.org/TR/microdata/
- [W3C RDFa]https://www.w3.org/TR/rdfa-primer/