-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vocab tests updated for new package labels, and TS templates fixed (#348
- Loading branch information
Showing
3 changed files
with
81 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
154 changes: 78 additions & 76 deletions
154
templates/rdfLibraryDependent/typescript/rdfext/vocab.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,78 @@ | ||
{{#if license/header}} | ||
{{license/header}} | ||
|
||
{{/if}} | ||
const namespace = require("@rdfjs/namespace"); | ||
|
||
/** | ||
Generated by artifact generator [{{generatorName}}], version [{{artifactGeneratorVersion}}] | ||
as part of artifact: [{{artifactName}}], version: [{{artifactVersion}}] | ||
at '{{generatedTimestamp}}'. | ||
|
||
{{sourceRdfResources}} | ||
{{#if description}} | ||
|
||
{{{description}}} | ||
{{/if}} | ||
*/ | ||
|
||
const RDFJS_NAMESPACE = namespace("{{namespace}}"); | ||
|
||
const _NAMESPACE = "{{namespace}}"; | ||
function _NS (localName) { | ||
return (_NAMESPACE + localName); | ||
} | ||
|
||
const {{vocabNameUpperCase}} = { | ||
PREFIX: "{{vocabPrefix}}", | ||
NAMESPACE: _NAMESPACE, | ||
PREFIX_AND_NAMESPACE: { "{{vocabPrefix}}": "{{namespace}}" }, | ||
NS: _NS, | ||
|
||
{{#if classes}} | ||
// ***************** | ||
// All the Classes. | ||
// ***************** | ||
{{#each classes}} | ||
|
||
/** | ||
*{{#if comment}} {{{comment}}}{{/if}} | ||
*/ | ||
{{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), | ||
{{/each}} | ||
{{/if}} | ||
|
||
{{#if properties}} | ||
// ******************* | ||
// All the Properties. | ||
// ******************* | ||
{{#each properties}} | ||
|
||
/** | ||
*{{#if comment}} {{{comment}}}{{/if}} | ||
*/ | ||
{{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), | ||
{{/each}} | ||
{{/if}} | ||
|
||
{{#if literals}} | ||
// ******************* | ||
// All the Literals. | ||
// ******************* | ||
{{#each literals}} | ||
|
||
/** | ||
*{{#if comment}} {{{comment}}}{{/if}} | ||
*/ | ||
{{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), | ||
{{/each}} | ||
{{/if}} | ||
// | ||
// Marker allowing us put commas at the end of all lines above (only the last line does not have a comma). | ||
// | ||
END_OF_VOCAB: "End of vocab." | ||
} | ||
|
||
module.exports = {{vocabNameUpperCase}}; | ||
{{#if license/header}} | ||
{{license/header}} | ||
|
||
{{/if}} | ||
import namespace from "@rdfjs/namespace"; | ||
|
||
/** | ||
Generated by artifact generator [{{generatorName}}], version [{{artifactGeneratorVersion}}] | ||
as part of artifact: [{{artifactName}}], version: [{{artifactVersion}}] | ||
at '{{generatedTimestamp}}'. | ||
|
||
{{sourceRdfResources}} | ||
{{#if description}} | ||
|
||
{{{description}}} | ||
{{/if}} | ||
*/ | ||
|
||
const RDFJS_NAMESPACE = namespace("{{namespace}}"); | ||
|
||
const _NAMESPACE = "{{namespace}}"; | ||
function _NS (localName: string) { | ||
return (_NAMESPACE + localName); | ||
} | ||
|
||
const {{vocabNameUpperCase}} = { | ||
PREFIX: "{{vocabPrefix}}", | ||
NAMESPACE: _NAMESPACE, | ||
PREFIX_AND_NAMESPACE: { "{{vocabPrefix}}": "{{namespace}}" }, | ||
NS: _NS, | ||
|
||
{{#if classes}} | ||
// ***************** | ||
// All the Classes. | ||
// ***************** | ||
{{#each classes}} | ||
|
||
/** | ||
*{{#if comment}} {{{comment}}}{{/if}}{{#if isDefinedBy}} | ||
* | ||
* Defined by the vocabulary: {{isDefinedBy}}{{/if}} | ||
*/ | ||
{{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), | ||
{{/each}} | ||
{{/if}} | ||
|
||
{{#if properties}} | ||
// ******************* | ||
// All the Properties. | ||
// ******************* | ||
{{#each properties}} | ||
|
||
/** | ||
*{{#if comment}} {{{comment}}}{{/if}}{{#if isDefinedBy}} | ||
* | ||
* Defined by the vocabulary: {{isDefinedBy}}{{/if}} | ||
*/ | ||
{{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), | ||
{{/each}} | ||
{{/if}} | ||
|
||
{{#if literals}} | ||
// ******************* | ||
// All the Literals. | ||
// ******************* | ||
{{#each literals}} | ||
|
||
/** | ||
*{{#if comment}} {{{comment}}}{{/if}}{{#if isDefinedBy}} | ||
* | ||
* Defined by the vocabulary: {{isDefinedBy}}{{/if}} | ||
*/ | ||
{{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), | ||
{{/each}} | ||
{{/if}} | ||
}; | ||
|
||
export { {{vocabNameUpperCase}} }; |