Skip to content

Commit

Permalink
feat: customize services and help links
Browse files Browse the repository at this point in the history
  • Loading branch information
Yagnap committed Jan 14, 2025
1 parent a9a7fa2 commit 22670fd
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 10 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ The subkeys are:
| `name` | Displayed name of the ontology. | `"SNIK"` |
| `initialView` | Object (probably JSON) which is loaded as the initial view. Consult [snik](./js/config/initialView/snik.json) and [hito](./js/config/initialView/hito.json) as examples. ||
| `snik` | SNIK-specific configuration. Only used for SNIK. Probably `null` if not the default. See below. | `null` |
| `links` | Links to homepage etc. in the services and help menus. See below. ||
| `style` | How to apply shapes and colors to the resources. See below. ||
| `sparql` | SPARQL-Queries to get triples (edges) and classes (nodes). See below. ||

Expand All @@ -150,6 +151,20 @@ The subkeys are:
| `center` | If `initialView` is not specified, `snik.centerDepth` number of star operations are made on this node. | `"http://www.snik.eu/ontology/bb/ChiefInformationOfficer"` |
| `centerDepth` | How many star operations to make on `snik.center` if no `initialView` is specified. | `1` |

##### Help links

If you do not want to display ome or more of these, set them to a falsy value (like `null`).

|**Key**|**Description**|**Example**|
|-------|---------------|-----------|
| `homepage` | Link to the homepage of your project. | `"https://www.snik.eu/"` |
| `metamodel` | Link to a metamodel of your ontology. | `"https://www.snik.eu/public/SNIK_Metamodell_V10.svg"` |
| `feedbackOntology` | Link to a place where one can submit feedback about your dataset. | `"https://github.com/snikproject/ontology/issues"` |
| `featureRequest` | Link to a place where one can submit a feature request for the graph. | `[too long]` |
| `youtube` | Link to a YouTube channel. | `"https://www.youtube.com/channel/UCV8wbTpOdHurbaHqP0sAOng/featured"` |
| `sparqlEndpoint` | User-facing SPARQL endpoint. | `"https://www.snik.eu/sparql"` |
| `rdfBrowser` | RDF browser (e.g. RickView) instance for your ontology. | `"https://www.snik.eu/ontology` |

##### Style your own ontology

Nodes can be individually styled by shape and color.
Expand Down
20 changes: 10 additions & 10 deletions js/browser/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ export class Menu {
{
i18n: "services",
entries: [
{ action: "http://www.snik.eu/sparql", i18n: "sparql-endpoint" },
{ action: "http://www.snik.eu/ontology", i18n: "rdf-browser" },
config.ontology.links.sparqlEndpoint ? { action: config.ontology.links.sparqlEndpoint, i18n: "sparql-endpoint" } : null,
config.ontology.links.rdfBrowser ? { action: config.ontology.links.rdfBrowser, i18n: "rdf-browser" } : null,
//["http://snik.eu/evaluation","Data Quality Evaluation","data-quality-evaluation"],
],
},
Expand All @@ -315,17 +315,14 @@ export class Menu {
//{action: "https://www.snik.eu/sites/www.snik.eu/files/files/uploads/Einfuehrung/snik-tutorial.pdf", i18n: "tutorial"}, // todo: fix link and uncomment
{ action: "html/layoutHelp.html", i18n: "layout-help" },
{ action: "doc/index.html", i18n: "developer-doc" },
{ action: "https://www.youtube.com/channel/UCV8wbTpOdHurbaHqP0sAOng/featured", i18n: "youtube-channel" },
config.ontology.links.youtube ? { action: config.ontology.links.youtube, i18n: "youtube-channel" } : null,
{ action: "html/troubleshooting.html", i18n: "troubleshooting" },
{ action: "html/contribute.html", i18n: "contribute" },
{ action: "https://www.snik.eu/", i18n: "project-homepage" },
{ action: "https://www.snik.eu/public/SNIK_Metamodell_V10.svg", i18n: "meta-model" },
config.ontology.links.homepage ? { action: config.ontology.links.homepage, i18n: "project-homepage" } : null,
config.ontology.links.metamodel ? { action: config.ontology.links.metamodel, i18n: "meta-model" } : null,
{ action: Menu.about, i18n: "about" },
{ action: "https://github.com/snikproject/ontology/issues", i18n: "feedback-ontology" },
{
action: "https://github.com/snikproject/graph/issues/new?assignees=KonradHoeffner&labels=feature&projects=&template=featurerequest.yml",
i18n: "feature-request",
},
config.ontology.links.feedbackOntology ? { action: config.ontology.links.feedbackOntology, i18n: "feedback-ontology" } : null,
config.ontology.links.featureRequest ? { action: config.ontology.links.featureRequest, i18n: "feature-request" } : null,
{ action: util.createGitHubBugReportIssue, i18n: "bug-report" },
],
},
Expand Down Expand Up @@ -453,6 +450,9 @@ export class Menu {
const as: Array<HTMLAnchorElement> = [];
aas.push(as);
for (const entry of menuElement.entries) {
if (entry === null) {
continue;
}
const a = document.createElement("a");
as.push(a);
a.classList.add("dropdown-entry");
Expand Down
9 changes: 9 additions & 0 deletions js/config/config.hito.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ export default {
name: "HITO",
initialView: hitoView,
snik: null,
links: {
homepage: "https://www.hitontology.eu/",
metamodel: "https://www.hitontology.eu/public/2024-05-hito_diagram.svg",
feedbackOntology: "https://github.com/hitontology/ontology/issues",
featureRequest: "https://github.com/snikproject/graph/issues/new?assignees=KonradHoeffner&labels=feature&projects=&template=featurerequest.yml",
youtube: null,
sparqlEndpoint: "http://www.hitontology.eu/sparql",
rdfBrowser: "http://www.hitontology.eu/ontology",
},
style: {
/**
* Finds out which shape to use for any specific node using a map (Citation => rectangle, Classified => ellipse, Catalogue => triangle).
Expand Down
9 changes: 9 additions & 0 deletions js/config/config.snik.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ export default {
center: "http://www.snik.eu/ontology/bb/ChiefInformationOfficer", // center node for initial star, only used when there is no initial view
centerDepth: 1, // number of successive star operations on all visible nodes, starting with center
},
links: {
homepage: "https://www.snik.eu/",
metamodel: "https://www.snik.eu/public/SNIK_Metamodell_V10.svg",
feedbackOntology: "https://github.com/snikproject/ontology/issues",
featureRequest: "https://github.com/snikproject/graph/issues/new?assignees=KonradHoeffner&labels=feature&projects=&template=featurerequest.yml",
youtube: "https://www.youtube.com/channel/UCV8wbTpOdHurbaHqP0sAOng/featured",
sparqlEndpoint: "http://www.hitontology.eu/sparql",
rdfBrowser: "http://www.hitontology.eu/ontology",
},
style: {
shape: (node: NodeSingular) => shapeMap.get(node.data(NODE.SUBTOP)) || shapeMap.get(node.data(NODE.ID)) || "hexagon",
color: (node: string | NodeSingular) => {
Expand Down

0 comments on commit 22670fd

Please sign in to comment.