Skip to content

Typescript generated types #7

@ships

Description

@ships

Several Docmaps stakeholders are interested in structuring and destructuring docmaps programmatically for their own bespoke storage models. To enable these users, it would help to have a utility library in some typed language that allows modern developer productivity. The obvious choice is TypeScript.

This issue/thread can serve as a record of related tooling that might be useable or cannibalizeable for this purpose.

From my initial investigation, it seems that there are a few tools that generate Typescript from ontologies directly, though I haven't yet got any to work due to various limitations:

  • schema-dts-gen , which has a limitation of assuming that the ontology and jsonld-context are directly compatible with schema.org
  • on2ts, seems very general, but code is old and the author seems to have abandoned it.
  • rdf-tools, nice and generic, but seemingly does not support following links to other ontologies for types that are relied on. (Possibly we can just concatenate ontology files to make what we need here.)

Additionally, we could start to interface with GraphQL and not just RDF stores, and convert to graphql and pipe into the highly maintained graphql-codegen . Since graphql is strictly smaller than the RDF spec in general, this would introduce some assumed limitations. However, given that true RDF is itself more general than any strong type system, maybe this is of no practical significance (ie., this pathway seems to generate deeply Maybeful types, which are indeed simple realities of an RDF graph which does not guarantee much in the way of completion).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions