Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

This package has been deprecated

Author message:

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

rdf-to-ts

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.

Keywords

none

install

npm i rdf-to-ts

Downloadsweekly downloads

1

version

0.3.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability