Shawn Simister

Developer Relations, Knowledge (Search)



  • Freebase
  • Google Refine
  • Schema.org
  • Knowledge Graph

Knowledge-based Applications

The Freebase Knowledge Graph

www.freebase.com


  • Open, crowd-sourced, knowledge graph.
  • 23M+ topics, 2k+ commons types.
  • RESTful APIs.
  • Creative Commons Attribution License.
  • Data dumps.
  • A source for Google’s Knowledge Graph.

Discovery Patterns

Turning strings into things

Reconciliation Pattern

Problem

The user wants to specify an exact entity rather than just keywords.

Keywords can be ambiguous so we need to be able to present them with options.

Not just limited to keywords. Images, articles, geo-coordinates, etc. can all be reconciled to entities.

Reconciliation Pattern

Solution

Present the user with a list of disambiguated entities.

Use reconciliation algorithms to automatically match entities.

Combine both techniques to get the best results.

Freebase Suggest

Reconciliation Pattern

When to use it?

When we need entity IDs for known entity names.

When we need disambiguated topics.

When tags won’t suffice.

Detection Pattern

Problem

User wants to learn more about the subject matter of an article, video, image or other piece of content.

Detection Pattern

Solution

Use Named Entity Recognition.

Parse structured markup like Schema.org, RDFa and Microformats.

Extraction Pattern

When to use it?

Lots of existing content without entities identified.

Need to identify relevant entities.

Too much content to manually mark it up with entities.

Interaction Patterns

Traversing a web of entities

Faceting Pattern

Problem

User wants to find and filter interesting data.

Knowledge Graph is large and not all the data is going to interesting to the user.

No single way to organize data in order to surface interesting results.

Faceting Pattern

Solution

Count up how frequently each facet (property or value) occurs and allow the user to filter the data.

Show different types of facets depending on what data is being shown.

Find a Collection of Entities

Freebase API

[{
  "id": null,
  "name": null,
  "profession": "software developer",
  "type": "/people/person",
}]
[{
  "id":         "/en/eric_s_raymond",
  "name":       "Eric S. Raymond",
  "profession": "Software Developer",
  "type":       "/people/person"
},{
  "id":         "/en/sergey_brin",
  "name":       "Sergey Brin",
  "profession": "Software Developer",
  "type":       "/people/person"
…
}]

Find a Collection of Entities

Freebase API

Simple REST API call using standard Google API Client Library.

from apiclient import discovery
from apiclient import model

API_KEY = 'YOUR-API-KEY-GOES-HERE'
model.JsonModel.alt_param = ""
freebase = discovery.build('freebase', 'v1', developerKey=API_KEY)
query = [{'id':None,'name':None,'type':'/people/person','profession':'software developer'}]
results = freebase.mqlread(query=query)
for topic in results:
  print topic['name']

Faceting Pattern

When to use it?

Too many different facts about entities.

Sparse or undifferentiated data.

Can’t simply provide a list of results.

Recommendation Pattern

Problem

We want to encourage deeper exploration of our content.

Recommendation Pattern

Solution

Use semantic relationships between entities to make meaningful recommendations for related entities.

Not only can we say that they're related by we can also say why.

Recommendation Pattern

When to use it?

When there are too many possible ways to organize the content and each different users will have varied tastes.

Presentation Patterns

Mashing up entities on the web

Summarization Pattern

Problem

We want to describe an entity.

User needs clues to know which entity we're talking about.

Summarization Pattern

Solution

Display a short summary including name, image, description and relevant property values.

Freebase Topic API

Summarization Pattern

When to use it?

When we have content that needs to be put in the context of one or more entities.

When we want to encourage people to navigate content by entities, we can reinforce that by showing which entities are relevant to each piece of content.

Mashup Pattern

Problem

User wants to see different types of information about the same entity.

  • Different sites or data sources.
  • Different types of data about the same entity.

Hard to combine data from different sources.

Mashup Pattern

Solution

Create links between the same entity in different datasets/contexts.

Encourage users to jump between different contexts for the same entity.

Get all the foreign keys

Freebase API

		import json
		import urllib

		API_KEY = 'YOUR-API-KEY-GOES-HERE'
		service_url = 'https://www.googleapis.com/freebase/v1/topic'
		params = {
		  'filter': ['/type/object/key','/common/topic/topic_equivalent_webpage'],
		  'alldata': true,
		  'key': API_KEY
		}
		topic_id = '/en/san_francisco'
		url = service_url + topic_id + '?' + urllib.urlencode(params)
		response = json.loads(urllib.urlopen(url).read())
		for result in response['result']['property']['/common/topic/topic_equivalent_webpage']['values']
		  print result['uri']

Mashup Pattern

When to use it?

Need to see information from different perspectives.

Different information about different entities is not available from the same source or website.

Visualization Pattern

Problem

We want to display many different entities.

Showing summaries for each entity is repetitive and doesn't fully show the relationships between the entities.

Visualization Pattern

Solution

Use data visualization techniques to display many different entities at once in a semantically meaningful way.

  • Trees
  • Maps
  • Timelines
  • Graphs
  • Bubble Charts

Visualization Pattern

When to use it?

When its important to be able to see the relationships between multiple entities at the same time.

Getting Started