Skip to content

Commit 6641aa0

Browse files
committed
updated _everything_
1 parent f94e31d commit 6641aa0

File tree

497 files changed

+300863
-565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

497 files changed

+300863
-565
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
function.xml
22
catalog*.xml
3+
node_modules/
4+
*.iml

CHANGELOG.fnoi.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Function Ontology - Implementation Vocabulary Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## Unreleased
8+
9+
## 0.1.1 - 2020-12-23
10+
11+
### Changed
12+
13+
- Updated and clarified definitions
14+
15+
## 0.1.0
16+
17+
### Added
18+
19+
- Creation

CHANGELOG.fnom.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Function Ontology - Implementation Vocabulary Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## Unreleased
8+
9+
## 0.2.1 - 2020-12-23
10+
11+
### Changed
12+
13+
- Updated and clarified definitions
14+
15+
## 0.2.0
16+
17+
## 0.1.0
18+
19+
### Added
20+
21+
- Creation

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Roadmap
88

9-
- [ ] TODO auto-fill same-semantics metadata
9+
- [ ] TODO auto-fill same-semantics metadata as recommended by https://w3id.org/widoco/bestPractices
1010

1111
## Unreleased
1212

13+
## [1.0.0] - 2020-12-23
14+
1315
### Added
1416

1517
- Changelog
@@ -52,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5254
### Added
5355
- creation.
5456

57+
[1.0.0]: https://github.com/IDLabResearch/function-ontology/compare/v0.6.0...v1.0.0
5558
[0.6.0]: https://github.com/IDLabResearch/function-ontology/compare/v0.5.1...v0.6.0
5659
[0.5.1]: https://github.com/IDLabResearch/function-ontology/compare/v0.5.0...v0.5.1
5760
[0.5.0]: https://github.com/IDLabResearch/function-ontology/compare/0.4.1...v0.5.0

README.MD

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,16 @@
55
See https://w3id.org/function/spec for the full specification
66

77
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.595382.svg)](https://doi.org/10.5281/zenodo.595382)
8+
9+
## Releasing a new version
10+
11+
Make sure you have the WiDoCo 1.4.x jar downloaded in the root of this repo, and you have JAVA and Node.js installed.
12+
Then, execute
13+
14+
```shell
15+
npm install
16+
cd ./dist
17+
node build.js
18+
```
19+
20+
The folders in `dist` should mimic the same structure and contents under https://w3id.org/function.

dist/build.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
const util = require('util');
2+
const fs = require('fs/promises');
3+
const exec = util.promisify(require('child_process').exec);
4+
5+
const $rdf = require('rdflib');
6+
const Namespace = $rdf.Namespace;
7+
8+
const DC = Namespace("http://purl.org/dc/elements/1.1/");
9+
const OWL = Namespace("http://www.w3.org/2002/07/owl#");
10+
const RDF = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
11+
const VANN = Namespace("http://purl.org/vocab/vann/");
12+
const VOAF = Namespace("http://purl.org/vocommons/voaf#");
13+
14+
const map = [
15+
{
16+
ttlFile: "../fno.ttl",
17+
outputFolder: "./ontology",
18+
uri: "https://w3id.org/function/ontology#",
19+
}, {
20+
ttlFile: "../fnoi.ttl",
21+
outputFolder: "./vocabulary/implementation",
22+
uri: "https://w3id.org/function/vocabulary/implementation#",
23+
}, {
24+
ttlFile: "../fnom.ttl",
25+
outputFolder: "./vocabulary/mapping",
26+
uri: "https://w3id.org/function/vocabulary/mapping#",
27+
},
28+
]
29+
30+
processMap(map);
31+
32+
async function processMap(map) {
33+
for (const elem of map) {
34+
const store = await getStore(elem.ttlFile);
35+
await runWidoco(elem.ttlFile, elem.outputFolder, store);
36+
}
37+
}
38+
39+
async function runWidoco(ontFile, outFolder, store) {
40+
const preStuff = 'java -jar ../widoco-1.4.14-jar-with-dependencies.jar';
41+
const postStuff = '-getOntologyMetadata -oops -rewriteAll -htaccess -webVowl -analytics UA-87734787-2 -excludeIntroduction';
42+
const voc = store.any(null, RDF('type'), VOAF('Vocabulary'));
43+
const version = store.any(voc, OWL('versionInfo')).value;
44+
const uri = store.any(voc, VANN('preferredNamespaceUri')).value;
45+
const prefix = store.any(voc, VANN('preferredNamespacePrefix')).value;
46+
const commandVersion = `${preStuff} -ontFile ${ontFile} -outFolder ${outFolder}/${version} ${postStuff}`;
47+
const {stdout, stderr} = await exec(commandVersion);
48+
console.log(stdout);
49+
console.warn(stderr);
50+
const command = `${preStuff} -ontFile ${ontFile} -outFolder ${outFolder} ${postStuff}`;
51+
await exec(command);
52+
const appendData = `<p>The namespace is <b>${uri}</b>, the preferred prefix is <b>${prefix}</b></p>`;
53+
await fs.appendFile(`${outFolder}/${version}/sections/abstract-en.html`, appendData);
54+
await fs.appendFile(`${outFolder}/sections/abstract-en.html`, appendData);
55+
const descriptionPlaceholder = `This is a placeholder text for the description of your ontology. The description should include an explanation and a diagram explaining how the classes are related, examples of usage, etc.`;
56+
let description = await fs.readFile(`${outFolder}/sections/description-en.html`, 'utf8');
57+
description = description.replace(descriptionPlaceholder, "Further description and explanation of these classes and properties are given in the Function Ontology Specification at https://w3id.org/function/spec");
58+
await fs.writeFile(`${outFolder}/${version}/sections/description-en.html`, description);
59+
await fs.writeFile(`${outFolder}/sections/description-en.html`, description);
60+
}
61+
62+
async function getStore(ontFile) {
63+
const store = $rdf.graph();
64+
const body = await fs.readFile(ontFile, 'utf8');
65+
$rdf.parse(body, store, "http://example.com/#", 'text/turtle');
66+
return store;
67+
}

dist/ontology/.htaccess

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Turn off MultiViews
2+
Options -MultiViews
3+
4+
# Directive to ensure *.rdf files served as appropriate content type,
5+
# if not present in main apache config
6+
AddType application/rdf+xml .rdf
7+
AddType application/rdf+xml .owl
8+
AddType text/turtle .ttl
9+
AddType application/n-triples .n3
10+
AddType application/ld+json .json
11+
# Rewrite engine setup
12+
RewriteEngine On
13+
#Change the path to the folder here
14+
RewriteBase /./ontology
15+
16+
# Rewrite rule to serve HTML content from the vocabulary URI if requested
17+
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml)
18+
RewriteCond %{HTTP_ACCEPT} text/html [OR]
19+
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
20+
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
21+
RewriteRule ^$ index-en.html [R=303,L]
22+
23+
# Rewrite rule to serve JSON-LD content from the vocabulary URI if requested
24+
RewriteCond %{HTTP_ACCEPT} application/ld\+json
25+
RewriteRule ^$ ontology.json [R=303,L]
26+
27+
# Rewrite rule to serve RDF/XML content from the vocabulary URI if requested
28+
RewriteCond %{HTTP_ACCEPT} \*/\* [OR]
29+
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
30+
RewriteRule ^$ ontology.xml [R=303,L]
31+
32+
# Rewrite rule to serve N-Triples content from the vocabulary URI if requested
33+
RewriteCond %{HTTP_ACCEPT} application/n-triples
34+
RewriteRule ^$ ontology.nt [R=303,L]
35+
36+
# Rewrite rule to serve TTL content from the vocabulary URI if requested
37+
RewriteCond %{HTTP_ACCEPT} text/turtle [OR]
38+
RewriteCond %{HTTP_ACCEPT} text/\* [OR]
39+
RewriteCond %{HTTP_ACCEPT} \*/turtle
40+
RewriteRule ^$ ontology.ttl [R=303,L]
41+
42+
RewriteCond %{HTTP_ACCEPT} .+
43+
RewriteRule ^$ 406.html [R=406,L]
44+
# Default response
45+
# ---------------------------
46+
# Rewrite rule to serve the RDF/XML content from the vocabulary URI by default
47+
RewriteRule ^$ ontology.xml [R=303,L]

0 commit comments

Comments
 (0)