Skip to content

Commit 0b15245

Browse files
committed
Add sparql-query conversion to reSpec
1 parent 48b323c commit 0b15245

12 files changed

+44083
-25
lines changed

input/.tidy.html

+462
Large diffs are not rendered by default.

input/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Repository: sparql-query
2+
Title: "SPARQL 1.2 Query Language"
3+
4+
Downloaded as complete page from: <http://www.w3.org/TR/2013/REC-sparql11-query-20130321>
5+
6+
.tidy.html generated with "tidy -i -q -utf8 -ashtml -w 200 < URL-contents > tidy.html
7+
8+
.input.html:
9+
Copied from .tidy.html
10+
correct HTML
11+
insert expected <div> for sections
12+
fix HTML that causes errors in reSpec after conversion

input/SPARQL 1.1 Query Language.html

+4,163
Large diffs are not rendered by default.

input/SPARQL 1.1 Query Language.input.html

+9,851
Large diffs are not rendered by default.

input/SPARQL 1.1 Query Language.tidy.html

+9,851
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
/******************************************************************************
2+
* This code handles: *
3+
* - the obsolete warning on outdated specs *
4+
******************************************************************************/
5+
(function() {
6+
"use strict";
7+
8+
var ESCAPEKEY = 27;
9+
/* Deprecation warning */
10+
if (document.location.hostname === "www.w3.org" && (/^\/TR\/(\d{4}\/|(NOTE|WD|PR|REC)\-)/.test(document.location.pathname) || !/^\/TR\//.test(document.location.pathname))) {
11+
var request = new XMLHttpRequest();
12+
13+
request.open('GET', 'https://www.w3.org/TR/tr-outdated-spec');
14+
request.onload = function() {
15+
if (request.status < 200 || request.status >= 400) {
16+
return;
17+
}
18+
try {
19+
var currentSpec = JSON.parse(request.responseText);
20+
} catch (err) {
21+
console.error(err);
22+
return;
23+
}
24+
document.body.classList.add("outdated-spec");
25+
var w3cCSS = document.querySelector('link[href*="www.w3.org/StyleSheets/TR/W3C-"]'); //old specs don't have the TR stylesheets
26+
var node = document.createElement("p");
27+
node.classList.add("outdated-warning");
28+
node.tabIndex = -1;
29+
node.setAttribute("role", "dialog");
30+
node.setAttribute("aria-modal", "true");
31+
node.setAttribute("aria-labelledby", "outdatedWarning");
32+
if (currentSpec.style) {
33+
node.classList.add(currentSpec.style);
34+
}
35+
36+
var frag = document.createDocumentFragment();
37+
var heading = document.createElement("strong");
38+
heading.id = "outdatedWarning";
39+
heading.innerHTML = currentSpec.header;
40+
frag.appendChild(heading);
41+
42+
var anchor = document.createElement("a");
43+
anchor.href = currentSpec.latestUrl;
44+
anchor.innerText = currentSpec.latestUrl + ".";
45+
46+
var warning = document.createElement("span");
47+
warning.innerText = currentSpec.warning;
48+
warning.appendChild(anchor);
49+
frag.appendChild(warning);
50+
51+
if (w3cCSS) {
52+
var button = document.createElement("button");
53+
var handler = makeClickHandler(node);
54+
button.addEventListener("click", handler);
55+
button.innerHTML = "&#9662; collapse";
56+
frag.appendChild(button);
57+
}
58+
node.appendChild(frag);
59+
60+
function makeClickHandler(node) {
61+
var isOpen = true;
62+
return function collapseWarning(event) {
63+
var button = event.target;
64+
isOpen = !isOpen;
65+
node.classList.toggle("outdated-collapsed");
66+
document.body.classList.toggle("outdated-spec");
67+
button.innerText = (isOpen) ? '\u25BE collapse' : '\u25B4 expand';
68+
}
69+
}
70+
71+
document.body.appendChild(node);
72+
73+
if (w3cCSS) {
74+
button.focus();
75+
window.onkeydown = function (event) {
76+
var isCollapsed = node.classList.contains("outdated-collapsed");
77+
if (event.keyCode === ESCAPEKEY && !isCollapsed) {
78+
button.click();
79+
}
80+
}
81+
82+
window.addEventListener("click", function(event) {
83+
if (!node.contains(event.target) && !node.classList.contains("outdated-collapsed")) {
84+
button.click();
85+
}
86+
});
87+
88+
document.addEventListener("focus", function(event) {
89+
var isCollapsed = node.classList.contains("outdated-collapsed");
90+
var containsTarget = node.contains(event.target);
91+
if (!isCollapsed && !containsTarget) {
92+
event.stopPropagation();
93+
node.focus();
94+
}
95+
}, true); // use capture to enable event delegation as focus doesn't bubble up
96+
}
97+
};
98+
99+
request.onerror = function() {
100+
console.error("Request to https://www.w3.org/TR/tr-outdated-spec failed.");
101+
};
102+
103+
request.send();
104+
}
105+
106+
/* Matomo analytics */
107+
if (document.location.hostname === "www.w3.org" && /^\/TR\//.test(document.location.pathname)) {
108+
var _paq = window._paq = window._paq || [];
109+
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
110+
_paq.push(['trackPageView']);
111+
_paq.push(['enableLinkTracking']);
112+
(function() {
113+
var u="https://www.w3.org/analytics/piwik/";
114+
_paq.push(['setTrackerUrl', u+'matomo.php']);
115+
_paq.push(['setSiteId', '447']);
116+
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
117+
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
118+
})();
119+
}
120+
121+
})();

input/SPARQL 1.1 Query Language_files/matomo.js

+76
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading

input/local.css

+253
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
/* $Id: local.css,v 1.8 2013-03-21 11:27:54 sandro Exp $ */
2+
/* In-progress working draft artifacts - to be removed eventually */
3+
.issue { background-color: #fdd;
4+
font-size: 88% ; }
5+
.add { background-color: #7fff7f }
6+
.remove { background-color: #ff7f7f }
7+
ul.issue {}
8+
.issueBlock { margin: 1em 4em 1em 2.5em ; /* Top Right Bottom Left */
9+
padding: 1ex;
10+
/*overflow: auto;*/
11+
page-break-inside: avoid ; }
12+
.issueTopic { font-weight: bold ; }
13+
14+
.todo { font-size: 80% ; color: #444 ; }
15+
p.todo {}
16+
17+
.wgNote { border: 0.2em solid red;
18+
padding: 0.5em ;
19+
margin: 1em 4em 1em 2em ; }
20+
21+
.box { border: thin solid #888888;
22+
page-break-inside: avoid ;
23+
background-color: #F8F8F8 ; padding:1em ;
24+
margin-left:0 ; margin-right: 2ex;
25+
margin-top: 0.1ex ; margin-bottom: 0.1ex ;
26+
}
27+
28+
/* Misc WD stuff */
29+
span.cvs-id {color: gray; font-size:80%; display: block; }
30+
31+
/* == General Tag Treatment == */
32+
pre { margin: 1em 4em 1em 2.5em ; /* Top Right Bottom Left */
33+
padding: 1ex;
34+
/*overflow: auto;*/
35+
page-break-inside: avoid ; }
36+
37+
/* Tables */
38+
table, td { text-align: left; }
39+
td, th { border-style: solid;
40+
border-width: 1px;
41+
border-color: black;
42+
border-bottom-color: gray;
43+
border-right-color: gray; }
44+
td.annotation, th.annotation { border-style: none; border-bottom-style: dotted; }
45+
table.plain { border-spacing: 0px; padding: 0px ; border-collapse: collapse ; }
46+
/* cellpadding="0" cellspacing="1" style="border-collapse: collapse */
47+
48+
49+
th.major { background-color: #005a9c;
50+
color: white; }
51+
.subHeading { text-align: left;
52+
background-color: #CCCCCC; }
53+
th, td { padding: 3px; }
54+
td { font-size: 85%; }
55+
th a:link { text-decoration: none; }
56+
th a:hover { background-color:#FFFF99;
57+
text-decoration: underline; }
58+
59+
/* == Prototypes == */
60+
pre.prototype { background-color:#f7f8ff;
61+
border:thin solid #8888aa;
62+
margin: 1em 4em 1em 0em ; }
63+
.return, .type { color: #177 }
64+
65+
/* == Notes == */
66+
.note { margin-left: 2.5em; margin-right: 4ex ; font-size: 85% ; font-style: italic ; }
67+
68+
/* Definitions */
69+
.defn { margin-left:0 ; margin-right: 2ex;
70+
margin-top: 0.1ex ; margin-bottom: 0.1ex ;
71+
/*border: double 1px #888888; *//* Buggy */
72+
border: thin solid #888888;
73+
padding: 1ex 2ex 0.5ex 2ex ; /* top, right, bottom, left */
74+
page-break-inside: avoid ;
75+
background-color: #F0F8F8 ; }
76+
div.defn p { margin-top: 1ex ; margin-bottom: 1.5ex ;}
77+
div.defn ul { margin-top: 1ex ; margin-bottom: 1.5ex ; }
78+
@media print { .defn { margin: 1em 1em 1em 1em ; } }
79+
span.definedTerm {font-weight: bold;}
80+
81+
div.grammarExtract
82+
{ border: thin solid #888888;
83+
padding: 1ex 2ex 1ex 2ex ; /* top, right, bottom, left */
84+
margin: 1em 6em 1em 2em ;
85+
page-break-inside: avoid ;
86+
background-color: #F8F8F8 ; }
87+
88+
pre.codeBlock { font-family:monospace ; page-break-inside: avoid ;
89+
margin: 0 ;
90+
margin-right: 2ex ;
91+
border: thin solid #888888; }
92+
93+
94+
95+
96+
/* Examples */
97+
pre.data { border: thin solid #88AA88;
98+
background-color: #E8F0E8;
99+
margin: 1em 4em 1em 0em ; }
100+
101+
pre.dataExcerpt { border: thin solid #88AA88;
102+
background-color: #E8F0E8;
103+
margin: 1em 4em 1em 0em ; }
104+
/* Example Queries */
105+
.query { background-color:#f7f8ff; }
106+
.queryExcerpt { background-color:#f7f8ff; }
107+
pre.query { border:thin solid #8888aa;
108+
margin: 1em 4em 1em 0em ; }
109+
/* Example Results */
110+
.result { border: thin solid #888888 ;
111+
background-color: #F0F0F0 ; }
112+
pre.resultGraph { margin: 0em 0em 0em 0em ; /* Top Right Bottom Left */
113+
padding: 0ex;
114+
font-size: 100% ;
115+
page-break-inside: avoid ; }
116+
pre.resultSet { margin: 0em 0em 0em 0em ; /* Top Right Bottom Left */
117+
padding: 0ex;
118+
font-size: 100% ;
119+
page-break-inside: avoid ; }
120+
pre.resultAsk { margin: 0em 0em 0em 0em ; /* Top Right Bottom Left */
121+
padding: 0ex;
122+
font-size: 100% ;
123+
page-break-inside: avoid ; }
124+
pre.resultTurtle{ margin: 0em 0em 0em 0em ; /* Top Right Bottom Left */
125+
padding: 0ex;
126+
font-size: 100% ;
127+
page-break-inside: avoid ; }
128+
129+
pre.result { margin: 1em 4em 1em 0em ; }
130+
131+
div.result { font-family: monospace;
132+
margin: 1em 4em 1em 0em ;
133+
padding: 1ex ; }
134+
135+
.result table { border-collapse: collapse; }
136+
.result table td{ border-width: 1px ;
137+
border-color : black ;
138+
font-family: monospace ;
139+
empty-cells: show;
140+
padding-left: 1ex ; padding-right: 1ex ;
141+
vertical-align:top;
142+
text-align: left ; }
143+
/* spacing: 0 ;*/
144+
.result table th{ border-width: 1px ;
145+
font-family: monospace ;
146+
border-color: black ;
147+
empty-cells: show;
148+
padding-left: 1ex ; padding-right: 1ex ;
149+
vertical-align:top;
150+
text-align:center; }
151+
152+
/* Examples : Algebra */
153+
div.algExample { border: thin solid #888888;
154+
page-break-inside: avoid ;
155+
padding:0.5em ; margin:0.5em ;
156+
margin-left: 2em ; margin-right: 2em ;
157+
font-family:monospace ; }
158+
159+
div.algExample1 { padding:0.5em ; background-color: #F0F0FF ; }
160+
div.algExample2 { padding:0.5em ; margin-top: 0.5em ; background-color: #F0FFF0 ; }
161+
162+
/* Grammar Mark-up */
163+
.operator { color: #3f3f5f;
164+
text-transform: uppercase; }
165+
.function { color: #3f3f5f;
166+
}
167+
168+
/* Tuned to cope with different browsers behaviours */
169+
div.grammarTable table { border-style: solid ;
170+
border-width: 1px ;
171+
border-color: #AAA ;
172+
border-spacing: 0px ;
173+
border-collapse: collapse ; }
174+
175+
div.grammarTable table * { border-left-width: 0px ;
176+
border-right-width: 0px ;
177+
border-color: #AAA ; }
178+
179+
div.grammarTable table * tr { border-top-style: solid ;
180+
border-top-width: 1px ;
181+
border-top-color: #AAA ; }
182+
183+
.grammar { text-align: left ;
184+
vertical-align: top ; }
185+
.token { color: #3f3f5f; }
186+
table.FAndOTable .token { color: #00c; }
187+
table.FAndOTable .token:visited { color: #a0c; }
188+
.gRuleHead { font-style: italic ;
189+
font-family: monospace ; }
190+
.gRuleBody { font-family: monospace ; }
191+
.gRuleLabel { font-family: monospace ; }
192+
193+
.code { font-family: monospace; font-size: 100%; }
194+
pre.code { font-family: monospace; font-size: 100%; margin: 0 ; }
195+
196+
/* Table of Contents */
197+
.toc { text-indent: 0; }
198+
DIV.toc UL UL, DIV.toc OL OL {margin-left: 0}
199+
DIV.toc UL UL UL, DIV.toc OL OL OL {margin-left: 1em}
200+
DIV.toc UL UL UL UL, DIV.toc OL OL OL OL {margin-left: 0}
201+
LI.tocline1 { font-weight: bold}
202+
LI.tocline2 { font-weight: normal}
203+
LI.tocline4 { font-style: italic}
204+
/* The border in the following rule crashes NN4 on fonts.html :-(
205+
DIV.subtoc { padding: 1em; border: solid black thin; margin: 1em 0;
206+
background: #ddd} */
207+
DIV.toc, UL.index, DT { text-align: left; }
208+
209+
210+
/* References to the Rdf Data Model */
211+
span.rdfDM { color: #11d; }
212+
213+
214+
/* Truth Table */
215+
.truth { font-family: monospace; }
216+
.error { color: #ff1f1f; }
217+
table.truthTable td { text-align: center; font-family: monospace; }
218+
table.truthTable th { background-color: #dfdfdf; }
219+
table.truthTable tbody th { font-weight: normal; font-family: monospace; }
220+
221+
/* Casting couch^h^h^htable */
222+
table.casting { font-size: x-small; }
223+
224+
.castY { background-color: #7FFF7F;
225+
color: black; }
226+
227+
.castN { background-color: #FF7F7F;
228+
color: black; }
229+
230+
.castM { background-color: white;
231+
color: black; }
232+
233+
span.cancast:hover { background-color: #ffa;
234+
color: black; }
235+
236+
.SPARQLoperator { background-color: #FFFFbf; /* yellow */
237+
}
238+
239+
.owlnonterminal {
240+
font-weight: bold;
241+
font-family: sans-serif;
242+
font-size: 95%;
243+
}
244+
.owlgrammar {
245+
margin-top: 1ex;
246+
margin-bottom: 1ex;
247+
padding-left: 1ex;
248+
padding-right: 1ex;
249+
padding-top: 1ex;
250+
padding-bottom: 0.6ex;
251+
border: 1px dashed #2f6fab;
252+
font-family: monospace;
253+
}

0 commit comments

Comments
 (0)