l0vecraft / shex-codegen Goto Github PK
View Code? Open in Web Editor NEWGenerate typescript code from shex
License: MIT License
Generate typescript code from shex
License: MIT License
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
@babel/preset-env
, @babel/preset-typescript
)fs-extra
, @types/fs-extra
)These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@types/jest
, jest
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
).github/workflows/jest.yml
actions/checkout v2
actions/setup-node v2
actions/cache v2
package.json
@shexjs/visitor ^1.0.0-alpha.25
@shexjs/parser ^1.0.0-alpha.25
@types/shexj ^2.1.0
camelcase ^6.2.0
chalk ^4.1.0
findit ^2.0.0
fs-extra ^10.0.0
js-yaml ^4.0.0
nodemon ^2.0.7
own-namespace ^0.4.5
prettier ^2.2.1
@babel/preset-env 7.16.7
@babel/preset-typescript 7.16.7
@types/fs-extra 9.0.13
@types/jest 26.0.24
@types/js-yaml 4.0.5
@types/node 14.18.4
@types/nodemon 1.19.1
@types/prettier 2.4.2
@typescript-eslint/eslint-plugin 4.33.0
@typescript-eslint/parser 4.33.0
concurrently 6.5.1
eslint 7.32.0
eslint-plugin-import 2.25.4
eslint-plugin-prettier 3.4.1
husky 6.0.0
jest 26.6.3
lint-staged 11.2.6
rdflib 2.2.15
rimraf 3.0.2
shex-methods 0.1.21
ts-node 9.1.1
typescript 4.5.4
In Shex Node Constraints specification, a set of expected values is expressed as follows:
PREFIX my: <https://my.example.com/#>
PREFIX ex: <https://my.example.com/ex#>
my:IssueShape {
ex:state [ ex:unassigned ex:assigned ]
}
โ Given the above shex, it is expected that the code-gen produces a field with a singleton attribute with an accepted range of two values.
This is currently not the case.
For the above shex, the code-gen generates the following:
import { NamedNode, Literal } from "rdflib";
import { Shape } from "shex-methods";
export type myExampleCom = {
id: string; // the url of a node of this shape
state: (StateType.Unassigned | StateType.Assigned)[];
};
export type myExampleComCreateArgs = {
id?: string | NamedNode; // the url to match or create the node with e.g. 'https://example.com#this', 'https://example.com/profile/card#me'
state: (StateType.Unassigned | StateType.Assigned)[];
};
export type myExampleComUpdateArgs = Partial<myExampleComCreateArgs>;
export enum StateType {
Unassigned = "https://my.example.com/ex#unassigned",
Assigned = "https://my.example.com/ex#assigned",
}
export enum myExampleComContext {
name = "state",
value = "ex:state",
}
export const exampleShex = `
PREFIX my: <https://my.example.com/#>
PREFIX ex: <https://my.example.com/ex#>
my:IssueShape {
ex:state [ex:unassigned ex:assigned]
}
`;
export const myExampleCom = new Shape<myExampleCom, myExampleComCreateArgs>({
id: "https://my.example.com/#IssueShape",
shape: exampleShex,
context: myExampleComContext,
});
โWe can see that the value generated for state is not a singleton field, but an array of values from the given range.
state: (StateType.Unassigned | StateType.Assigned)[];
The expect shape should have been this.
export type myExampleCom = {
id: string;
state: StateType.Unassigned | StateType.Assigned;
};
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Location: renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: Configuration option packageRules
should be a list (Array)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.