Advanced Image SEO Using Computer Vision APIs
Ever wonder why your perfectly curated product images get less traffic than that blurry photo your competitor took with a potato? Welcome to the wild...
Let's talk about knowledge graphs – you know, that thing Google uses to answer questions before you finish typing them, like some kind of digital mind reader with a superiority complex. (Looking at you, featured snippets that make my website's CTR cry.)
Remember when SEO was just about having more backlinks than your competitors? Those were simpler times. Like when we thought Y2K would end civilization, or when we believed MySpace would be forever. Now we're out here building semantic relationships between entities like we're running some kind of digital matchmaking service.
Your current SEO probably looks something like this:
<meta name="description" content="Award-winning NY style pizza since 1987" />
That's adorable. It's also about as sophisticated as using "password123" for your banking login.
Think of a knowledge graph like a really intense game of Six Degrees of Kevin Bacon, except instead of connecting everything to Kevin Bacon, you're connecting everything to everything else. Fun, right?
Here's what it actually looks like:
"@context": "https://schema.org/",
"@type": "Restaurant",
"name": "Joe's Pizza",
"servesCuisine": "Pizza",
"priceRange": "$$",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Pizza Street",
"addressLocality": "New York"
},
"hasMenu": {
"@type": "Menu",
"hasMenuSection": [{
"@type": "MenuSection",
"hasMenuItem": [{
"@type": "MenuItem",
"name": "Margherita Pizza",
"description": "Fresh basil, mozzarella, tomato sauce"
}]
}]
}
}
Here you go:
First, identify your entities. These are the nouns in your business universe:
relationships = {
'primary': get_direct_relationships(entity),
'secondary': get_indirect_relationships(entity),
'tertiary': get_you_are_probably_overthinking_this(entity)
}
return relationships
Time to make Google understand your content better than your significant other understands your Netflix preferences:
schema = {
"@context": "https://schema.org/",
"@type": entity_data['type'],
"@id": f"https://example.com/entity/{entity_data['id']}",
"name": entity_data['name'],
"sameAs": entity_data['external_urls'],
"relatedTo": build_relationships(entity_data)
}
return json.dumps(schema, indent=2)
def collect_entities(self):
entities = {
'products': self.get_products(),
'categories': self.get_categories(),
'locations': self.get_locations(),
'reviews': self.get_reviews_that_arent_obviously_fake()
}
return entities
graph = nx.DiGraph()
for entity in entities:
graph.add_node(entity['id'], **entity['properties'])
for relation in entity['relations']:
graph.add_edge(
entity['id'],
relation['target'],
type=relation['type']
)
return graph
schemas = []
for node in graph.nodes():
schema = {
"@context": "https://schema.org",
"@type": graph.nodes[node]['type'],
"@id": f"#{node}",
"name": graph.nodes[node]['name']
}
# Add relationships
related = []
for edge in graph.edges(node, data=True):
related.append({
"@type": edge[2]['type'],
"target": f"#{edge[1]}"
})
if related:
schema['relatedTo'] = related
schemas.append(schema)
return schemas
// Don't do this
{
"@type": ["Restaurant", "Store", "Place", "Thing", "Business", "Organization", "LocalBusiness", "FoodEstablishment", "ISwearThisWillHelpMySEO"]
}
# This is not a dating app
def connect_all_the_things(entity_a, entity_b):
return "Just because you can doesn't mean you should"
def audit_entities(graph):
issues = []
for node in graph.nodes():
if not has_required_properties(node):
issues.append(f"Node {node} missing required properties")
if has_orphan_connections(node):
issues.append(f"Node {node} has orphan connections")
return issues
Track these metrics:
Coming soon:
Building a knowledge graph is like trying to explain your family tree at Thanksgiving – it's complex, somewhat confusing, and there's always that one connection nobody wants to talk about.
Remember:
Now go forth and connect your entities like they're characters in a conspiracy theory diagram.
(P.S. If anyone asks why their competitor is showing up in the knowledge panel instead of them, just mutter something about "entity authority" and change the subject.)
Ever wonder why your perfectly curated product images get less traffic than that blurry photo your competitor took with a potato? Welcome to the wild...
As search engines evolve to understand and interpret content more like humans do, traditional keyword-centric SEO strategies are no longer sufficient...
Google's search engine has come a long way since its early days of simple keyword matching. With Knowledge Graph, Google now possesses a much deeper...