This package has been deprecated

Author message:

WARNING: This project has been renamed to 'rdf-tools'.

rdf-to-ts
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

rdf-to-ts

Generate TypeScript from RDF.

Installation

npm install -g rdf-to-ts

Usage

rdf-to-ts --help
Usage: dist [options] <pattern>

Generate TypeScript from RDF


Options:

  -V, --version          output the version number
  -p, --prefixes         output prefixes
  -i, --iris             output IRIs
  -l, --literals         output literals
  -c, --classes          output classes
  -d, --default-exports  output default exports. Can only be used in combination with other flags
  -D, --debug            output debug information
  -h, --help             output usage information

Example

The following command will output types for all classes explicitly defined in the ontology, as well as an object containing the prefixes and IRIs used by the ontology.

rdf-to-ts example.ttl > example.ts

How does it work?

Classes

In order to construct types for the classes in the ontology we need the following pieces of information for each type:

  • owl:Class: What is the name of the class?
  • rdfs:subClassOf: What are its super-classes?
  • rdfs:domain, rdfs:range, owl:FunctionalProperty: Property names, types and pluralities.

Readme

Keywords

none

Package Sidebar

Install

npm i rdf-to-ts

Weekly Downloads

2

Version

0.3.0

License

MIT

Last publish

Collaborators

  • steffansluis
  • joostverdoorn