ontologyviewer 0.1.0
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 +21 -0
- package/README.ja.md +166 -0
- package/README.md +169 -0
- package/THIRD_PARTY_NOTICES.md +49 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/locale.d.ts +34 -0
- package/dist/locale.d.ts.map +1 -0
- package/dist/meta.json +7246 -0
- package/dist/ontologyviewer.css +211 -0
- package/dist/ontologyviewer.esm.min.mjs +221 -0
- package/dist/ontologyviewer.esm.min.mjs.LEGAL.txt +31 -0
- package/dist/ontologyviewer.esm.min.mjs.map +7 -0
- package/dist/ontologyviewer.esm.mjs +47748 -0
- package/dist/ontologyviewer.esm.mjs.LEGAL.txt +31 -0
- package/dist/ontologyviewer.esm.mjs.map +7 -0
- package/dist/persistence.d.ts +18 -0
- package/dist/persistence.d.ts.map +1 -0
- package/dist/rdf/appearance.d.ts +23 -0
- package/dist/rdf/appearance.d.ts.map +1 -0
- package/dist/rdf/graphModel.d.ts +25 -0
- package/dist/rdf/graphModel.d.ts.map +1 -0
- package/dist/rdf/opExtensions.d.ts +9 -0
- package/dist/rdf/opExtensions.d.ts.map +1 -0
- package/dist/rdf/parser.d.ts +22 -0
- package/dist/rdf/parser.d.ts.map +1 -0
- package/dist/rdf/rdfList.d.ts +6 -0
- package/dist/rdf/rdfList.d.ts.map +1 -0
- package/dist/rdf/schemaModel.d.ts +63 -0
- package/dist/rdf/schemaModel.d.ts.map +1 -0
- package/dist/rdf/vocabulary.d.ts +82 -0
- package/dist/rdf/vocabulary.d.ts.map +1 -0
- package/dist/search.d.ts +11 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/theme.d.ts +6 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/types.d.ts +64 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/viewer.d.ts +3 -0
- package/dist/viewer.d.ts.map +1 -0
- package/dist/viewport.d.ts +8 -0
- package/dist/viewport.d.ts.map +1 -0
- package/package.json +91 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Opt-in, validated layout persistence. */
|
|
2
|
+
import type { ViewMode } from "./types";
|
|
3
|
+
export interface PersistedLayout {
|
|
4
|
+
positions: Record<string, {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}>;
|
|
8
|
+
zoom: number;
|
|
9
|
+
pan: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare function layoutStorageKey(storageKey: string, view: ViewMode): string;
|
|
15
|
+
export declare function saveLayout(storageKey: string, layout: PersistedLayout): void;
|
|
16
|
+
export declare function loadLayout(storageKey: string): PersistedLayout | undefined;
|
|
17
|
+
export declare function clearLayout(storageKey: string): void;
|
|
18
|
+
//# sourceMappingURL=persistence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../src/persistence.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMxC,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/B;AAMD,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAE3E;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAQ5E;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAU1E;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAMpD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Quad } from "n3";
|
|
2
|
+
export declare const COLOR_PALETTE_SIZE = 48;
|
|
3
|
+
export interface RelationalColorEdge {
|
|
4
|
+
source: string;
|
|
5
|
+
target: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RelationalAppearance {
|
|
8
|
+
colorIndex: number;
|
|
9
|
+
groupIndex: number;
|
|
10
|
+
groupCount: number;
|
|
11
|
+
groupSize: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Assigns each entity a hue-wheel position based on graph structure.
|
|
15
|
+
*/
|
|
16
|
+
export declare function assignRelationalAppearance(entityIds: readonly string[], edges: readonly RelationalColorEdge[], paletteSize?: number): Map<string, RelationalAppearance>;
|
|
17
|
+
export declare const DEFAULT_CLASS_ICON = "\uD83D\uDCE6";
|
|
18
|
+
export declare const DEFAULT_SKOS_ICON = "\uD83C\uDFF7\uFE0F";
|
|
19
|
+
export declare const DEFAULT_INFERRED_ICON = "\u2B1C";
|
|
20
|
+
export declare function iconFor(candidateNames: string[], fallback: string): string;
|
|
21
|
+
export declare function iconOverrideFor(quads: Quad[], subjectIri: string): string | undefined;
|
|
22
|
+
export declare function colorOverrideFor(quads: Quad[], subjectIri: string): string | undefined;
|
|
23
|
+
//# sourceMappingURL=appearance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../src/rdf/appearance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAG/B,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,WAAW,GAAE,MAA2B,GACvC,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAiEnC;AAmCD,eAAO,MAAM,kBAAkB,iBAAO,CAAC;AACvC,eAAO,MAAM,iBAAiB,uBAAQ,CAAC;AACvC,eAAO,MAAM,qBAAqB,WAAM,CAAC;AAUzC,wBAAgB,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQ1E;AAmBD,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGrF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGtF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Quad } from "n3";
|
|
2
|
+
export type NodeKind = "class" | "property" | "individual" | "resource" | "literal";
|
|
3
|
+
export interface OntologyNode {
|
|
4
|
+
id: string;
|
|
5
|
+
kind: NodeKind;
|
|
6
|
+
label: string;
|
|
7
|
+
comment?: string;
|
|
8
|
+
isBlankNode: boolean;
|
|
9
|
+
literalValue?: string;
|
|
10
|
+
datatypeIri?: string;
|
|
11
|
+
language?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface OntologyEdge {
|
|
14
|
+
id: string;
|
|
15
|
+
source: string;
|
|
16
|
+
predicate: string;
|
|
17
|
+
predicateLabel: string;
|
|
18
|
+
target: string;
|
|
19
|
+
}
|
|
20
|
+
export interface OntologyGraph {
|
|
21
|
+
nodes: OntologyNode[];
|
|
22
|
+
edges: OntologyEdge[];
|
|
23
|
+
}
|
|
24
|
+
export declare function buildGraphModel(quads: Quad[]): OntologyGraph;
|
|
25
|
+
//# sourceMappingURL=graphModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphModel.d.ts","sourceRoot":"","sources":["../../src/rdf/graphModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,IAAI,CAAC;AAaxC,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC;AAEpF,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,aAAa,CAsD5D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Quad } from "n3";
|
|
2
|
+
/** Falls back to the fragment/last-path-segment of an IRI. */
|
|
3
|
+
export declare function localName(iri: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Finds a literal value for a subject using candidate local-name predicates
|
|
6
|
+
* in the document's own namespace.
|
|
7
|
+
*/
|
|
8
|
+
export declare function findOverrideLiteral(quads: Quad[], subject: string, candidateLocalNames: readonly string[]): string | undefined;
|
|
9
|
+
//# sourceMappingURL=opExtensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opExtensions.d.ts","sourceRoot":"","sources":["../../src/rdf/opExtensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAG/B,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK7C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,SAAS,MAAM,EAAE,GACrC,MAAM,GAAG,SAAS,CAapB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-only Turtle parser using N3.js synchronous API.
|
|
3
|
+
* Does not use Node streams — safe for bundling as an ES module.
|
|
4
|
+
*/
|
|
5
|
+
import * as N3 from "n3";
|
|
6
|
+
export interface ParseError {
|
|
7
|
+
message: string;
|
|
8
|
+
line?: number;
|
|
9
|
+
column?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ParsedTurtle {
|
|
12
|
+
quads: N3.Quad[];
|
|
13
|
+
prefixes: Record<string, string>;
|
|
14
|
+
baseIRI: string;
|
|
15
|
+
errors: ParseError[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parses a Turtle string into RDF/JS quads. Fails closed on errors:
|
|
19
|
+
* if any syntax error is encountered the returned errors array is non-empty.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseTurtle(text: string, baseIRI: string): ParsedTurtle;
|
|
22
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/rdf/parser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAcvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rdfList.d.ts","sourceRoot":"","sources":["../../src/rdf/rdfList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAG5C;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE,CAqCtE"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a class-centric Schema model from parsed Turtle quads.
|
|
3
|
+
* Simplified from the VS Code extension's schemaModel.ts; retains the
|
|
4
|
+
* same structural output (SchemaModel) without editing support.
|
|
5
|
+
*/
|
|
6
|
+
import type { Quad } from "n3";
|
|
7
|
+
export type PropertyType = "string" | "integer" | "decimal" | "double" | "date" | "datetime" | "boolean" | "enum" | "other";
|
|
8
|
+
export type Cardinality = "one-to-one" | "one-to-many" | "many-to-one" | "many-to-many" | "unspecified";
|
|
9
|
+
export type EntityOrigin = "owlClass" | "rdfsClass" | "skosConcept" | "inferred";
|
|
10
|
+
export type RelationKind = "objectProperty" | "subClassOf" | "skosBroader";
|
|
11
|
+
export type Provenance = "declared" | "inferred-union" | "inferred-inverse" | "inferred-restriction" | "inferred-usage" | "default";
|
|
12
|
+
export interface SchemaProperty {
|
|
13
|
+
iri: string;
|
|
14
|
+
name: string;
|
|
15
|
+
type: PropertyType;
|
|
16
|
+
datatypeIri?: string;
|
|
17
|
+
isIdentifier?: boolean;
|
|
18
|
+
unit?: string;
|
|
19
|
+
enumValues?: string[];
|
|
20
|
+
description?: string;
|
|
21
|
+
provenance: Provenance;
|
|
22
|
+
}
|
|
23
|
+
export interface SchemaEntity {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
origin: EntityOrigin;
|
|
28
|
+
properties: SchemaProperty[];
|
|
29
|
+
instanceCount: number;
|
|
30
|
+
icon: string;
|
|
31
|
+
colorIndex: number;
|
|
32
|
+
connectionGroup: {
|
|
33
|
+
index: number;
|
|
34
|
+
count: number;
|
|
35
|
+
size: number;
|
|
36
|
+
};
|
|
37
|
+
colorOverride?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface SchemaRelation {
|
|
40
|
+
id: string;
|
|
41
|
+
iri?: string;
|
|
42
|
+
name: string;
|
|
43
|
+
source: string;
|
|
44
|
+
target: string;
|
|
45
|
+
kind: RelationKind;
|
|
46
|
+
cardinality: Cardinality;
|
|
47
|
+
description?: string;
|
|
48
|
+
inverseOfIri?: string;
|
|
49
|
+
provenance: Provenance;
|
|
50
|
+
}
|
|
51
|
+
export interface SchemaModel {
|
|
52
|
+
title?: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
entities: SchemaEntity[];
|
|
55
|
+
relations: SchemaRelation[];
|
|
56
|
+
isEmpty: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Builds the schema model from quads. This is a simplified version
|
|
60
|
+
* that handles common OWL/RDFS/SKOS patterns for the read-only viewer.
|
|
61
|
+
*/
|
|
62
|
+
export declare function buildSchemaModel(quads: Quad[]): SchemaModel;
|
|
63
|
+
//# sourceMappingURL=schemaModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaModel.d.ts","sourceRoot":"","sources":["../../src/rdf/schemaModel.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAoC/B,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAC5H,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,GAAG,aAAa,CAAC;AACxG,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;AACjF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,YAAY,GAAG,aAAa,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,sBAAsB,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAEpI,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;CAClB;AAkED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,WAAW,CAkO3D"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Known-vocabulary metadata for classifying RDF nodes and providing
|
|
3
|
+
* human-readable labels. Adapted from the parent extension's vocabulary.ts.
|
|
4
|
+
*/
|
|
5
|
+
export declare const RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
|
|
6
|
+
export declare const RDFS = "http://www.w3.org/2000/01/rdf-schema#";
|
|
7
|
+
export declare const OWL = "http://www.w3.org/2002/07/owl#";
|
|
8
|
+
export declare const XSD = "http://www.w3.org/2001/XMLSchema#";
|
|
9
|
+
export declare const SKOS = "http://www.w3.org/2004/02/skos/core#";
|
|
10
|
+
export declare const DCTERMS = "http://purl.org/dc/terms/";
|
|
11
|
+
export declare const FOAF = "http://xmlns.com/foaf/0.1/";
|
|
12
|
+
export declare const WELL_KNOWN_PREFIXES: Record<string, string>;
|
|
13
|
+
export declare const RDF_TYPE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
|
|
14
|
+
export declare const RDFS_LABEL = "http://www.w3.org/2000/01/rdf-schema#label";
|
|
15
|
+
export declare const RDFS_COMMENT = "http://www.w3.org/2000/01/rdf-schema#comment";
|
|
16
|
+
export declare const RDFS_SUBCLASS_OF = "http://www.w3.org/2000/01/rdf-schema#subClassOf";
|
|
17
|
+
export declare const RDFS_SUBPROPERTY_OF = "http://www.w3.org/2000/01/rdf-schema#subPropertyOf";
|
|
18
|
+
export declare const RDFS_DOMAIN = "http://www.w3.org/2000/01/rdf-schema#domain";
|
|
19
|
+
export declare const RDFS_RANGE = "http://www.w3.org/2000/01/rdf-schema#range";
|
|
20
|
+
export declare const RDFS_RESOURCE = "http://www.w3.org/2000/01/rdf-schema#Resource";
|
|
21
|
+
export declare const OWL_CLASS = "http://www.w3.org/2002/07/owl#Class";
|
|
22
|
+
export declare const OWL_OBJECT_PROPERTY = "http://www.w3.org/2002/07/owl#ObjectProperty";
|
|
23
|
+
export declare const OWL_DATATYPE_PROPERTY = "http://www.w3.org/2002/07/owl#DatatypeProperty";
|
|
24
|
+
export declare const OWL_ANNOTATION_PROPERTY = "http://www.w3.org/2002/07/owl#AnnotationProperty";
|
|
25
|
+
export declare const OWL_NAMED_INDIVIDUAL = "http://www.w3.org/2002/07/owl#NamedIndividual";
|
|
26
|
+
export declare const OWL_ONTOLOGY = "http://www.w3.org/2002/07/owl#Ontology";
|
|
27
|
+
export declare const OWL_THING = "http://www.w3.org/2002/07/owl#Thing";
|
|
28
|
+
export declare const OWL_RESTRICTION = "http://www.w3.org/2002/07/owl#Restriction";
|
|
29
|
+
export declare const OWL_UNION_OF = "http://www.w3.org/2002/07/owl#unionOf";
|
|
30
|
+
export declare const OWL_INTERSECTION_OF = "http://www.w3.org/2002/07/owl#intersectionOf";
|
|
31
|
+
export declare const OWL_INVERSE_OF = "http://www.w3.org/2002/07/owl#inverseOf";
|
|
32
|
+
export declare const OWL_FUNCTIONAL_PROPERTY = "http://www.w3.org/2002/07/owl#FunctionalProperty";
|
|
33
|
+
export declare const OWL_INVERSE_FUNCTIONAL_PROPERTY = "http://www.w3.org/2002/07/owl#InverseFunctionalProperty";
|
|
34
|
+
export declare const OWL_ON_PROPERTY = "http://www.w3.org/2002/07/owl#onProperty";
|
|
35
|
+
export declare const OWL_SOME_VALUES_FROM = "http://www.w3.org/2002/07/owl#someValuesFrom";
|
|
36
|
+
export declare const OWL_ALL_VALUES_FROM = "http://www.w3.org/2002/07/owl#allValuesFrom";
|
|
37
|
+
export declare const OWL_HAS_VALUE = "http://www.w3.org/2002/07/owl#hasValue";
|
|
38
|
+
export declare const OWL_EQUIVALENT_CLASS = "http://www.w3.org/2002/07/owl#equivalentClass";
|
|
39
|
+
export declare const OWL_EQUIVALENT_PROPERTY = "http://www.w3.org/2002/07/owl#equivalentProperty";
|
|
40
|
+
export declare const OWL_SAME_AS = "http://www.w3.org/2002/07/owl#sameAs";
|
|
41
|
+
export declare const OWL_DIFFERENT_FROM = "http://www.w3.org/2002/07/owl#differentFrom";
|
|
42
|
+
export declare const OWL_DISJOINT_WITH = "http://www.w3.org/2002/07/owl#disjointWith";
|
|
43
|
+
export declare const OWL_CARDINALITY = "http://www.w3.org/2002/07/owl#cardinality";
|
|
44
|
+
export declare const OWL_MIN_CARDINALITY = "http://www.w3.org/2002/07/owl#minCardinality";
|
|
45
|
+
export declare const OWL_MAX_CARDINALITY = "http://www.w3.org/2002/07/owl#maxCardinality";
|
|
46
|
+
export declare const OWL_QUALIFIED_CARDINALITY = "http://www.w3.org/2002/07/owl#qualifiedCardinality";
|
|
47
|
+
export declare const OWL_MIN_QUALIFIED_CARDINALITY = "http://www.w3.org/2002/07/owl#minQualifiedCardinality";
|
|
48
|
+
export declare const OWL_MAX_QUALIFIED_CARDINALITY = "http://www.w3.org/2002/07/owl#maxQualifiedCardinality";
|
|
49
|
+
export declare const OWL_ON_CLASS = "http://www.w3.org/2002/07/owl#onClass";
|
|
50
|
+
export declare const OWL_HAS_KEY = "http://www.w3.org/2002/07/owl#hasKey";
|
|
51
|
+
export declare const OWL_IMPORTS = "http://www.w3.org/2002/07/owl#imports";
|
|
52
|
+
export declare const OWL_VERSION_IRI = "http://www.w3.org/2002/07/owl#versionIRI";
|
|
53
|
+
export declare const OWL_PRIOR_VERSION = "http://www.w3.org/2002/07/owl#priorVersion";
|
|
54
|
+
export declare const RDFS_SEE_ALSO = "http://www.w3.org/2000/01/rdf-schema#seeAlso";
|
|
55
|
+
export declare const RDFS_IS_DEFINED_BY = "http://www.w3.org/2000/01/rdf-schema#isDefinedBy";
|
|
56
|
+
export declare const RDFS_CLASS = "http://www.w3.org/2000/01/rdf-schema#Class";
|
|
57
|
+
export declare const RDF_PROPERTY = "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property";
|
|
58
|
+
export declare const RDF_FIRST = "http://www.w3.org/1999/02/22-rdf-syntax-ns#first";
|
|
59
|
+
export declare const RDF_REST = "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";
|
|
60
|
+
export declare const RDF_NIL = "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil";
|
|
61
|
+
export declare const SKOS_CONCEPT = "http://www.w3.org/2004/02/skos/core#Concept";
|
|
62
|
+
export declare const SKOS_CONCEPT_SCHEME = "http://www.w3.org/2004/02/skos/core#ConceptScheme";
|
|
63
|
+
export declare const SKOS_BROADER = "http://www.w3.org/2004/02/skos/core#broader";
|
|
64
|
+
export declare const SKOS_NARROWER = "http://www.w3.org/2004/02/skos/core#narrower";
|
|
65
|
+
export declare const SKOS_RELATED = "http://www.w3.org/2004/02/skos/core#related";
|
|
66
|
+
export declare const SKOS_PREF_LABEL = "http://www.w3.org/2004/02/skos/core#prefLabel";
|
|
67
|
+
export declare const SKOS_ALT_LABEL = "http://www.w3.org/2004/02/skos/core#altLabel";
|
|
68
|
+
export declare const SKOS_IN_SCHEME = "http://www.w3.org/2004/02/skos/core#inScheme";
|
|
69
|
+
export interface VocabularyTerm {
|
|
70
|
+
iri: string;
|
|
71
|
+
prefix: string;
|
|
72
|
+
local: string;
|
|
73
|
+
label: string;
|
|
74
|
+
comment: string;
|
|
75
|
+
}
|
|
76
|
+
export declare const KNOWN_TERMS: VocabularyTerm[];
|
|
77
|
+
export declare function lookupKnownTerm(iri: string): VocabularyTerm | undefined;
|
|
78
|
+
export declare function isClassTypeIri(iri: string): boolean;
|
|
79
|
+
export declare function isPropertyTypeIri(iri: string): boolean;
|
|
80
|
+
export declare const KNOWN_VOCABULARY_NAMESPACES: string[];
|
|
81
|
+
export declare function isKnownVocabularyIri(iri: string): boolean;
|
|
82
|
+
//# sourceMappingURL=vocabulary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../../src/rdf/vocabulary.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,GAAG,gDAAgD,CAAC;AACjE,eAAO,MAAM,IAAI,0CAA0C,CAAC;AAC5D,eAAO,MAAM,GAAG,mCAAmC,CAAC;AACpD,eAAO,MAAM,GAAG,sCAAsC,CAAC;AACvD,eAAO,MAAM,IAAI,yCAAyC,CAAC;AAC3D,eAAO,MAAM,OAAO,8BAA8B,CAAC;AACnD,eAAO,MAAM,IAAI,+BAA+B,CAAC;AAEjD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQtD,CAAC;AAEF,eAAO,MAAM,QAAQ,oDAAe,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AC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEvE;AAUD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,eAAO,MAAM,2BAA2B,UAA6C,CAAC;AAEtF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzD"}
|
package/dist/search.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SchemaModel } from "./rdf/schemaModel";
|
|
2
|
+
export type SearchResultKind = "entity" | "relation" | "property";
|
|
3
|
+
export interface SearchResult {
|
|
4
|
+
id: string;
|
|
5
|
+
kind: SearchResultKind;
|
|
6
|
+
label: string;
|
|
7
|
+
meta: string;
|
|
8
|
+
ownerId?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function searchSchema(schema: SchemaModel, rawQuery: string, limit?: number): SearchResult[];
|
|
11
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAqBD,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,YAAY,EAAE,CAoD7F"}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type Theme = "auto" | "light" | "dark";
|
|
2
|
+
export declare function isDarkTheme(theme: Theme): boolean;
|
|
3
|
+
export declare function paletteColorFor(colorIndex: number, paletteSize?: number, dark?: boolean): string;
|
|
4
|
+
export declare function paletteSurfaceFor(colorIndex: number, paletteSize?: number, dark?: boolean): string;
|
|
5
|
+
export declare function accessibleTextColor(background: string, canvasBackground?: string): "#000000" | "#ffffff";
|
|
6
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9C,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAKjD;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,GAAE,MAA2B,EAAE,IAAI,UAAQ,GAAG,MAAM,CAKlH;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,GAAE,MAA2B,EAAE,IAAI,UAAQ,GAAG,MAAM,CAGpH;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,gBAAgB,SAAY,GAAG,SAAS,GAAG,SAAS,CAQ3G"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Locale } from "./locale";
|
|
2
|
+
import type { Theme } from "./theme";
|
|
3
|
+
export type ViewMode = "schema" | "triples";
|
|
4
|
+
export type LayoutName = "fcose" | "dagre";
|
|
5
|
+
export type ViewerStatus = "loading" | "ready" | "error" | "empty" | "destroyed";
|
|
6
|
+
export interface OntologyViewerError {
|
|
7
|
+
message: string;
|
|
8
|
+
line?: number;
|
|
9
|
+
column?: number;
|
|
10
|
+
cause?: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface OntologyViewerOptions {
|
|
13
|
+
/** Initial CSS height. Safe numeric CSS lengths only. Default: 600px. */
|
|
14
|
+
height?: string;
|
|
15
|
+
/** Theme; auto follows prefers-color-scheme. */
|
|
16
|
+
theme?: Theme;
|
|
17
|
+
/** Locale; auto follows navigator.language. */
|
|
18
|
+
locale?: Locale;
|
|
19
|
+
/** Automatic graph layout. */
|
|
20
|
+
layout?: LayoutName;
|
|
21
|
+
/** Initial graph view. */
|
|
22
|
+
defaultView?: ViewMode;
|
|
23
|
+
/** Base IRI used when the Turtle source has no @base directive. */
|
|
24
|
+
baseIri?: string;
|
|
25
|
+
/** @deprecated Use baseIri. */
|
|
26
|
+
baseIRI?: string;
|
|
27
|
+
/** Opt-in localStorage namespace. Omit to disable persistence. */
|
|
28
|
+
storageKey?: string;
|
|
29
|
+
/** Inject the bundled stylesheet. Set false when loading style.css under strict CSP. */
|
|
30
|
+
injectStyles?: boolean;
|
|
31
|
+
/** Called after a valid graph has rendered. */
|
|
32
|
+
onReady?: (instance: OntologyViewerInstance) => void;
|
|
33
|
+
/** Called for parse or rendering failures. */
|
|
34
|
+
onError?: (error: OntologyViewerError, instance: OntologyViewerInstance) => void;
|
|
35
|
+
/** Called whenever the selected graph element changes. */
|
|
36
|
+
onSelectionChange?: (id: string | undefined) => void;
|
|
37
|
+
}
|
|
38
|
+
export interface InitializeOptions extends OntologyViewerOptions {
|
|
39
|
+
/** Scan matching source elements. */
|
|
40
|
+
startOnLoad?: boolean;
|
|
41
|
+
/** Selector used by the scanner. Default: pre.ontologyviewer plus inert text/turtle script sources. */
|
|
42
|
+
selector?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface OntologyViewerInstance {
|
|
45
|
+
readonly container: HTMLElement;
|
|
46
|
+
readonly sourceElement: HTMLElement;
|
|
47
|
+
readonly status: ViewerStatus;
|
|
48
|
+
readonly error: OntologyViewerError | undefined;
|
|
49
|
+
update(turtle: string): Promise<void>;
|
|
50
|
+
destroy(): void;
|
|
51
|
+
fit(): void;
|
|
52
|
+
runLayout(name?: LayoutName): void;
|
|
53
|
+
exportPng(): Promise<Blob>;
|
|
54
|
+
}
|
|
55
|
+
export interface OntologyViewerManager {
|
|
56
|
+
/** Resolves after the initial scan (if requested) has completed. */
|
|
57
|
+
readonly ready: Promise<readonly OntologyViewerInstance[]>;
|
|
58
|
+
instances(): readonly OntologyViewerInstance[];
|
|
59
|
+
getInstance(element: HTMLElement): OntologyViewerInstance | undefined;
|
|
60
|
+
/** Manually scan this document or subtree; no MutationObserver is installed. */
|
|
61
|
+
scan(root?: ParentNode): readonly OntologyViewerInstance[];
|
|
62
|
+
destroyAll(): void;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;AAC3C,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,WAAW,CAAC;AAEjF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,UAAU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C,KAAK,EAAE,OAAO,CAAC,SAAS,sBAAsB,EAAE,CAAC,CAAC;IAC3D,SAAS,IAAI,SAAS,sBAAsB,EAAE,CAAC;IAC/C,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,sBAAsB,GAAG,SAAS,CAAC;IACtE,gFAAgF;IAChF,IAAI,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,sBAAsB,EAAE,CAAC;IAC3D,UAAU,IAAI,IAAI,CAAC;CACpB"}
|
package/dist/viewer.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { OntologyViewerInstance, OntologyViewerOptions } from "./types";
|
|
2
|
+
export declare function createViewer(sourceElement: HTMLElement, initialTurtle: string, options: OntologyViewerOptions, onDestroy: () => void): OntologyViewerInstance;
|
|
3
|
+
//# sourceMappingURL=viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewer.d.ts","sourceRoot":"","sources":["../src/viewer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAmC,sBAAsB,EAAE,qBAAqB,EAA0B,MAAM,SAAS,CAAC;AAmCtI,wBAAgB,YAAY,CAC1B,aAAa,EAAE,WAAW,EAC1B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,MAAM,IAAI,GACpB,sBAAsB,CAidxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const MIN_ZOOM = 0.35;
|
|
2
|
+
export declare const MAX_ZOOM = 2.5;
|
|
3
|
+
export declare const DEFAULT_ZOOM = 1;
|
|
4
|
+
export declare function clampZoom(value: number): number;
|
|
5
|
+
export declare function readableFitZoom(fittedZoom: number, nodeCount: number): number;
|
|
6
|
+
export declare function zoomStep(current: number, direction: "in" | "out"): number;
|
|
7
|
+
export declare function zoomLabel(value: number): string;
|
|
8
|
+
//# sourceMappingURL=viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../src/viewport.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,eAAO,MAAM,QAAQ,MAAM,CAAC;AAC5B,eAAO,MAAM,YAAY,IAAI,CAAC;AAO9B,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAG7E;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAEzE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ontologyviewer",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Standalone read-only Turtle ontology viewer for web pages, with Schema and Triples diagrams powered by Cytoscape.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/ontologyviewer.esm.mjs",
|
|
7
|
+
"module": "./dist/ontologyviewer.esm.mjs",
|
|
8
|
+
"browser": "./dist/ontologyviewer.esm.mjs",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"jsdelivr": "./dist/ontologyviewer.esm.min.mjs",
|
|
11
|
+
"unpkg": "./dist/ontologyviewer.esm.min.mjs",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/ontologyviewer.esm.mjs"
|
|
17
|
+
},
|
|
18
|
+
"./style.css": "./dist/ontologyviewer.css"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/",
|
|
22
|
+
"README.md",
|
|
23
|
+
"README.ja.md",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"THIRD_PARTY_NOTICES.md"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "node esbuild.config.mjs && npm run build:types",
|
|
29
|
+
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"test": "vitest run",
|
|
32
|
+
"test:watch": "vitest",
|
|
33
|
+
"test:coverage": "vitest run --coverage",
|
|
34
|
+
"test:e2e": "playwright test",
|
|
35
|
+
"examples": "npm run build && node scripts/serve.mjs",
|
|
36
|
+
"lint": "eslint src/ tests/ examples/ playwright.config.ts",
|
|
37
|
+
"audit": "npm audit --omit=dev",
|
|
38
|
+
"check:docs": "node scripts/check-docs.mjs",
|
|
39
|
+
"check:tarball": "node scripts/check-tarball.mjs",
|
|
40
|
+
"verify": "npm run lint && npm run typecheck && npm run test:coverage && npm run check:docs && npm run build && npm run check:tarball && npm run audit",
|
|
41
|
+
"verify:full": "npm run verify && npm run test:e2e",
|
|
42
|
+
"clean": "rm -rf dist coverage playwright-report test-results *.tgz"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"ontology",
|
|
46
|
+
"turtle",
|
|
47
|
+
"rdf",
|
|
48
|
+
"owl",
|
|
49
|
+
"rdfs",
|
|
50
|
+
"skos",
|
|
51
|
+
"viewer",
|
|
52
|
+
"diagram",
|
|
53
|
+
"cytoscape"
|
|
54
|
+
],
|
|
55
|
+
"author": "yaggytter",
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "git+https://github.com/yaggytter/ontologyviewer.git"
|
|
60
|
+
},
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/yaggytter/ontologyviewer/issues"
|
|
63
|
+
},
|
|
64
|
+
"homepage": "https://github.com/yaggytter/ontologyviewer/tree/main#readme",
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=20"
|
|
70
|
+
},
|
|
71
|
+
"packageManager": "npm@11.5.1",
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"cytoscape": "3.30.4",
|
|
74
|
+
"cytoscape-dagre": "2.5.0",
|
|
75
|
+
"cytoscape-fcose": "2.2.0",
|
|
76
|
+
"n3": "1.22.3"
|
|
77
|
+
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"@axe-core/playwright": "4.13.0",
|
|
80
|
+
"@playwright/test": "1.62.1",
|
|
81
|
+
"@types/cytoscape": "3.21.8",
|
|
82
|
+
"@types/n3": "1.21.1",
|
|
83
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
84
|
+
"esbuild": "0.28.2",
|
|
85
|
+
"eslint": "10.8.1",
|
|
86
|
+
"happy-dom": "20.11.2",
|
|
87
|
+
"typescript": "6.0.3",
|
|
88
|
+
"typescript-eslint": "8.67.0",
|
|
89
|
+
"vitest": "4.1.11"
|
|
90
|
+
}
|
|
91
|
+
}
|