view: add openkg pages;

by lijing
This commit is contained in:
root 2017-07-26 12:48:20 +08:00
parent 2d1d1abc42
commit db7f24414f
5 changed files with 541 additions and 37 deletions

View File

@ -14,13 +14,34 @@ function query(dp) {
format = "json";
var argu = "?operation=query&format=" + format + "&sparql=" + dp;
var encodeArgu = escape(argu);
$.get(encodeArgu, function(data, status){
if(format != "html")
{
var element = document.getElementById("hideLink");
element.setAttribute("href", encodeArgu);
if(format == "txt")
element.setAttribute("download", "sparql.txt");
else if(format == "csv")
element.setAttribute("download", "sparql.csv");
else if(format == "json")
element.setAttribute("download", "sparql.json");
if(/msie/i.test(navigator.userAgent))
{
element.fireEvent("onclick");
}
else
{
var e = document.createEvent("MouseEvents");
e.initEvent("click", true, true);
element.dispatchEvent(e);
}
}
else
{
$.get(encodeArgu, function(data, status){
if(status=="success"){
//toTxt();
//alert(data);
if(format == "html")
{
if(status=="success"){
//toTxt();
//alert(data);
var parts = data.split("+");
var fileName = parts[2];
var lines = Number(parts[1]);
@ -89,32 +110,7 @@ function query(dp) {
$.get(request2, function(data, status){});
}
}
}
else
{
var parts = data.split("+");
var fileName = parts[2];
var tmp = "?operation=delete&download=true&filepath=" + fileName;
var request = escape(tmp);
var element = document.getElementById("hideLink");
element.setAttribute("href", request);
if(format == "txt")
element.setAttribute("download", "sparql.txt");
else if(format == "csv")
element.setAttribute("download", "sparql.csv");
else if(format == "json")
element.setAttribute("download", "sparql.json");
if(/msie/i.test(navigator.userAgent))
{
element.fireEvent("onclick");
}
else
{
var e = document.createEvent("MouseEvents");
e.initEvent("click", true, true);
element.dispatchEvent(e);
}
}
}
/*
alert(data);
@ -126,9 +122,8 @@ function query(dp) {
alert(vl);
document.getElementById("myForm").submit();
*/
}
});
});
}
}
function handleQueryExample()

60
Server/web/openkg.html Normal file
View File

@ -0,0 +1,60 @@
/*=============================================================================
# Filename: openkg.html
# Author: lijing
# Mail: li_jing@pku.edu.cn
# Last Modified: 2017-07-26 11:09
# Description: written by lijing
=============================================================================*/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>OpenKG datasets</title>
<link rel="alternate" type="application/rss+xml" title="" href="feed/index.html">
<link href="http://fonts.googleapis.com/css?family=Raleway:700,300" rel="stylesheet"
type="text/css">
<link rel="stylesheet" href="style.css">
<!--<link rel="stylesheet" href="css/prettify.css">-->
</head>
<body>
<div class="wrapper">
<header>
<div class="container">
<h2 class="lone-header">OpenKG datasets</h2>
</div>
</header>
<section>
<div class="container">
<ul class="docs-nav">
<li><strong>Tourist</strong></li>
<li><a href="tourist.gstore-pku.com" class="cc-active">tourist.gstore-pku.com</a></li>
<li><strong>Music</strong></li>
<li><a href="music.gstore-pku.com" class="cc-active">music.gstore-pku.com</a></li>
<li><strong>Emergency</strong></li>
<li><a href="emergency.gstore-pku.com" class="cc-active">emergency.gstore-pku.com</a></li>
<li><strong>Breast Cancer</strong></li>
<li><a href="breastcancer-femalpatient-2016A.gstore-pku.com<" class="cc-active">breastcancer-femalpatient-2016A.gstore-pku.com</a></li>
<li><a href="breastcancer-medline09n3.gstore-pku.com" class="cc-active">breastcancer-medline09n3.gstore-pku.com</a></li>
<li><a href="breastcancer-eligibilitycriteria-2015.gstore-pku.com" class="cc-active">breastcancer-eligibilitycriteria-2015.gstore-pku.com</a></li>
<li><a href="breastcancer-trials-2012.gstore-pku.com" class="cc-active">breastcancer-trials-2012.gstore-pku.com</a></li>
<li><a href="breastcancer-DutchGuildeline-2012.gstore-pku.com" class="cc-active">breastcancer-DutchGuildeline-2012.gstore-pku.com</a></li>
<li><strong>Clinga</strong></li>
<li><a href="clinga.gstore-pku.com" class="cc-active">clinga.gstore-pku.com</a></li>
<li><strong>Person</strong></li>
<li><a href="person-zhishime.gstore-pku.com" class="cc-active">person-zhishime.gstore-pku.com</a></li>
<li><a href="person-multype.gstore-pku.com" class="cc-active">person-multype.gstore-pku.com</a></li>
<li><a href="person-taxonomy.gstore-pku.com" class="cc-active">person-taxonomy.gstore-pku.com</a></li>
</ul>
</div>
</section>
</div>
<!--
<script src="https://cdn.bootcss.com/prettify/r298/run_prettify.js"></script>
<script src="js/layout.js"></script>-->
</body>
</html>

449
Server/web/style.css Normal file
View File

@ -0,0 +1,449 @@
body, html {
margin: 0;
padding: 0;
}
body,
input,
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "Raleway", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
font-size: 18px;
}
body {
line-height: 2;
color: #444;
background: #ededed;
}
img, iframe {
max-width: 100%;
}
iframe {
max-height: 100%;
}
img {
height:auto;
}
.btn {background:#135571;color:#fff;
-webkit-transition: all 250ms;
-moz-transition: all 250ms;
-o-transition: all 250ms;
transition: all 250ms;
}
.btn:hover {background:#333; }
.btn-download { border-radius:0 4px 0 0; font-weight:bold; width: 25px; overflow: hidden;}
.btn-download img { width: 25px;
float: left;
margin-top: 18px;
margin-right: 15px
}
.btn-download:hover { width:165px;}
iframe {
border: 0 !important;
}
.wrapper { margin:10px auto; border-radius:4px; box-shadow:0 0 2px 2px rgba(155,155,155,0.1); border:1px solid #d3d3d3; }
header {
width: 100%;
overflow: hidden;
}
.container {
max-width: 650px;
position: relative;
}
strong, dt, h3, h4 {
font-weight: 700;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 10px 0;
line-height: 20px;
color: inherit;
text-rendering: optimizelegibility;
}
h1,
h2,
h3 {
line-height: 40px;
}
h2 {
font-size: 22px;
line-height: 1.2;
}
h3 {
font-size: 24.5px;
}
h4 {
font-size: 17.5px;
}
h5 {
font-size: 14px;
}
h6 {
font-size: 11.9px;
}
hr {
background: #EEE;
border: 0;
height: 1px;
margin: 40px 0 40px;
}
blockquote {
margin: 1em 0;
border-left: 3px solid #ccc;
padding-left: 20px;
text-align: left;
}
.copyrights{
text-indent:-9999px;
height:0;
line-height:0;
font-size:0;
overflow:hidden;
}
dt {
}
dd {
padding: 0;
margin: 0 0 25px 0;
}
a {
-webkit-transition: all ease 150ms;
-moz-transition: all ease 150ms;
-o-transition: all ease 150ms;
transition: all ease 150ms;
text-decoration: none;
color: #26abe2;
}
a:hover {
text-decoration: underline;
}
a:active {
color: #47b5e2;
}
/* Header Styles */
header {
padding: 2em 0 2em 0;
background: #26abe2;
color: #fff;
}
h1 {
margin: 0;
padding: 0;
float: left;
}
header h2 {
margin: 0 0 1em 0;
}
header h2.lone-header {
margin: 0;
}
footer {
text-align: center;
padding: 1.5em 0;
background:#fff;
border-radius:0 0 4px 4px;
}
footer p {
margin: 0;
color: #999;
}
.pull-right{ float:right;}
.pull-left { float:left; }
/* Navigation Styles */
nav {
background: #fff;
padding: 0;
min-height: 60px;
border-radius: 5px 5px 0 0;
}
nav ul, nav li {
margin: 0;
padding: 0;
list-style: none;
}
nav a {
padding: 0 1em;
text-decoration:none !important;
font-size: .9em;
height: 60px;
line-height: 60px;
display: block;
}
nav h1 a {
padding: 7px 1em;
height: 46px;
line-height: 0;
height: 45px;
line-height: 60px;
color: #000;
}
nav h1 a img { margin-right: 10px;
float: left;
margin-top: 9px;
}
nav h1 a span { float: left;
margin-top: -5px;}
nav a:active {
color: #fff;
cursor: default;
}
nav ul.site {
padding: 20px 0 0 0;
}
nav #menu {
overflow: hidden;
max-height: 0;
clear: left;
}
nav #menu-toggle {
position: absolute;
right: 0;
top: 0;
font-size: 1.5em;
padding: 0 16px;
}
@media only screen and (min-width: 680px) {
nav, nav #menu {
height: 60px !important;
}
nav li, nav a {
float: left;
}
nav ul.site {
float: left;
padding: 0;
clear: none;
}
nav ul.site li {
margin: 0 0 0 10px;
}
nav #menu-toggle {
display: none !important;
}
nav #menu {
max-height: 9999px;
clear: none;
}
}
/* Content Styles */
section { padding: 20px 20px; text-align: center; }
section.vibrant { background: #222; color: #fff; }
section.vibrant h4{
line-height: 2;
font-weight: normal;
width: 90%;
margin: 0 auto;
}
nav:before,
nav:after,
header:before,
header:after,
section:before,
section:after {
content: " ";
display: table;
}
nav:after, header:after, section:after { clear: both; }
nav, header, section { *zoom: 1; }
/* Form Styles */
input {
display: block;
vertical-align: middle;
line-height: 30px;
margin: 0 auto;
width: 100%;
max-width: 400px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: all linear 0.2s;
-moz-transition: all linear 0.2s;
-o-transition: all linear 0.2s;
transition: all linear 0.2s;
}
input:focus {
border-color: #007eb2;
outline: 0;
}
.docs-nav {
background-color: #f5f5f5;
list-style: none;
padding: 15px 20px;
font-size: 0.97em;
}
.docs-nav a {
display: block;
margin: 0 -20px;
padding: 0 20px;
text-decoration: none;
border-right: 2px solid transparent;
}
@media only screen and (min-width: 400px) {
}
@media only screen and (min-width: 600px) {
}
@media only screen and (min-width: 960px) {
.docs-nav {
position: relative;
top: 0;
-webkit-transition: top linear 50ms;
-moz-transition: top linear 50ms;
-o-transition: top linear 50ms;
transition: top linear 50ms;
}
.docs-nav.fixed {
position: fixed;
top: 49px;
width: 220px;
}
.docs-nav a:hover {
background: #26ABE2;
color:#fff;
}
.docs-nav a:active,
.docs-nav .active {
background: #26ABE2;
color:#fff;
border-right: 2px solid #ccc;
}
.docs-nav .separator {
height: 20px;
}
.docs-content {
padding-left: 310px;
}
header {
padding: 1em 0 1em 0;
}
.container {
max-width: 1000px;
padding: 0 20px;
}
section { padding: 1em 0; text-align: left; background: #fff;}
section.centered {
text-align: center;
}
input {
display: inline-block;
}
}

View File

@ -1,5 +1,5 @@
#CC=g++
CC=ccache g++ -std=c++11
CC= g++ -std=c++11
lib_dir=../lib/
socket_obj_dir=../../../../.objs/

View File

@ -35,7 +35,7 @@
#compile parameters
CC = ccache g++
CC = g++
#CC = g++
#the optimazition level of gcc/g++