This gist extends the previous and consist of an interface for searching the annotations within a text. Since the annotations are marked with Wikidata resources, an index composed by their classes is constructed in order to enable researches. Two languages are allowed: English and Italian.
xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<script src="https://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<div id="header">
<input type="text">
<button id="search_button" title="Find"><i class="fa fa-search"></i></button>
</div>
<div id="core">
<div id="search_results"></div>
<div id="text">
<span class="annotation highlighted" data-wd-id="Q13375">Pisa</span> (/ˈpiːzə/; Italian pronunciation: [ˈpiːsa][2]) is a city in <span class="annotation highlighted" data-wd-id="Q1273">Tuscany</span>, Central <span class="annotation highlighted" data-wd-id="Q38">Italy</span>, straddling the River <span class="annotation highlighted" data-wd-id="Q115457">Arno</span> just before it empties into the <span class="annotation highlighted" data-wd-id="Q38882">Tyrrhenian Sea</span>. It is the <span class="annotation highlighted" data-wd-id="Q5119">capital city</span> of the <span class="annotation highlighted" data-wd-id="Q16244">Province of Pisa</span>. Although <span class="annotation highlighted" data-wd-id="Q13375">Pisa</span> is known worldwide for its <span class="annotation highlighted" data-wd-id="Q39054">leaning tower</span> (the <span class="annotation highlighted" data-wd-id="Q200334">bell tower</span> of the city's cathedral), the city of over 89,940 residents (around 200,000 with the metropolitan area) contains more than <span class="annotation highlighted" data-wd-id="Q40292">20</span> other historic <span class="annotation highlighted" data-wd-id="Q16970">churches</span>, several medieval palaces and various <span class="annotation highlighted" data-wd-id="Q12280">bridges</span> across the River <span class="annotation highlighted" data-wd-id="Q115457">Arno</span>. Much of the city's architecture was financed from its history as one of the <span class="annotation highlighted" data-wd-id="Q62825">Italian maritime republics</span>.
The city is also home of the <span class="annotation highlighted" data-wd-id="Q645663">University of Pisa</span>, which has a history going back to the <span class="annotation highlighted" data-wd-id="Q7061">12th century</span> and also has the mythic Napoleonic <span class="annotation highlighted" data-wd-id="Q672416">Scuola Normale Superiore</span> and <span class="annotation highlighted" data-wd-id="Q774609">Sant'Anna School of Advanced Studies</span> as the best sanctioned Superior Graduate Schools in <span class="annotation highlighted" data-wd-id="Q38">Italy</span>.
</div>
</div>
<script src="index.js"></script>
</body>
</html>
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js