lincd-cli 0.1.4 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -373
- package/README.md +24 -24
- package/defaults/app/index.html +12 -0
- package/defaults/app/package.json +30 -0
- package/defaults/app/src/App.tsx +5 -0
- package/defaults/app/src/index.tsx +10 -0
- package/defaults/create_migration.ts +3 -3
- package/defaults/defaultModule/Index.scss +16 -16
- package/defaults/defaultModule/Index.tsx +31 -24
- package/defaults/defaultModule/data.json +54 -54
- package/defaults/defaultModule/defaultOntology.json +21 -21
- package/defaults/defaultModule/index.ts +16 -12
- package/defaults/defaultModule/ontology.ts +18 -15
- package/defaults/gitignorefile +3 -3
- package/defaults/index.ts +17 -13
- package/defaults/module/package.json +30 -29
- package/defaults/module/src/components/ExampleComponent.tsx +10 -14
- package/defaults/module/src/data/example-ontology.json +18 -18
- package/defaults/module/src/module.ts +3 -8
- package/defaults/module/src/ontologies/example-ontology.ts +8 -10
- package/defaults/module/src/shapes/ExampleShapeClass.ts +20 -21
- package/defaults/ontology.ts +18 -15
- package/defaults/package.json +28 -28
- package/defaults/site/package.json +38 -38
- package/defaults/site/storage/filestores/settings-production-template.jsonld +128 -128
- package/defaults/site/web/.htaccess +19 -19
- package/lib/cli.js +332 -258
- package/lib/config-grunt.js +39 -45
- package/lib/config-webpack.js +34 -39
- package/lib/index.js +5 -1
- package/lib/plugins/declaration-plugin.js +22 -64
- package/lib/plugins/externalise-modules.js +23 -13
- package/lib/plugins/watch-run.js +1 -1
- package/lib/utils.js +7 -3
- package/package.json +76 -72
- package/defaults/.npmignore +0 -11
- package/defaults/Gruntfile.js +0 -16
- package/defaults/module/Gruntfile.js +0 -16
- package/defaults/module/tsconfig-es5.json +0 -19
- package/defaults/module/tsconfig.json +0 -19
- package/defaults/site/.gitignore +0 -8
- package/defaults/site/.npmignore +0 -10
- package/defaults/site/lib/start-server.js +0 -22
- package/defaults/site/lib/test-server.js +0 -10
- package/defaults/site/storage/filestores/settings-development.jsonld +0 -117
- package/defaults/tsconfig-es5.json +0 -18
- package/defaults/tsconfig.json +0 -20
package/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
#LINCD CLI
|
|
2
|
-
Command Line Interface for the [lincd.js](https://www.lincd.org) library
|
|
3
|
-
|
|
4
|
-
### Installation
|
|
5
|
-
|
|
6
|
-
```
|
|
7
|
-
npm install lincd-cli
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
or
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
yarn add lincd-cli
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
### Usage
|
|
17
|
-
|
|
18
|
-
type
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
npm exec lincd help
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
for available commands
|
|
1
|
+
#LINCD CLI
|
|
2
|
+
Command Line Interface for the [lincd.js](https://www.lincd.org) library
|
|
3
|
+
|
|
4
|
+
### Installation
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
npm install lincd-cli
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
or
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
yarn add lincd-cli
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Usage
|
|
17
|
+
|
|
18
|
+
type
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
npm exec lincd help
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
for available commands
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<link rel="stylesheet" type="text/css" href="./dist/${app_name}.css">
|
|
6
|
+
<title>${app_name}</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script src="./dist/${app_name}.js"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "${app_name}",
|
|
3
|
+
"displayName": "${app_name}",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "",
|
|
6
|
+
"lincd": true,
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"types": "dist/${app_name}.d.ts",
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "npm exec lincd build",
|
|
13
|
+
"dev": "npm exec lincd dev",
|
|
14
|
+
"prepublishOnly": "npm exec lincd build production",
|
|
15
|
+
"postpublish": "npm exec lincd publish"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"lincd",
|
|
19
|
+
"linked data",
|
|
20
|
+
"interoperable",
|
|
21
|
+
"semantic web",
|
|
22
|
+
"web3"
|
|
23
|
+
],
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"lincd": "^0.2"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"lincd-cli": "^0.1"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {createRoot} from 'react-dom/client';
|
|
3
|
+
import {App} from './App';
|
|
4
|
+
|
|
5
|
+
declare var document;
|
|
6
|
+
if (typeof document !== 'undefined') {
|
|
7
|
+
const container = document.getElementById('root');
|
|
8
|
+
const root = createRoot(container!);
|
|
9
|
+
root.render(<App></App>);
|
|
10
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
.Index {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
width: 80%;
|
|
3
|
+
max-width: 44rem;
|
|
4
|
+
padding: 7rem 4rem 3rem;
|
|
5
|
+
margin: 58px auto !important;
|
|
6
|
+
box-shadow: 0px 0px 36px #50625055;
|
|
7
|
+
border-radius: 10px;
|
|
8
|
+
font-family: monospace;
|
|
9
|
+
font-size: 15px;
|
|
10
|
+
background: url(https://www.dacore.org/img/logo@2x.png) top right no-repeat;
|
|
11
|
+
background-size: 240px;
|
|
12
|
+
background-position-y: 26px;
|
|
13
|
+
background-position-x: center;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
code {
|
|
16
|
+
padding: 2px 4px;
|
|
17
|
+
background-color: #eee;
|
|
18
|
+
}
|
|
19
19
|
}
|
|
@@ -1,25 +1,32 @@
|
|
|
1
|
-
import {React,ReactComponent} from "@dacore/core/lib/shapes/ReactComponent";
|
|
2
|
-
import {UriResource} from "@dacore/core/lib/models";
|
|
3
|
-
import
|
|
4
|
-
import "./Index.scss";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { React,ReactComponent } from "@dacore/core/lib/shapes/ReactComponent";
|
|
2
|
+
import { UriResource } from "@dacore/core/lib/models";
|
|
3
|
+
import "./Index.scss";
|
|
4
|
+
import style from "./Index.scss.json";
|
|
5
|
+
import ${projectName} from "../ontologies/${projectName}";
|
|
6
|
+
|
|
7
|
+
export default class Index extends ReactComponent<any,any>
|
|
8
|
+
{
|
|
9
|
+
static viewType: UriResource = ${projectName}
|
|
10
|
+
.
|
|
11
|
+
Index;
|
|
12
|
+
|
|
13
|
+
render()
|
|
14
|
+
{
|
|
15
|
+
return <div className={style.Index}>
|
|
16
|
+
<hr />
|
|
17
|
+
<p>Welcome to your new LINCD setup!</p>
|
|
18
|
+
<p>
|
|
19
|
+
To start coding:
|
|
20
|
+
<ul>
|
|
21
|
+
<li>Go to <code>/modules/${browserTitle}</code> and run <code>yarn lincd dev</code> to start developing your
|
|
22
|
+
module
|
|
23
|
+
</li>
|
|
24
|
+
<li>Open <code>modules/${browserTitle}/src/views/Index.tsx</code> to edit this page.</li>
|
|
25
|
+
<li>For pages rendered on the initial page request you currently have to restart the server and refresh the
|
|
26
|
+
page to see the results (for others you can simply refresh)
|
|
27
|
+
</li>
|
|
28
|
+
</ul>
|
|
29
|
+
</p>
|
|
30
|
+
</div>;
|
|
31
|
+
}
|
|
25
32
|
}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
2
|
+
"@context": {
|
|
3
|
+
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
|
4
|
+
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
|
|
5
|
+
"module": "http://data.dacore.org/ontologies/module/",
|
|
6
|
+
"core": "http://data.dacore.org/ontologies/core/",
|
|
7
|
+
"oc": "http://data.dacore.org/ontologies/oc/",
|
|
8
|
+
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
9
|
+
"router": "http://data.dacore.org/ontologies/router/",
|
|
10
|
+
"node-core": "http://data.dacore.org/ontologies/node-core/",
|
|
11
|
+
"mysite": "http://data.mysite.com/ontology/mysite/",
|
|
12
|
+
"admin": "http://data.dacore.org/ontologies/admin/",
|
|
13
|
+
"html": "http://data.dacore.org/ontologies/html/"
|
|
14
|
+
},
|
|
15
|
+
"@graph": [
|
|
16
|
+
{
|
|
17
|
+
"@id": "${defaultModuleUri}",
|
|
18
|
+
"@type": "module:Module",
|
|
19
|
+
"module:maintainsOntology": {
|
|
20
|
+
"@id": "${defaultOntologyUri}"
|
|
21
|
+
},
|
|
22
|
+
"module:npmPath": "@dacore/${projectName}",
|
|
23
|
+
"rdfs:label": "${projectName}"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"@id": "${uriBase}/moduledatastore/${projectName}",
|
|
27
|
+
"@type": "node-core:ModuleDataStore",
|
|
28
|
+
"module:module": {
|
|
29
|
+
"@id": "${defaultModuleUri}"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"@id": "${uriBase}/route//",
|
|
34
|
+
"@type": "router:Route",
|
|
35
|
+
"core:viewType": {
|
|
36
|
+
"@id": "${defaultOntologyUri}Index"
|
|
37
|
+
},
|
|
38
|
+
"router:exact": {
|
|
39
|
+
"@type": "xsd:boolean",
|
|
40
|
+
"@value": "true"
|
|
41
|
+
},
|
|
42
|
+
"router:path": "/"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"@id": "${uriBase}/route//console",
|
|
46
|
+
"@type": "router:Route",
|
|
47
|
+
"core:viewType": {
|
|
48
|
+
"@id": "admin:AdminOverview"
|
|
49
|
+
},
|
|
50
|
+
"router:layout": {
|
|
51
|
+
"@id": "admin:AdminOverview"
|
|
52
|
+
},
|
|
53
|
+
"router:path": "/console"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
56
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
"@context": {
|
|
3
|
+
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
|
4
|
+
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
|
|
5
|
+
"core": "http://data.dacore.org/ontologies/core/",
|
|
6
|
+
"${projectName}": "${defaultOntologyUri}"
|
|
7
|
+
},
|
|
8
|
+
"@graph": [
|
|
9
|
+
{
|
|
10
|
+
"@id": "${defaultOntologyUri}",
|
|
11
|
+
"@type": "http://www.w3.org/2002/07/owl#Ontology",
|
|
12
|
+
"core:suggestedPrefix": "${projectName}"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"@id": "${projectName}:Index",
|
|
16
|
+
"@type": "core:ViewType",
|
|
17
|
+
"rdfs:isDefinedBy": {
|
|
18
|
+
"@id": "${defaultOntologyUri}"
|
|
19
|
+
},
|
|
20
|
+
"rdfs:label": "Index"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
23
|
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import {Core} from "@dacore/core/lib/shapes/Core";
|
|
2
|
-
import {UriResource} from "@dacore/core/lib/models";
|
|
3
|
-
import {JSONLD} from "@dacore/core/lib/utils/JSONLD";
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { Core } from "@dacore/core/lib/shapes/Core";
|
|
2
|
+
import { UriResource } from "@dacore/core/lib/models";
|
|
3
|
+
import { JSONLD } from "@dacore/core/lib/utils/JSONLD";
|
|
4
|
+
import * as Index from "./views/Index";
|
|
5
|
+
import * as ${underscore_ontology_name} from
|
|
6
|
+
|
|
7
|
+
"./ontologies/${ontology_name}";
|
|
8
|
+
|
|
9
|
+
declare var require: any;
|
|
10
|
+
var _dataPromise = JSONLD.parse(require("../data/data.json"),true,true) as Promise<any>;
|
|
11
|
+
|
|
12
|
+
var moduleResource: UriResource = UriResource.getOrCreate("${uri_base}/module/${module_name}");
|
|
13
|
+
Core.app().registerModule("${module_name}",this,moduleResource,_dataPromise,[${underscore_ontology_name}._parsePromise
|
|
14
|
+
])
|
|
15
|
+
;
|
|
16
|
+
export {${underscore_ontology_name},Index };
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {UriResource} from "@dacore/core/lib/models";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { UriResource } from "@dacore/core/lib/models";
|
|
2
|
+
import { JSONLD } from "@dacore/core/lib/utils/JSONLD";
|
|
3
|
+
|
|
4
|
+
declare var require: any;
|
|
5
|
+
|
|
6
|
+
var base: string = "${uri_base}/ontology/${ontology_name}/";
|
|
7
|
+
export var _ontologyResource: UriResource = UriResource.getOrCreate(base);
|
|
8
|
+
|
|
9
|
+
var json = require("../../data/ontologies/${ontology_name}.json");
|
|
10
|
+
export var _parsePromise: [UriResource,Promise<any>] = [_ontologyResource,JSONLD.parse(json,true,true) as Promise<any>];
|
|
11
|
+
|
|
12
|
+
//add your ontology resources here
|
|
13
|
+
export var Index: UriResource = UriResource.getOrCreate(base + "Index");
|
|
14
|
+
|
|
15
|
+
//make sure every node is also exported here
|
|
16
|
+
var ${camel_ontology_name} =;
|
|
17
|
+
{Index;}
|
|
18
|
+
;
|
|
16
19
|
export default ${camel_ontology_name};
|
package/defaults/gitignorefile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
**/node_modules
|
|
2
|
-
.idea
|
|
3
|
-
lib
|
|
1
|
+
**/node_modules
|
|
2
|
+
.idea
|
|
3
|
+
lib
|
|
4
4
|
builds
|
package/defaults/index.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {Core} from "@dacore/core/lib/shapes/Core";
|
|
2
|
-
import {UriResource} from "@dacore/core/lib/models";
|
|
3
|
-
import {JSONLD} from "@dacore/core/lib/utils/JSONLD";
|
|
4
|
-
import * as ${underscore_ontology_name} from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { Core } from "@dacore/core/lib/shapes/Core";
|
|
2
|
+
import { UriResource } from "@dacore/core/lib/models";
|
|
3
|
+
import { JSONLD } from "@dacore/core/lib/utils/JSONLD";
|
|
4
|
+
import * as ${underscore_ontology_name} from
|
|
5
|
+
|
|
6
|
+
"./ontologies/${ontology_name}";
|
|
7
|
+
//import * as viewName from "./views/viewName"
|
|
8
|
+
//import * as typeName from "./shapes/typeName"
|
|
9
|
+
|
|
10
|
+
declare var require: any;
|
|
11
|
+
var _dataPromise = JSONLD.parse(require("../data/data.json"),true,true) as Promise<any>;
|
|
12
|
+
|
|
13
|
+
var moduleResource: UriResource = UriResource.getOrCreate("${uri_base}/module/${module_name}");
|
|
14
|
+
Core.app().registerModule("${module_name}",this,moduleResource,_dataPromise,[${underscore_ontology_name}._parsePromise
|
|
15
|
+
])
|
|
16
|
+
;
|
|
17
|
+
export {${underscore_ontology_name} };
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "${module_name}",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "${module_name}",
|
|
3
|
+
"displayName": "${module_name}",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "",
|
|
6
|
+
"lincd": true,
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"types": "dist/${module_name}.d.ts",
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "npm exec lincd build",
|
|
13
|
+
"dev": "npm exec lincd dev",
|
|
14
|
+
"prepublishOnly": "npm exec lincd build production",
|
|
15
|
+
"postpublish": "npm exec lincd publish"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"lincd",
|
|
19
|
+
"linked data",
|
|
20
|
+
"interoperable",
|
|
21
|
+
"semantic web",
|
|
22
|
+
"web3"
|
|
23
|
+
],
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"lincd": "^0.2"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"lincd-cli": "^0.1"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import {ReactComponent} from
|
|
3
|
-
import {ExampleShapeClass} from
|
|
4
|
-
import {linkedComponent} from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ReactComponent } from "lincd/lib/shapes/ReactComponent";
|
|
3
|
+
import { ExampleShapeClass } from "../shapes/ExampleShapeClass";
|
|
4
|
+
import { linkedComponent } from "../module";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* By linking this component to a Shape class (a class that extends Shape) you ensure this.source will be an instance of that class
|
|
8
8
|
*/
|
|
9
9
|
@linkedComponent(ExampleShapeClass)
|
|
10
10
|
//for correct typings, please provide the same class as third type parameter of ReactComponent, after property & state interfaces
|
|
11
|
-
export class ExampleComponent extends ReactComponent<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
ExampleShapeClass
|
|
15
|
-
> {
|
|
16
|
-
render() {
|
|
17
|
-
let exampleInstance = this.source;
|
|
11
|
+
export class ExampleComponent extends ReactComponent<any, any, ExampleShapeClass> {
|
|
12
|
+
render() {
|
|
13
|
+
let exampleInstance = this.sourceShape;
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
//get the name of this item from the graph
|
|
16
|
+
return <h1>Hello {exampleInstance.name}!</h1>;
|
|
17
|
+
}
|
|
22
18
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
"@context": {
|
|
3
|
+
"dc": "http://purl.org/dc/elements/1.1/",
|
|
4
|
+
"owl": "http://www.w3.org/2002/07/owl#",
|
|
5
|
+
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
|
6
|
+
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
|
|
7
|
+
"test": "http://www.example.com/"
|
|
8
|
+
},
|
|
9
|
+
"@graph": [
|
|
10
|
+
{
|
|
11
|
+
"@id": "example:ExampleClass",
|
|
12
|
+
"@type": "rdfs:Class",
|
|
13
|
+
"rdfs:comment": "This is an example class. You can remove or rename it",
|
|
14
|
+
"rdfs:isDefinedBy": {
|
|
15
|
+
"@id": "example:"
|
|
16
|
+
},
|
|
17
|
+
"rdfs:label": "Example Class"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
20
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import {linkedModule} from 'lincd/lib/utils/Module';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
linkedUtil,
|
|
6
|
-
linkedOntology,
|
|
7
|
-
registerModuleExport,
|
|
8
|
-
moduleExports,
|
|
9
|
-
} = linkedModule('${module_name}');
|
|
2
|
+
|
|
3
|
+
export const {linkedComponent, linkedShape, linkedUtil, linkedOntology, registerModuleExport, moduleExports} =
|
|
4
|
+
linkedModule('${module_name}');
|