Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate typescript artifacts containing constants representing RDF vocab terms. #1029

Open
MichelSc opened this issue Oct 11, 2024 · 1 comment

Comments

@MichelSc
Copy link

MichelSc commented Oct 11, 2024

Seems the same issue as #10, but here for typescript

Describe the bug

Generate VocabTerms with labels and comments for iris other than classes or properties NOT working

To Reproduce

Use this vocabulary:

prd:levelVeryVeryHigh rdf:type inrupt_gen:ConstantIri ;
    rdfs:label "Very very high"@en ;
    rdfs:comment "Level very very high"@en ;
    skos:definition "http://mydomain/mypath" .    

Steps to reproduce the behavior:

  1. use following generator configuration
artifactName: vocab-bikeds
artifactGeneratorVersion: 4.0.0
artifactToGenerate:
  - programmingLanguage: TypeScript
    artifactVersion: "2.0.0"
    artifactNamePrefix: ""
    artifactNameSuffix: ""
    artifactDirectoryName: "src"
    sourceFileExtension: ts
    solidCommonVocabVersion: "^1.4.0"
    rdfjsTypesVersion: "^1.0.1"
    rdfjsImplVersion: "^1.1.0"
    supportBundling: false
    templateInternal: solidCommonVocabDependent/typescript/rdfjsRdfDataFactory/vocab.hbs

Observed behavior

I get following code generated:

  /**
   * Level very very high
   *
   * The term has a description only in English, with [1] label in the language [en], but [2] comments in languages [NoLocale, en] (so the difference is only between English and NoLocale, which we consider the same).
   */
  levelVeryVeryHigh: _NS("http://mydomain/mypath"),

NOK: labels and comments are missing

NOK: the generator crashes if the skos:definition is no valid URL

NOK: the IRI is not in the generated NamedNode

Expected behavior
The following code generated

  levelVeryVeryHigh: new _VocabTerm(
    _NS("levelVeryVeryHigh"),
    _rdfFactory,
    getLocalStore(),
    false
  )
    .addLabel(`Very very high`, "en")
    .addComment(`Level very very high`, "en");
@NSeydoux
Copy link
Contributor

Hi @MichelSc , thanks for reaching out. I'll put a ticket in our backlog to fix this, but unfortunately the artifact generator is not a very high priority for us right now, so this may not be addressed in the near future. I'm happy to assist if you want to go in the code and try and implement the fix though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants