├── .gitignore
├── .npmignore
├── CNAME
├── LICENSE
├── README.md
├── context.js
├── index.html
├── index.js
├── lib
├── context.js
├── fonts
│ ├── Open-Sans-300
│ │ ├── Open-Sans-300.eot
│ │ ├── Open-Sans-300.svg
│ │ ├── Open-Sans-300.ttf
│ │ ├── Open-Sans-300.woff
│ │ └── Open-Sans-300.woff2
│ ├── Open-Sans-300italic
│ │ ├── Open-Sans-300italic.eot
│ │ ├── Open-Sans-300italic.svg
│ │ ├── Open-Sans-300italic.ttf
│ │ ├── Open-Sans-300italic.woff
│ │ └── Open-Sans-300italic.woff2
│ ├── Open-Sans-600
│ │ ├── Open-Sans-600.eot
│ │ ├── Open-Sans-600.svg
│ │ ├── Open-Sans-600.ttf
│ │ ├── Open-Sans-600.woff
│ │ └── Open-Sans-600.woff2
│ └── Open-Sans-600italic
│ │ ├── Open-Sans-600italic.eot
│ │ ├── Open-Sans-600italic.svg
│ │ ├── Open-Sans-600italic.ttf
│ │ ├── Open-Sans-600italic.woff
│ │ └── Open-Sans-600italic.woff2
├── index.css
├── index.js
└── template.html
├── logo.svg
├── ontology.js
├── package-lock.json
├── package.json
├── prefixes.js
└── test
└── test.js
/.gitignore:
--------------------------------------------------------------------------------
1 | scholarly-article-browser.js
2 | ontology-browser.js
3 | node_modules
4 | npm-debug.log
5 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .git
2 | test/
3 | .gitignore
4 |
--------------------------------------------------------------------------------
/CNAME:
--------------------------------------------------------------------------------
1 | ns.sci.pe
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ontology
2 |
3 | [](https://github.com/prettier/prettier)
4 |
5 | See: [http://ns.sci.pe](http://ns.sci.pe).
6 |
7 | ## See Also
8 |
9 | - [DoCO, the Document Components Ontology](http://purl.org/spar/doco)
10 | - [DEO, the Discourse Elements Ontology](http://purl.org/spar/deo).
11 |
12 | Note these two ontologies also incorporate
13 | the
14 | [SALT Rhetorical Ontology](http://salt.semanticauthoring.org/ontologies/sro.rdfs) (no
15 | longer maintained).
16 |
17 | - https://github.com/DrInventor/ontologies
18 | - https://github.com/nature/public-npg-core-ontology
19 |
20 | ## Development
21 |
22 | ```
23 | npm install
24 | npm run watch
25 |
26 | open a browser on port 8080
27 | ```
28 |
29 | Do **not** edit `index.html` or `context.js` manually, these files are
30 | automatically generated by the code and template in the `lib/`
31 | directory.
32 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./ontology');
2 |
--------------------------------------------------------------------------------
/lib/context.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var ontology = require('../ontology');
4 | var fs = require('fs');
5 | var path = require('path');
6 | var isUrl = require('is-url');
7 | var context = require('schema.org/context');
8 | var prefixes = require('../prefixes');
9 |
10 | /**
11 | * Generate a JSON-LD context
12 | */
13 |
14 | let ctx = context['@context'];
15 | // patch schema.org context as we don't want type and id to be alias for `@id` and `@type`
16 | delete ctx.type;
17 | delete ctx.id;
18 |
19 | // prefixes
20 | Object.keys(prefixes).forEach(function(key) {
21 | ctx[key] = prefixes[key];
22 | });
23 |
24 | // specify container and stricter @type than from the default context
25 | let schemaMap = {
26 | sameAs: { '@container': '@set', '@type': '@id' },
27 | hasPart: { '@container': '@list', '@type': '@id' },
28 | encoding: { '@container': '@set', '@type': '@id' },
29 | distribution: { '@container': '@set', '@type': '@id' },
30 | review: { '@container': '@set', '@type': '@id' },
31 | reviewRating: { '@type': '@id' },
32 | comment: { '@container': '@set', '@type': '@id' },
33 | agent: { '@type': '@id' },
34 | participant: { '@container': '@set', '@type': '@id' },
35 | recipient: { '@type': '@id' },
36 | sender: { '@type': '@id' },
37 | messageAttachment: { '@type': '@id' },
38 | creator: { '@type': '@id' },
39 | grantee: { '@type': '@id' },
40 | author: { '@container': '@list', '@type': '@id' },
41 | producer: { '@container': '@list', '@type': '@id' },
42 | editor: { '@container': '@list', '@type': '@id' },
43 | contributor: { '@container': '@list', '@type': '@id' },
44 | provider: { '@container': '@list', '@type': '@id' },
45 | affiliation: { '@container': '@list', '@type': '@id' },
46 | thumbnail: { '@container': '@set', '@type': '@id' },
47 | isBasedOnUrl: { '@container': '@set', '@type': '@id' },
48 | isBasedOn: { '@container': '@set', '@type': '@id' },
49 | encodesCreativeWork: { '@type': '@id' },
50 | isPartOf: { '@type': '@id' },
51 | exampleOfWork: { '@container': '@set', '@type': '@id' },
52 | potentialAction: { '@container': '@set', '@type': '@id' },
53 | error: { '@type': '@id' },
54 | result: { '@type': '@id' },
55 | suggestedResult: { '@type': '@id' },
56 | resultReview: { '@type': '@id' },
57 | resultComment: { '@type': '@id' },
58 | object: { '@type': '@id' },
59 | about: { '@container': '@set', '@type': '@id' },
60 | knowsAbout: { '@container': '@set', '@type': '@id' },
61 | mainEntity: { '@type': '@id' },
62 | mainEntityOfPage: { '@type': '@id' },
63 | copyrightHolder: { '@type': '@id' },
64 | sponsor: { '@container': '@set', '@type': '@id' },
65 | funder: { '@container': '@set', '@type': '@id' },
66 | citation: { '@container': '@list', '@type': '@id' },
67 | keywords: { '@container': '@set' },
68 | exifData: { '@container': '@set', '@type': '@id' },
69 | location: { '@type': '@id' },
70 | address: { '@type': '@id' },
71 | parentOrganization: { '@type': '@id' },
72 | expectsAcceptanceOf: { '@type': '@id' },
73 | publishingPrinciples: { '@type': '@id' },
74 | instrument: { '@type': '@id' },
75 | targetCollection: { '@type': '@id' },
76 | parentItem: { '@type': '@id' },
77 | question: { '@type': '@id' },
78 | suggestedAnswer: { '@type': '@id' },
79 | acceptedAnswer: { '@type': '@id' },
80 | item: { '@type': '@id' },
81 | memberOf: { '@type': '@id' },
82 | itemListElement: { '@container': '@set', '@type': '@id' },
83 | itemListFacet: { '@container': '@set', '@type': '@id' },
84 | hasDigitalDocumentPermission: { '@container': '@set', '@type': '@id' },
85 | priceSpecification: { '@type': '@id' }
86 | };
87 |
88 | for (let key in schemaMap) {
89 | if (key in ctx) {
90 | if (typeof ctx[key] === 'string') {
91 | ctx[key] = Object.assign({ '@id': ctx[key] }, schemaMap[key]);
92 | } else {
93 | ctx[key] = Object.assign(
94 | ctx[key],
95 | ctx[key]['@id'] ? null : { '@id': ctx['@vocab'] + key },
96 | schemaMap[key]
97 | );
98 | }
99 | } else {
100 | ctx[key] = Object.assign(
101 | {
102 | '@id': ctx['@vocab'] + key
103 | },
104 | schemaMap[key]
105 | );
106 | }
107 | }
108 |
109 | ctx.datePublished = { '@id': 'http://schema.org/datePublished' };
110 | ctx.endTime = { '@id': 'http://schema.org/endTime' };
111 |
112 | // reverse properties currently not in schema.org
113 | ctx.targetProductOf = {
114 | '@reverse': 'http://schema.org/targetProduct',
115 | '@type': '@id'
116 | };
117 |
118 | // add sa terms
119 | let saContainerMap = {
120 | style: '@set',
121 | roleAction: '@set',
122 | roleAffiliation: '@list',
123 | roleContactPoint: '@set',
124 | contentChecksum: '@set',
125 | permissionScope: '@set',
126 | publicationTypeCoverage: '@set',
127 | note: '@set'
128 | };
129 |
130 | ontology.defines.forEach(term => {
131 | let key = term['@id'].replace(/^sa:/, '');
132 | if (term['@type'] === 'rdfs:Class') {
133 | ctx[key] = urlify(term['@id'], ontology);
134 | } else if (term['@type'] === 'rdf:Property') {
135 | let iri = urlify(term['@id'], ontology);
136 | if (key === 'resourceOf' || key === 'isNodeOf') {
137 | // Note: we do note set @type: @id to avoid re-embedding the whole graph during framing
138 | ctx[key] = {
139 | '@id': iri
140 | };
141 | } else if (term.range === 'schema:Boolean') {
142 | ctx[key] = {
143 | '@id': iri,
144 | '@type': 'xsd:boolean'
145 | };
146 | } else if (
147 | /^xsd:|schema:Date|schema:DateTime|schema:Text|schema:Number/.test(
148 | term.range
149 | )
150 | ) {
151 | ctx[key] = {
152 | '@id': iri,
153 | '@type': term.range
154 | };
155 | } else {
156 | ctx[key] = {
157 | '@id': iri,
158 | '@type': '@id'
159 | };
160 | }
161 | if (key in saContainerMap) {
162 | ctx[key]['@container'] = saContainerMap[key];
163 | }
164 | }
165 | });
166 |
167 | let pkg = 'module.exports = ' + JSON.stringify(context, null, 2) + ';';
168 |
169 | fs.writeFileSync(path.join(path.dirname(__dirname), 'context.js'), pkg, {
170 | encoding: 'utf8'
171 | });
172 |
173 | function urlify(value, ontology) {
174 | if (isUrl(value)) {
175 | return value;
176 | }
177 |
178 | let iri;
179 | let splt = value.split(':');
180 | let prefix = splt[0];
181 | if (prefix in ontology['@context']) {
182 | iri =
183 | (ontology['@context'][prefix]['@id'] || ontology['@context'][prefix]) +
184 | splt.slice(1).join(':');
185 | } else {
186 | let base = ontology['@context']['@base'] || ontology['@context']['@vocab'];
187 | iri = base + value;
188 | }
189 |
190 | return iri;
191 | }
192 |
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-300/Open-Sans-300.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-300/Open-Sans-300.eot
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-300/Open-Sans-300.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
12 |
13 |
14 |
15 |
17 |
19 |
22 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
36 |
37 |
39 |
41 |
42 |
44 |
46 |
47 |
50 |
52 |
53 |
54 |
55 |
56 |
57 |
59 |
62 |
63 |
65 |
67 |
68 |
69 |
70 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
81 |
82 |
84 |
85 |
87 |
88 |
89 |
90 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
103 |
105 |
106 |
108 |
110 |
111 |
114 |
115 |
116 |
118 |
119 |
120 |
122 |
123 |
125 |
127 |
129 |
130 |
132 |
133 |
134 |
135 |
137 |
138 |
140 |
141 |
143 |
144 |
146 |
147 |
148 |
149 |
151 |
153 |
155 |
156 |
157 |
160 |
161 |
164 |
166 |
167 |
168 |
169 |
172 |
173 |
175 |
176 |
178 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
188 |
189 |
191 |
193 |
196 |
198 |
200 |
202 |
204 |
206 |
208 |
210 |
211 |
213 |
214 |
215 |
216 |
218 |
219 |
220 |
221 |
223 |
224 |
226 |
228 |
230 |
232 |
235 |
237 |
238 |
240 |
242 |
244 |
246 |
248 |
249 |
250 |
253 |
255 |
257 |
259 |
262 |
265 |
268 |
271 |
273 |
275 |
277 |
279 |
281 |
282 |
283 |
284 |
286 |
288 |
290 |
292 |
294 |
296 |
299 |
301 |
303 |
305 |
307 |
309 |
311 |
313 |
315 |
317 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
930 |
931 |
932 |
933 |
934 |
935 |
936 |
937 |
938 |
939 |
940 |
941 |
942 |
943 |
944 |
945 |
946 |
947 |
948 |
949 |
950 |
951 |
952 |
953 |
954 |
955 |
956 |
957 |
958 |
959 |
960 |
961 |
962 |
963 |
964 |
965 |
966 |
967 |
968 |
969 |
970 |
971 |
972 |
973 |
974 |
975 |
976 |
977 |
978 |
979 |
980 |
981 |
982 |
983 |
984 |
985 |
986 |
987 |
988 |
989 |
990 |
991 |
992 |
993 |
994 |
995 |
996 |
997 |
998 |
999 |
1000 |
1001 |
1002 |
1003 |
1004 |
1005 |
1006 |
1007 |
1008 |
1009 |
1010 |
1011 |
1012 |
1013 |
1014 |
1015 |
1016 |
1017 |
1018 |
1019 |
1020 |
1021 |
1022 |
1023 |
1024 |
1025 |
1026 |
1027 |
1028 |
1029 |
1030 |
1031 |
1032 |
1033 |
1034 |
1035 |
1036 |
1037 |
1038 |
1039 |
1040 |
1041 |
1042 |
1043 |
1044 |
1045 |
1046 |
1047 |
1048 |
1049 |
1050 |
1051 |
1052 |
1053 |
1054 |
1055 |
1056 |
1057 |
1058 |
1059 |
1060 |
1061 |
1062 |
1063 |
1064 |
1065 |
1066 |
1067 |
1068 |
1069 |
1070 |
1071 |
1072 |
1073 |
1074 |
1075 |
1076 |
1077 |
1078 |
1079 |
1080 |
1081 |
1082 |
1083 |
1084 |
1085 |
1086 |
1087 |
1088 |
1089 |
1090 |
1091 |
1092 |
1093 |
1094 |
1095 |
1096 |
1097 |
1098 |
1099 |
1100 |
1101 |
1102 |
1103 |
1104 |
1105 |
1106 |
1107 |
1108 |
1109 |
1110 |
1111 |
1112 |
1113 |
1114 |
1115 |
1116 |
1117 |
1118 |
1119 |
1120 |
1121 |
1122 |
1123 |
1124 |
1125 |
1126 |
1127 |
1128 |
1129 |
1130 |
1131 |
1132 |
1133 |
1134 |
1135 |
1136 |
1137 |
1138 |
1139 |
1140 |
1141 |
1142 |
1143 |
1144 |
1145 |
1146 |
1147 |
1148 |
1149 |
1150 |
1151 |
1152 |
1153 |
1154 |
1155 |
1156 |
1157 |
1158 |
1159 |
1160 |
1161 |
1162 |
1163 |
1164 |
1165 |
1166 |
1167 |
1168 |
1169 |
1170 |
1171 |
1172 |
1173 |
1174 |
1175 |
1176 |
1177 |
1178 |
1179 |
1180 |
1181 |
1182 |
1183 |
1184 |
1185 |
1186 |
1187 |
1188 |
1189 |
1190 |
1191 |
1192 |
1193 |
1194 |
1195 |
1196 |
1197 |
1198 |
1199 |
1200 |
1201 |
1202 |
1203 |
1204 |
1205 |
1206 |
1207 |
1208 |
1209 |
1210 |
1211 |
1212 |
1213 |
1214 |
1215 |
1216 |
1217 |
1218 |
1219 |
1220 |
1221 |
1222 |
1223 |
1224 |
1225 |
1226 |
1227 |
1228 |
1229 |
1230 |
1231 |
1232 |
1233 |
1234 |
1235 |
1236 |
1237 |
1238 |
1239 |
1240 |
1241 |
1242 |
1243 |
1244 |
1245 |
1246 |
1247 |
1248 |
1249 |
1250 |
1251 |
1252 |
1253 |
1254 |
1255 |
1256 |
1257 |
1258 |
1259 |
1260 |
1261 |
1262 |
1263 |
1264 |
1265 |
1266 |
1267 |
1268 |
1269 |
1270 |
1271 |
1272 |
1273 |
1274 |
1275 |
1276 |
1277 |
1278 |
1279 |
1280 |
1281 |
1282 |
1283 |
1284 |
1285 |
1286 |
1287 |
1288 |
1289 |
1290 |
1291 |
1292 |
1293 |
1294 |
1295 |
1296 |
1297 |
1298 |
1299 |
1300 |
1301 |
1302 |
1303 |
1304 |
1305 |
1306 |
1307 |
1308 |
1309 |
1310 |
1311 |
1312 |
1313 |
1314 |
1315 |
1316 |
1317 |
1318 |
1319 |
1320 |
1321 |
1322 |
1323 |
1324 |
1325 |
1326 |
1327 |
1328 |
1329 |
1330 |
1331 |
1332 |
1333 |
1334 |
1335 |
1336 |
1337 |
1338 |
1339 |
1340 |
1341 |
1342 |
1343 |
1344 |
1345 |
1346 |
1347 |
1348 |
1349 |
1350 |
1351 |
1352 |
1353 |
1354 |
1355 |
1356 |
1357 |
1358 |
1359 |
1360 |
1361 |
1362 |
1363 |
1364 |
1365 |
1366 |
1367 |
1368 |
1369 |
1370 |
1371 |
1372 |
1373 |
1374 |
1375 |
1376 |
1377 |
1378 |
1379 |
1380 |
1381 |
1382 |
1383 |
1384 |
1385 |
1386 |
1387 |
1388 |
1389 |
1390 |
1391 |
1392 |
1393 |
1394 |
1395 |
1396 |
1397 |
1398 |
1399 |
1400 |
1401 |
1402 |
1403 |
1404 |
1405 |
1406 |
1407 |
1408 |
1409 |
1410 |
1411 |
1412 |
1413 |
1414 |
1415 |
1416 |
1417 |
1418 |
1419 |
1420 |
1421 |
1422 |
1423 |
1424 |
1425 |
1426 |
1427 |
1428 |
1429 |
1430 |
1431 |
1432 |
1433 |
1434 |
1435 |
1436 |
1437 |
1438 |
1439 |
1440 |
1441 |
1442 |
1443 |
1444 |
1445 |
1446 |
1447 |
1448 |
1449 |
1450 |
1451 |
1452 |
1453 |
1454 |
1455 |
1456 |
1457 |
1458 |
1459 |
1460 |
1461 |
1462 |
1463 |
1464 |
1465 |
1466 |
1467 |
1468 |
1469 |
1470 |
1471 |
1472 |
1473 |
1474 |
1475 |
1476 |
1477 |
1478 |
1479 |
1480 |
1481 |
1482 |
1483 |
1484 |
1485 |
1486 |
1487 |
1488 |
1489 |
1490 |
1491 |
1492 |
1493 |
1494 |
1495 |
1496 |
1497 |
1498 |
1499 |
1500 |
1501 |
1502 |
1503 |
1504 |
1505 |
1506 |
1507 |
1508 |
1509 |
1510 |
1511 |
1512 |
1513 |
1514 |
1515 |
1516 |
1517 |
1518 |
1519 |
1520 |
1521 |
1522 |
1523 |
1524 |
1525 |
1526 |
1527 |
1528 |
1529 |
1530 |
1531 |
1532 |
1533 |
1534 |
1535 |
1536 |
1537 |
1538 |
1539 |
1540 |
1541 |
1542 |
1543 |
1544 |
1545 |
1546 |
1547 |
1548 |
1549 |
1550 |
1551 |
1552 |
1553 |
1554 |
1555 |
1556 |
1557 |
1558 |
1559 |
1560 |
1561 |
1562 |
1563 |
1564 |
1565 |
1566 |
1567 |
1568 |
1569 |
1570 |
1571 |
1572 |
1573 |
1574 |
1575 |
1576 |
1577 |
1578 |
1579 |
1580 |
1581 |
1582 |
1583 |
1584 |
1585 |
1586 |
1587 |
1588 |
1589 |
1590 |
1591 |
1592 |
1593 |
1594 |
1595 |
1596 |
1597 |
1598 |
1599 |
1600 |
1601 |
1602 |
1603 |
1604 |
1605 |
1606 |
1607 |
1608 |
1609 |
1610 |
1611 |
1612 |
1613 |
1614 |
1615 |
1616 |
1617 |
1618 |
1619 |
1620 |
1621 |
1622 |
1623 |
1624 |
1625 |
1626 |
1627 |
1628 |
1629 |
1630 |
1631 |
1632 |
1633 |
1634 |
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-300/Open-Sans-300.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-300/Open-Sans-300.ttf
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-300/Open-Sans-300.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-300/Open-Sans-300.woff
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-300/Open-Sans-300.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-300/Open-Sans-300.woff2
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-300italic/Open-Sans-300italic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-300italic/Open-Sans-300italic.eot
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-300italic/Open-Sans-300italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-300italic/Open-Sans-300italic.ttf
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-300italic/Open-Sans-300italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-300italic/Open-Sans-300italic.woff
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-300italic/Open-Sans-300italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-300italic/Open-Sans-300italic.woff2
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-600/Open-Sans-600.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-600/Open-Sans-600.eot
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-600/Open-Sans-600.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-600/Open-Sans-600.ttf
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-600/Open-Sans-600.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-600/Open-Sans-600.woff
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-600/Open-Sans-600.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-600/Open-Sans-600.woff2
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-600italic/Open-Sans-600italic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-600italic/Open-Sans-600italic.eot
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-600italic/Open-Sans-600italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-600italic/Open-Sans-600italic.ttf
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-600italic/Open-Sans-600italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-600italic/Open-Sans-600italic.woff
--------------------------------------------------------------------------------
/lib/fonts/Open-Sans-600italic/Open-Sans-600italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/science-periodicals/ontology/00d912ddde5b42ee4aeb4c96b1b052233fe19f8c/lib/fonts/Open-Sans-600italic/Open-Sans-600italic.woff2
--------------------------------------------------------------------------------
/lib/index.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Open Sans';
3 | font-weight: 300;
4 | font-style: normal;
5 | src: url('fonts/Open-Sans-300/Open-Sans-300.eot');
6 | src: url('fonts/Open-Sans-300/Open-Sans-300.eot?#iefix') format('embedded-opentype'),
7 | local('Open Sans Light'),
8 | local('Open-Sans-300'),
9 | url('fonts/Open-Sans-300/Open-Sans-300.woff2') format('woff2'),
10 | url('fonts/Open-Sans-300/Open-Sans-300.woff') format('woff'),
11 | url('fonts/Open-Sans-300/Open-Sans-300.ttf') format('truetype'),
12 | url('fonts/Open-Sans-300/Open-Sans-300.svg#OpenSans') format('svg');
13 | }
14 |
15 | @font-face {
16 | font-family: 'Open Sans';
17 | font-weight: 600;
18 | font-style: normal;
19 | src: url('fonts/Open-Sans-600/Open-Sans-600.eot');
20 | src: url('fonts/Open-Sans-600/Open-Sans-600.eot?#iefix') format('embedded-opentype'),
21 | local('Open Sans Semibold'),
22 | local('Open-Sans-600'),
23 | url('fonts/Open-Sans-600/Open-Sans-600.woff2') format('woff2'),
24 | url('fonts/Open-Sans-600/Open-Sans-600.woff') format('woff'),
25 | url('fonts/Open-Sans-600/Open-Sans-600.ttf') format('truetype'),
26 | url('fonts/Open-Sans-600/Open-Sans-600.svg#OpenSans') format('svg');
27 | }
28 |
29 | @font-face {
30 | font-family: 'Open Sans';
31 | font-weight: 300;
32 | font-style: italic;
33 | src: url('fonts/Open-Sans-300italic/Open-Sans-300italic.eot');
34 | src: url('fonts/Open-Sans-300italic/Open-Sans-300italic.eot?#iefix') format('embedded-opentype'),
35 | local('Open Sans Light Italic'),
36 | local('Open-Sans-300italic'),
37 | url('fonts/Open-Sans-300italic/Open-Sans-300italic.woff2') format('woff2'),
38 | url('fonts/Open-Sans-300italic/Open-Sans-300italic.woff') format('woff'),
39 | url('fonts/Open-Sans-300italic/Open-Sans-300italic.ttf') format('truetype'),
40 | url('fonts/Open-Sans-300italic/Open-Sans-300italic.svg#OpenSans') format('svg');
41 | }
42 |
43 | @font-face {
44 | font-family: 'Open Sans';
45 | font-weight: 600;
46 | font-style: italic;
47 | src: url('fonts/Open-Sans-600italic/Open-Sans-600italic.eot');
48 | src: url('fonts/Open-Sans-600italic/Open-Sans-600italic.eot?#iefix') format('embedded-opentype'),
49 | local('Open Sans Semibold Italic'),
50 | local('Open-Sans-600italic'),
51 | url('fonts/Open-Sans-600italic/Open-Sans-600italic.woff2') format('woff2'),
52 | url('fonts/Open-Sans-600italic/Open-Sans-600italic.woff') format('woff'),
53 | url('fonts/Open-Sans-600italic/Open-Sans-600italic.ttf') format('truetype'),
54 | url('fonts/Open-Sans-600italic/Open-Sans-600italic.svg#OpenSans') format('svg');
55 | }
56 |
57 | * {
58 | box-sizing: border-box;
59 | }
60 |
61 | body {
62 | margin: 0px;
63 | background: #fff;
64 | padding-bottom: 50px;
65 | color: #434343;
66 | font-family: "Open Sans", sans-serif;
67 | font-weight: 400;
68 | font-size: 14px;
69 | line-height: 24px;
70 | }
71 |
72 | .scienceai {
73 | background-color: #fff;
74 | padding: 8px 25px;
75 | width: 100%;
76 | border-top:1px solid #E0E0E0;
77 | border-bottom:1px solid #E0E0E0;
78 | display:inline-block;
79 | vertical-align: middle;
80 | height: 52px;
81 | margin-bottom: 10px;
82 | position: fixed;
83 | top:0px;
84 | z-index: 100;
85 | box-shadow: 2px 2px 5px #BCBCBC;
86 | }
87 |
88 | main {
89 | margin: 43px auto;
90 | max-width: 1024px;
91 | min-height: 500px;
92 | padding:0 2em;
93 | }
94 |
95 |
96 | .title {
97 | text-align: center;
98 | margin-top: 88px;
99 | }
100 |
101 |
102 | h1, h2, h3, h4 {
103 | font-weight: 400;
104 | letter-spacing: .08em;
105 | page-break-after: avoid;
106 | }
107 |
108 | h1, h2{
109 | text-transform: uppercase;
110 | }
111 |
112 | h1 {
113 | font-size: 2em;
114 | margin-bottom: 2em;
115 | }
116 |
117 | a {
118 | color: #2196f3;
119 | }
120 | a, :link, :visited {
121 | text-decoration: none;
122 | color: #2196f3;
123 | }
124 |
125 | a:active {
126 | color: #64b5f6;
127 | }
128 |
129 | nav ul li {
130 | display: inline-block;
131 | margin: 0px 1em 0px 0px;
132 | }
133 |
134 | article dt::after {
135 | content: ":";
136 | }
137 |
138 |
139 | article ul {
140 | padding-left: 0;
141 | margin-left: 0;
142 | }
143 |
144 | article ul li {
145 | background-color: whitesmoke;
146 | list-style: none;
147 | margin-left: 0;
148 | margin-bottom: 20px;
149 | border-radius: 8px;
150 | padding: 10px 40px 20px 40px;
151 | }
152 |
153 | article dd li {
154 | list-style: circle;
155 | padding: 0px;
156 | margin-bottom: 0px;
157 | }
158 |
159 | article li h3 {
160 | border-bottom: 2px solid white;
161 | padding-bottom: 16px;
162 | }
163 |
164 |
165 | @media screen and (max-width: 640px) {
166 | body {
167 | margin: 0 auto;
168 | padding: 1px;
169 | font-size: 0.9em;
170 | }
171 |
172 | a {
173 | word-wrap: break-word;
174 | }
175 | }
176 |
177 | /* D3 chart */
178 |
179 | .hidden {
180 | display: none;
181 | }
182 |
--------------------------------------------------------------------------------
/lib/index.js:
--------------------------------------------------------------------------------
1 | var ontology = require('../ontology');
2 | var jsdom = require('jsdom');
3 | var isUrl = require('is-url');
4 | var fs = require('fs');
5 | var path = require('path');
6 |
7 | var dom = new jsdom.JSDOM(
8 | fs.readFileSync(path.join(__dirname, 'template.html'), { encoding: 'utf8' })
9 | );
10 |
11 | var document = dom.window.document;
12 |
13 | // inject table of content (overview)
14 |
15 | [
16 | { '@type': 'rdfs:Class', id: 'overview-classes' },
17 | { '@type': 'rdf:Property', id: 'overview-properties' },
18 | { id: 'overview-enumeration-members' }
19 | ].forEach(x => {
20 | let terms = ontology.defines
21 | .filter(term => {
22 | if (x['@type']) {
23 | return term['@type'] === x['@type'];
24 | } else {
25 | return (
26 | term['@type'] !== 'rdfs:Class' && term['@type'] !== 'rdf:Property'
27 | );
28 | }
29 | })
30 | .sort((a, b) => {
31 | return a.label.localeCompare(b.label);
32 | });
33 |
34 | let $ul = document.getElementById(x.id);
35 | terms.forEach(term => {
36 | let id = term['@id'].split(':')[1];
37 | let $li = document.createElement('li');
38 | $li.innerHTML = `${id} `;
39 | $ul.appendChild($li);
40 | });
41 | });
42 |
43 | // inject ontology in RDFa
44 |
45 | let $article = document.createElement('article');
46 | $article.setAttribute(
47 | 'prefix',
48 | ['schema', 'sa', 'rdfs', 'rdf', 'owl', 'dc', 'skos']
49 | .map(x => `${x}: ${ontology['@context'][x]}`)
50 | .join(' ')
51 | );
52 |
53 | [
54 | { '@type': 'rdfs:Class', label: 'Classes' },
55 | { '@type': 'rdf:Property', label: 'Properties' },
56 | { label: 'Enumeration members' }
57 | ].forEach(x => {
58 | let $section = document.createElement('section');
59 | let $h2 = document.createElement('h2');
60 | $h2.textContent = x.label;
61 | $section.appendChild($h2);
62 |
63 | let $ul = document.createElement('ul');
64 |
65 | let terms = ontology.defines
66 | .filter(term => {
67 | if (x['@type']) {
68 | return term['@type'] === x['@type'];
69 | } else {
70 | return (
71 | term['@type'] !== 'rdfs:Class' && term['@type'] !== 'rdf:Property'
72 | );
73 | }
74 | })
75 | .sort((a, b) => {
76 | return a.label.localeCompare(b.label);
77 | });
78 |
79 | terms.forEach(term => {
80 | let $li = document.createElement('li');
81 | $li.setAttribute('typeof', term['@type']);
82 | $li.setAttribute('resource', term['@id']);
83 | $li.setAttribute(
84 | 'id',
85 | term['@id']
86 | .split(':')
87 | .slice(1)
88 | .join(':')
89 | );
90 |
91 | let $meta = document.createElement('meta');
92 | $meta.setAttribute('property', 'rdfs:isDefinedBy');
93 | $meta.setAttribute('content', ontology['@id']);
94 |
95 | $li.appendChild($meta);
96 |
97 | let $h3 = document.createElement('h3');
98 | $h3.setAttribute('property', 'label');
99 | $h3.textContent = term.label;
100 | $li.appendChild($h3);
101 |
102 | let $p = document.createElement('p');
103 | $p.setAttribute('property', 'rdfs:comment');
104 | $p.innerHTML = term.comment;
105 | $li.appendChild($p);
106 |
107 | let $dl = document.createElement('dl');
108 |
109 | [
110 | 'altLabel',
111 | '@id',
112 | '@type',
113 | 'subClassOf',
114 | 'range',
115 | 'domain',
116 | 'sameAs',
117 | 'source',
118 | 'seeAlso'
119 | ].forEach(prop => {
120 | if (
121 | !term[prop] ||
122 | term[prop][0] == null ||
123 | (prop === '@type' &&
124 | (term['@type'] === 'rdfs:Class' || term['@type'] === 'rdf:Property'))
125 | ) {
126 | return;
127 | }
128 |
129 | let $dt = document.createElement('dt');
130 | if (prop === '@id') {
131 | $dt.textContent = 'URL';
132 | } else if (prop === '@type') {
133 | $dt.textContent = 'enumeration';
134 | } else if (prop === 'subClassOf') {
135 | $dt.textContent = 'subclass of';
136 | } else if (prop === 'seeAlso') {
137 | $dt.textContent = 'see also';
138 | } else if (prop === 'altLabel') {
139 | $dt.textContent = 'alternate label';
140 | } else {
141 | $dt.textContent = prop;
142 | }
143 | $dl.appendChild($dt);
144 |
145 | let $dd = document.createElement('dd');
146 | let $ul = document.createElement('ul');
147 | let values = Array.isArray(term[prop]) ? term[prop] : [term[prop]];
148 | values.forEach(value => {
149 | let $li = document.createElement('li');
150 | let $a = document.createElement(
151 | prop === 'label' || prop === 'altLabel' ? 'span' : 'a'
152 | );
153 | if (prop.charAt(0) !== '@') {
154 | $a.setAttribute(
155 | 'property',
156 | ontology['@context'][prop]['@id'] || ontology['@context'][prop]
157 | );
158 | }
159 |
160 | let href, target;
161 | if (isUrl(value)) {
162 | href = value;
163 | target = value;
164 | } else {
165 | let splt = value.split(':');
166 | let prefix = splt[0];
167 | if (prefix in ontology['@context']) {
168 | target = splt.slice(1).join(':');
169 | href =
170 | (ontology['@context'][prefix]['@id'] ||
171 | ontology['@context'][prefix]) + target;
172 | if (prop.charAt(0) === '@') {
173 | target = href;
174 | }
175 | } else {
176 | let base =
177 | ontology['@context']['@base'] || ontology['@context']['@vocab'];
178 | href = base + value;
179 | target = value;
180 | }
181 | }
182 | if ($a.tagName === 'A') {
183 | $a.setAttribute('href', href);
184 | }
185 | $a.textContent = target;
186 | $li.appendChild($a);
187 | $ul.appendChild($li);
188 | });
189 | $dd.appendChild($ul);
190 | $dl.appendChild($dd);
191 | });
192 | $li.appendChild($dl);
193 |
194 | $ul.appendChild($li);
195 | });
196 | $section.appendChild($ul);
197 |
198 | $article.appendChild($section);
199 | });
200 |
201 | let $main = document.querySelector('main');
202 | $main.appendChild($article);
203 |
204 | fs.writeFileSync(
205 | path.join(path.dirname(__dirname), 'index.html'),
206 | dom.serialize(),
207 | { encoding: 'utf8' }
208 | );
209 |
--------------------------------------------------------------------------------
/lib/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | sci.pe ontology (SA)
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | sci.pe ontology
18 |
19 |
20 |
21 | The 'sci.pe ontology' (SA )
22 | is a set of terms (formally defined
23 | in RDF Schema ) necessary
24 | to describe the production process, content and preservation of
25 | scholarly articles (and similar artifacts).
26 |
27 |
28 |
29 | The 'sci.pe ontology' (SA )
30 | is aimed to be used along
31 | with schema.org and in
32 | particular,
33 | the ScholarlyArticle
34 | class (and subclasses). When possible, SA terms of broad interest will be proposed to
35 | schema.org and removed from this ontology if accepted.
36 |
37 |
38 |
39 | The 'sci.pe ontology' (SA )
40 | uses the semantic of
41 | schema.org Role . Roles are especially
42 | useful for concepts of scholarly communication such as author
43 | affiliations, correspondence and sources of funding as these concepts
44 | are often specific to a persona (e.g., a person as an author of a given
45 | work) as opposed to the person in general. For instance, a person can
46 | be affiliated with N institutions but have contributed to a a given work
47 | only within a subset of the institutions he is affiliated to.
48 |
49 |
50 |
51 | Readers not familiar with the semantic of schema.org Role can consult
52 | the introductory
53 | blog post .
54 |
55 |
56 | Namespace
57 |
58 |
59 | http://ns.sci.pe#
, prefixed
60 | as sa
.
61 |
62 |
63 |
64 | Context
65 |
66 |
67 | A JSON-LD context is
68 | available at https://sci.pe (requires
69 | a Accept: application/ld+json
header).
70 |
71 |
72 |
73 | Overview
74 | Classes
75 |
77 | Properties
78 |
80 | Enumeration members
81 |
83 |
84 |
85 | Example
86 |
87 |
88 | See sci.pe
89 | archive for JSON-LD and RDFa examples.
90 |
91 |
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | sci.pe-logo-menubar-h48px
5 | Created with Sketch.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@scipe/ontology",
3 | "version": "23.0.0",
4 | "description": "schema.org extension to describe the production process, content, distribution and preservation of scholarly articles (and similar artifacts)",
5 | "main": "index.js",
6 | "scripts": {
7 | "build-website": "node ./lib/index.js",
8 | "build-context": "node ./lib/context.js",
9 | "build": "browserify index.js > ontology-browser.js && npm run build-website && npm run build-context",
10 | "prepare": "npm run build",
11 | "test": "mocha",
12 | "watch": "http-server & nodemon -e js,html,css -w ./lib/ --ignore lib/bundle.js --exec 'npm run build-website'",
13 | "postversion": "git push && git push --tags"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "git+https://github.com/science-periodicals/ontology.git"
18 | },
19 | "keywords": [
20 | "schema",
21 | "scholarly",
22 | "article",
23 | "ontology",
24 | "JSON-LD"
25 | ],
26 | "eslintConfig": {
27 | "extends": "@scipe"
28 | },
29 | "author": "Sebastien Ballesteros",
30 | "license": "Apache-2.0",
31 | "bugs": {
32 | "url": "https://github.com/science-periodicals/ontology/issues"
33 | },
34 | "homepage": "https://github.com/science-periodicals/ontology#readme",
35 | "devDependencies": {
36 | "@scipe/eslint-config": "^1.0.0",
37 | "browserify": "^16.2.3",
38 | "is-url": "^1.2.4",
39 | "jsdom": "^11.12.0",
40 | "mocha": "^6.1.3",
41 | "nodemon": "^1.18.11",
42 | "schema.org": "^3.1.1"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/prefixes.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | xml: 'http://www.w3.org/XML/1998/namespace',
3 | rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
4 | rdfs: 'http://www.w3.org/2000/01/rdf-schema#',
5 | owl: 'http://www.w3.org/2002/07/owl#',
6 | schema: 'http://schema.org/',
7 | xsd: 'http://www.w3.org/2001/XMLSchema#', // make sure that xsd prefix is present as we use it for typed dates
8 | sa: 'http://ns.sci.pe#',
9 | spdx: 'https://spdx.org/licenses/',
10 |
11 | // subjects
12 | subjects: 'http://ns.nature.com/subjects/',
13 |
14 | // sci.pe API
15 | user: 'https://sci.pe/user/',
16 | bot: 'https://sci.pe/bot/',
17 | tmp: 'https://sci.pe/tmp/',
18 | seq: 'https://sci.pe/seq/',
19 | service: 'https://sci.pe/service/',
20 | org: 'https://sci.pe/organization/',
21 | workflow: 'https://sci.pe/workflow/',
22 | journal: 'https://sci.pe/periodical/',
23 | graph: 'https://sci.pe/graph/',
24 | release: 'https://sci.pe/release/',
25 | action: 'https://sci.pe/action/',
26 | message: 'https://sci.pe/message/',
27 | email: 'https://sci.pe/email/',
28 | node: 'https://sci.pe/node/',
29 | cnode: 'https://sci.pe/cnode/',
30 | anon: 'https://sci.pe/anon/',
31 | question: 'https://sci.pe/question/',
32 | answer: 'https://sci.pe/answer/',
33 | style: 'https://sci.pe/style/',
34 | styleNode: 'https://sci.pe/styleNode/',
35 | tag: 'https://sci.pe/tag/',
36 | order: 'https://sci.pe/order/',
37 | role: 'https://sci.pe/role/',
38 | audience: 'https://sci.pe/audience/',
39 | issue: 'https://sci.pe/issue/',
40 | audienceRole: 'https://sci.pe/audienceRole/',
41 | arole: 'https://sci.pe/arole/',
42 | srole: 'https://sci.pe/srole/',
43 | vendor: 'https://sci.pe/vendor/',
44 | customer: 'https://sci.pe/customer/',
45 | assigner: 'https://sci.pe/assigner/',
46 | participant: 'https://sci.pe/participant/',
47 | subscriber: 'https://sci.pe/subscriber/',
48 | offer: 'https://sci.pe/offer/',
49 | event: 'https://sci.pe/event/',
50 | scienceai: 'https://sci.pe/',
51 | scipe: 'https://sci.pe/',
52 | ses: 'https://sci.pe/ses/'
53 | };
54 |
--------------------------------------------------------------------------------
/test/test.js:
--------------------------------------------------------------------------------
1 | var sa = require('..');
2 | var assert = require('assert');
3 | var prefixes = require('../prefixes');
4 |
5 | describe('ontology', function() {
6 | it('should be available as a JS object', function() {
7 | assert(sa.defines);
8 | });
9 |
10 | it('prefixes should be exposed', function() {
11 | assert(prefixes.scienceai);
12 | });
13 | });
14 |
--------------------------------------------------------------------------------