Dan Scott,
Laurentian University
coffeecode.net
/ +Dan Scott
/ @denials
The virtue is about the avoidance of future work.
Virtues of the Perl Programmer, Larry Wall
Freebase: Open graph database launched in 2007
<head>
<link type="text/css" rel="stylesheet"
href="https://www.gstatic.com/knowledge/kgsearch/widget/1.0/widget.min.css">
<style>.kge-search-picker { width: 25em; }</style>
<script type="text/javascript"
src="https://www.gstatic.com/knowledge/kgsearch/widget/1.0/widget.min.js"></script>
</head>
<body>
<form id='myform'>
<label>Search: <input type="text" id="myinput"></label>
</form>
<script>
KGSearchWidget(API_KEY, document.getElementById('myinput'), {});
</script>
</body>
{ "@context": {
"@vocab": "http://schema.org/",
"goog": "http://schema.googleapis.com/",
"EntitySearchResult": "goog:EntitySearchResult",
"detailedDescription": "goog:detailedDescription",
"resultScore": "goog:resultScore",
"kg": "http://g.co/kg"
},
"@type": "ItemList", "itemListElement": [
{
"@type": "EntitySearchResult",
"result": {
"@id": "kg:/m/02zzm_",
"name": "John Kasich",
"@type": [ "Person", "Thing" ],
"description": "Governor of Ohio",
"image": {
"contentUrl": "http://t1.gstatic.com/images?q=tbn:ANd9GcRoou4pZKD6FoNaE71ngNlv4RGgUS46mgtin5YJtyEoh42CIs4x",
"url": "https://en.wikipedia.org/wiki/John_Kasich"
},
"detailedDescription": {
"articleBody": "John Richard Kasich is an American politician, the 69th and current Governor of Ohio. First elected in 2010 and re-elected in 2014, Kasich is a member of the Republican Party. His term is set to end by January 2019.\n",
"url": "https://en.wikipedia.org/wiki/John_Kasich",
"license": "https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License"
},
"url": "https://johnkasich.com"
},
"resultScore": 22.28808
}
]
}
"kg": "http://g.co/kg"
...
"@id": "kg:/m/02zzm_"
URIs don't have to resolve, but it's nice when they do!
Note: The Knowledge Graph Search API returns only individual matching entities, rather than graphs of interconnected entities. If you need the latter, we recommend using data dumps from Wikidata instead.https://developers.google.com/knowledge-graph/
REST-based MediaWiki API wbsearchentities
module:
https://www.wikidata.org/w/api.php?action=wbsearchentities&search=john+kasich&language=en
Restrictions: Serial requests, or risk the ban hammer!
{
"searchinfo": { "search": "john kasich" },
"search": [
{
"id": "Q69319",
"concepturi": "http://www.wikidata.org/entity/Q69319",
"url": "//www.wikidata.org/wiki/Q69319",
"title": "Q69319",
"pageid": 72036,
"label": "John Kasich",
"description": "American politician",
"match": {
"type": "label",
"language": "en",
"text": "John Kasich"
}
}
]
}
With https://www.wikidata.org/entity/
as prefix wde:
, the entity wde:Q69319 ("John Kasich"):
"+1952-05-13T00:00:00Z";
datavalue/value/time
value of +1983-01-03T00:00:00Z
.More simply...
Subject | Predicate | Object |
---|---|---|
wde:Q69319 | wde:P569 | "+1952-05-13T00:00:00Z" |
wde:Q69319 | wde:P39 | wde:Q13218630 |
wde:Q13218630 | wde:P580 | "+1983-01-03T00:00:00Z" |
SELECT / WHERE / GROUP BY / ORDER
... just like SQL right?We can pull some awesome results from Wikidata:
Format | HTTP Header | GET param |
---|---|---|
XML | Accept: application/sparql-results+xml | format=xml |
JSON | Accept: application/sparql-results+json | format=json |
TSV | Accept: text/tab-separated-values | |
CSV | Accept: text/csv |
Notability requirements still apply
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# medium-com: http://ogp.me/ns/fb/medium-com#">
<title>LIVE REVIEW: Midpoint Music Festival — Cincinnati, OH – The Owl Mag – Medium</title>
<meta name="title" content="LIVE REVIEW: Midpoint Music Festival — Cincinnati, OH">
<meta property="og:title" content="LIVE REVIEW: Midpoint Music Festival — Cincinnati, OH">
<meta property="og:url" content="https://medium.com/the-owl-mag/live-review-midpoint-music-festival-cincinnati-oh-a922af156600">
<meta property="og:image" content="https://cdn-images-1.medium.com/proxy/1*MXL-j6S8fTEd8UFP_foEEw.png">
<meta name="description" content="Cincinnati is not a music city by any means. Numerous bands skip the city in lieu of Columbus, OH on national tours and the city’s hottest music venues reside over the river in Kentucky. Midpoint…">
<meta property="og:description" content="Cincinnati is not a music city by any means. Numerous bands skip the city in lieu of Columbus, OH on national tours and the city’s hottest music venues reside over the river in Kentucky. Midpoint…">
<meta property="og:site_name" content="Medium">
<meta property="og:type" content="article">
</head>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# medium-com: http://ogp.me/ns/fb/medium-com#">
<title>LIVE REVIEW: Midpoint Music Festival — Cincinnati, OH – The Owl Mag – Medium</title>
<meta name="title" content="LIVE REVIEW: Midpoint Music Festival — Cincinnati, OH">
<meta name="description" content="Cincinnati is not a music city by any means. Numerous bands skip the city in lieu of Columbus, OH on national tours and the city’s hottest music venues reside over the river in Kentucky. Midpoint…">
<meta name="twitter:description" content="Cincinnati is not a music city by any means. Numerous bands skip the city in lieu of Columbus, OH on national tours and the city’s hottest music venues reside over the river in Kentucky. Midpoint…">
<meta name="twitter:image:src" content="https://cdn-images-1.medium.com/proxy/1*MXL-j6S8fTEd8UFP_foEEw.png">
<meta name="twitter:site" content="@Medium">
</head>
<head>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "NewsArticle",
"image": {
"@type": "ImageObject",
"width": 1920,
"height": 534,
"url": "https://cdn-images-1.medium.com/max/1920/1*5ztbgEt4NqpVaxTc64C-XA.png"
},
"datePublished": "2011-09-27T16:45:34.000Z",
"dateModified": "2016-04-19T20:30:07.176Z",
"headline": "LIVE REVIEW: Midpoint Music Festival — Cincinnati, OH",
"name": "LIVE REVIEW: Midpoint Music Festival — Cincinnati, OH",
"keywords": [
"Review"
],
"author": {
"@type": "Person",
"name": "The Owl Mag",
"url": "https://medium.com/@theowlmag"
},
"creator": [
"The Owl Mag"
],
"publisher": {
"@type": "Organization",
"name": "The Owl Mag",
"url": "https://medium.com/the-owl-mag",
"logo": {
"@type": "ImageObject",
"width": 215,
"height": 60,
"url": "https://cdn-images-1.medium.com/max/215/1*5ztbgEt4NqpVaxTc64C-XA.png"
}
},
"mainEntityOfPage": "http://www.theowlmag.com/live-reviews/midpoint-music-festival-cincinnati-oh/"
}
</script>
</head>
<body vocab="http://schema.org/" typeof="NewsArticle">
<h1 property="name headline">LIVE REVIEW: Midpoint Music Festival — Cincinnati, OH</h1>
<div>
<b>Published by</b>
<em property="publisher" typeof="Organization">
<a href="https://medium.com/the-owl-mag" property="url">
<span property="name">The Owl Mag</span>
</a>
</em>
<span property="datePublished" content="2011-09-27T16:45:34.000Z">2011-09-27</span>
<div>
<p property="description">
Cincinnati is not a music city by any means. Numerous bands skip the city in lieu of Columbus, OH on national tours and the city’s hottest music venues reside over the river in Kentucky. Midpoint...
</p>
<div property="image" typeof="ImageObject">
<img src="https://cdn-images-1.medium.com/max/1920/1*5ztbgEt4NqpVaxTc64C-XA.png" />
<meta property="width" content="1920" />
<meta property="height" content="534" />
</div>
</body>
Big data makes common schemas even more necessary.
[...]
In this sample 31.3 percent of pages have Schema.org markup, up from 22 percent one year ago.
Guha, R. V., Brickley, D., & Macbeth, S. (2016). Schema.org: Evolution of structured data on the web. Communications of the ACM, 59(2), 44-51. (http://cacm.acm.org/magazines/2016/2/197422-schema-org/fulltext)
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License