Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
108 lines (95 sloc) 4.86 KB
<!doctype html>
<html lang="fr">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous" />
<link rel="stylesheet" href="assets/css/simsemsearch-min.css" />
<!-- Font Awesome -->
<link rel="stylesheet" href="assets/fa/css/all.min.css" />
<title>SimSemSearch</title>
</head>
<body class="bg-light">
<header>
<nav class="navbar navbar-expand navbar-dark bg-dark">
<a class="navbar-brand display-1 mr-auto" href="#"><span class="h1">S<sup><small class="text-muted">3</small></sup></span></a>
<ul class="navbar-nav">
<li class="nav-item"><a class="nav-link" href="en">EN</a></li>
<li class="nav-item active"><a class="nav-link" href="fr">FR</a></li>
</ul>
</nav>
</header>
<div class="container-fluid">
<section>
<h2>Formulaire de recherche</h2>
<div id="ui-search" class="clearfix"></div>
</section>
<section>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#sparql" role="tab" aria-controls="sparql" aria-selected="true">SparQL</a>
</li>
<li class="nav-item">
<a class="nav-link" id="profile-tab" data-toggle="tab" href="#json" role="tab" aria-controls="json" aria-selected="false">Json</a>
</li>
<li class="nav-item">
<a class="nav-link" id="profile-tab" data-toggle="tab" href="#json2" role="tab" aria-controls="json" aria-selected="false">Exemple Json</a>
</li>
</ul>
<div class="jumbotronn">
<div class="tab-content">
<div class="tab-pane active" id="sparql" role="tabpanel" aria-labelledby="sparql-tab">
<div class=" border border-info m-3"><pre class="pre-scrollable m-3"><code>...</code></pre></div>
</div>
<div class="tab-pane" id="json" role="tabpanel" aria-labelledby="json-tab">
<div class=" border border-info m-3"><pre class="pre-scrollable m-3"><code>...</code></pre></div>
</div>
<div class="tab-pane" id="json2" role="tabpanel" aria-labelledby="json-tab">
<div class=" border border-info m-3"><pre class="pre-scrollable m-3"><code>...</code></pre></div>
</div>
</div>
</div>
</section>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src="assets/js/sparql-js/sparqljs-browser.js" ></script>
<script src="assets/js/simsemsearch-min.js" ></script>
<script src="assets/js/main.js" ></script>
<script>
$( document ).ready(function($) {
//Appel du composant pour la recherche
$('#ui-search').SimSemSearchForm({
pathSpecSearch: 'config/spec-search-wikidata.json',
language: "en",
addDistinct: true,
autocompleteUrl: function(domain, property, range, key) {
// ici le code qui se charge de retourner les résultats de la recherche
return 'http://openarchaeo.huma-num.fr/federation/api/autocomplete?key='+key+'&domain='+encodeURIComponent(domain)+'&property='+encodeURIComponent(property)+'&range='+encodeURIComponent(range) ;
},
listUrl: function(domain, property, range) {
// ici le code qui se charge de retourner les résultats de la recherche
return 'http://openarchaeo.huma-num.fr/federation/api/list?domain='+encodeURIComponent(domain)+'&property='+encodeURIComponent(property)+'&range='+encodeURIComponent(range) ;
},
datesUrl: function(domain, property, range, key) {
// ici le code qui se charge de retourner les résultats de la recherche
return 'data/periods-periodo.json' ;
},
onQueryUpdated: function(queryString, queryJson) {
// ici on récupère la requete Sparql grace au premier parametre de la fonction
queryString = wdtP31PostProcess(queryString);
$('#sparql code').html(queryString.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
}
}) ;
}) ;
wdtP31PostProcess = function(queryString) {
return queryString.replace(/<http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type>/g, "<http://www.wikidata.org/prop/direct/P31>/<http://www.wikidata.org/prop/direct/P279>*");
}
</script>
</body>
</html>
You can’t perform that action at this time.