-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77212f0
commit 611da10
Showing
14 changed files
with
341 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Project management |
6 changes: 6 additions & 0 deletions
6
packages/core-v2/src/project/data-specification/data-specification.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* Represents data specification project type | ||
*/ | ||
export interface DataSpecification { | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
packages/core-v2/src/semantic-model/concepts/concepts-utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {Entity} from "../../entity-model"; | ||
import {SemanticModelClass, SemanticModelGeneralization, SemanticModelRelationship} from "./concepts"; | ||
|
||
export const SEMANTIC_MODEL_CLASS = "class"; // todo use proper IRI | ||
export function isSemanticModelClass(resource: Entity | null): resource is SemanticModelClass { | ||
return resource?.type.includes(SEMANTIC_MODEL_CLASS) ?? false; | ||
} | ||
|
||
export const SEMANTIC_MODEL_RELATIONSHIP = "relationship"; // todo use proper IRI | ||
export function isSemanticModelRelationship(resource: Entity | null): resource is SemanticModelRelationship { | ||
return resource?.type.includes(SEMANTIC_MODEL_RELATIONSHIP) ?? false; | ||
} | ||
|
||
export const SEMANTIC_MODEL_GENERALIZATION = "generalization"; // todo use proper IRI | ||
export function isSemanticModelGeneralization(resource: Entity | null): resource is SemanticModelGeneralization { | ||
return resource?.type.includes(SEMANTIC_MODEL_GENERALIZATION) ?? false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
export { | ||
SemanticModelClass, isSemanticModelClass, | ||
SemanticModelGeneralization, isSemanticModelGeneralization, | ||
SemanticModelRelationship, isSemanticModelRelationship | ||
} from "./concepts"; | ||
export * from "./concepts"; | ||
export * from "./concepts-utils"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/core-v2/src/semantic-model/usage/concepts/concepts-utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {Entity} from "../../../entity-model"; | ||
import {SemanticModelClassUsage, SemanticModelRelationshipUsage} from "./concepts"; | ||
|
||
export const SEMANTIC_MODEL_RELATIONSHIP_USAGE = "relationship-usage"; | ||
export const SEMANTIC_MODEL_CLASS_USAGE = "class-usage"; | ||
|
||
export function isSemanticModelRelationshipUsage(resource: Entity | null): resource is SemanticModelRelationshipUsage { | ||
return resource?.type.includes(SEMANTIC_MODEL_RELATIONSHIP_USAGE) ?? false; | ||
} | ||
|
||
export function isSemanticModelClassUsage(resource: Entity | null): resource is SemanticModelClassUsage { | ||
return resource?.type.includes(SEMANTIC_MODEL_CLASS_USAGE) ?? false; | ||
} |
49 changes: 49 additions & 0 deletions
49
packages/core-v2/src/semantic-model/usage/concepts/concepts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import {Entity} from "../../../entity-model"; | ||
import {LanguageString, NamedThing} from "../../concepts/concepts"; | ||
import {SEMANTIC_MODEL_CLASS_USAGE, SEMANTIC_MODEL_RELATIONSHIP_USAGE} from "./concepts-utils"; | ||
|
||
type Nullable<T> = { | ||
[P in keyof T]: P | null; | ||
} | ||
|
||
interface WithUsageNote { | ||
/** | ||
* Additional information about the usage of the entity. | ||
*/ | ||
usageNote: LanguageString | null; | ||
} | ||
|
||
/** | ||
* Usage semantically works as a subentity (subclass, subproperty), but is treated differently. Its public IRI is the | ||
* same as IRI of entity that is being used. Moreover, it should "shadow" the entity that is being used, because in the | ||
* given context this is more appropriate description of the entity. Each entity may have multiple usages. | ||
*/ | ||
export interface SemanticModelUsage extends Entity, WithUsageNote { | ||
/** | ||
* ID of the entity that is being used. Usage has same IRI as the entity that is being used. | ||
*/ | ||
usageOf: string; | ||
} | ||
|
||
export interface SemanticModelRelationshipUsage extends SemanticModelUsage, Nullable<NamedThing> { | ||
type: [typeof SEMANTIC_MODEL_RELATIONSHIP_USAGE]; | ||
|
||
ends: SemanticModelRelationshipEndUsage[]; | ||
} | ||
|
||
interface SemanticModelRelationshipEndUsage extends Nullable<NamedThing>, WithUsageNote { | ||
/** | ||
* Must be stricter or equal to the corresponding cardinality of the used entity. | ||
*/ | ||
cardinality: [number, number|null] | null; | ||
|
||
/** | ||
* Must be descendant or self of the corresponding concept of the used entity. | ||
* @todo is null default or no entity? | ||
*/ | ||
concept: string | null; | ||
} | ||
|
||
export interface SemanticModelClassUsage extends SemanticModelUsage, Nullable<NamedThing> { | ||
type: [typeof SEMANTIC_MODEL_CLASS_USAGE]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./concepts"; | ||
export * from "./concepts-utils"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './operations'; |
Oops, something went wrong.