@aaswe/codebase-ai
Version:
AI-Assisted Software Engineering (AASWE) - Rich codebase context for IDE LLMs
260 lines • 11.8 kB
TypeScript
/**
* RDF Ontology Schema
*
* Defines the comprehensive ontology schema for code knowledge representation,
* optimized for both Neo4j ingestion and direct LLM consumption.
*/
import { RDFNamespaces } from './types';
/**
* Standard RDF Namespaces
*/
export declare const RDF_NAMESPACES: RDFNamespaces;
/**
* Core Ontology Classes
*/
export declare const ONTOLOGY_CLASSES: {
readonly Module: `${string}Module`;
readonly Class: `${string}Class`;
readonly Interface: `${string}Interface`;
readonly Method: `${string}Method`;
readonly Function: `${string}Function`;
readonly Property: `${string}Property`;
readonly Parameter: `${string}Parameter`;
readonly Type: `${string}Type`;
readonly Annotation: `${string}Annotation`;
readonly Dependency: `${string}Dependency`;
readonly Import: `${string}Import`;
readonly Export: `${string}Export`;
readonly Inheritance: `${string}Inheritance`;
readonly Implementation: `${string}Implementation`;
readonly Composition: `${string}Composition`;
readonly Association: `${string}Association`;
readonly Documentation: `${string}Documentation`;
readonly CodeExample: `${string}CodeExample`;
readonly Comment: `${string}Comment`;
readonly ArchitecturalPattern: `${string}Pattern`;
readonly DesignPattern: `${string}DesignPattern`;
readonly Component: `${string}Component`;
readonly Layer: `${string}Layer`;
readonly Service: `${string}Service`;
readonly BusinessDomain: `${string}Domain`;
readonly BusinessRule: `${string}Rule`;
readonly UseCase: `${string}UseCase`;
readonly Stakeholder: `${string}Stakeholder`;
readonly QualityAttribute: `${string}QualityAttribute`;
readonly Constraint: `${string}Constraint`;
readonly ComplexityMetric: `${string}ComplexityMetric`;
readonly QualityMetric: `${string}QualityMetric`;
readonly TechnicalDebt: `${string}TechnicalDebt`;
readonly CodeSmell: `${string}CodeSmell`;
readonly SecurityIssue: `${string}SecurityIssue`;
readonly TestCoverage: `${string}TestCoverage`;
readonly PerformanceMetric: `${string}PerformanceMetric`;
};
/**
* Core Ontology Properties
*/
export declare const ONTOLOGY_PROPERTIES: {
readonly name: `${string}name`;
readonly fullyQualifiedName: `${string}fullyQualifiedName`;
readonly signature: `${string}signature`;
readonly visibility: `${string}visibility`;
readonly type: `${string}type`;
readonly version: `${string}version`;
readonly language: `${string}language`;
readonly hasClass: `${string}hasClass`;
readonly hasMethod: `${string}hasMethod`;
readonly hasProperty: `${string}hasProperty`;
readonly hasParameter: `${string}hasParameter`;
readonly hasAnnotation: `${string}hasAnnotation`;
readonly hasDocumentation: `${string}hasDocumentation`;
readonly extends: `${string}extends`;
readonly implements: `${string}implements`;
readonly dependsOn: `${string}dependsOn`;
readonly imports: `${string}imports`;
readonly exports: `${string}exports`;
readonly calls: `${string}calls`;
readonly uses: `${string}uses`;
readonly contains: `${string}contains`;
readonly isAbstract: `${string}isAbstract`;
readonly isStatic: `${string}isStatic`;
readonly isAsync: `${string}isAsync`;
readonly isOptional: `${string}isOptional`;
readonly isReadonly: `${string}isReadonly`;
readonly isDeprecated: `${string}isDeprecated`;
readonly sourceFile: `${string}sourceFile`;
readonly startLine: `${string}startLine`;
readonly endLine: `${string}endLine`;
readonly startColumn: `${string}startColumn`;
readonly endColumn: `${string}endColumn`;
readonly summary: `${string}summary`;
readonly description: `${string}description`;
readonly example: `${string}example`;
readonly seeAlso: `${string}seeAlso`;
readonly since: `${string}since`;
readonly deprecated: `${string}deprecated`;
readonly followsPattern: `${string}followsPattern`;
readonly belongsToLayer: `${string}belongsToLayer`;
readonly providesService: `${string}providesService`;
readonly consumesService: `${string}consumesService`;
readonly belongsToDomain: `${string}belongsToDomain`;
readonly implementsRule: `${string}implementsRule`;
readonly supportsUseCase: `${string}supportsUseCase`;
readonly hasStakeholder: `${string}hasStakeholder`;
readonly satisfiesAttribute: `${string}satisfiesAttribute`;
readonly subjectToConstraint: `${string}subjectToConstraint`;
readonly hasComplexity: `${string}hasComplexity`;
readonly hasQualityMetric: `${string}hasQualityMetric`;
readonly hasTechnicalDebt: `${string}hasTechnicalDebt`;
readonly hasCodeSmell: `${string}hasCodeSmell`;
readonly hasSecurityIssue: `${string}hasSecurityIssue`;
readonly hasTestCoverage: `${string}hasTestCoverage`;
readonly hasPerformanceMetric: `${string}hasPerformanceMetric`;
readonly cyclomaticComplexity: `${string}cyclomaticComplexity`;
readonly cognitiveComplexity: `${string}cognitiveComplexity`;
readonly linesOfCode: `${string}linesOfCode`;
readonly maintainabilityIndex: `${string}maintainabilityIndex`;
readonly technicalDebtMinutes: `${string}technicalDebtMinutes`;
readonly coveragePercentage: `${string}coveragePercentage`;
readonly createdAt: `${string}createdAt`;
readonly modifiedAt: `${string}modifiedAt`;
readonly generatedAt: `${string}generatedAt`;
readonly checksum: `${string}checksum`;
};
/**
* Ontology Schema Definition
*
* Defines the complete schema with class hierarchies, property domains/ranges,
* and constraints for validation.
*/
export declare const ONTOLOGY_SCHEMA: {
readonly classes: {
readonly [ONTOLOGY_CLASSES.Module]: {
readonly subClassOf: readonly [`${string}Thing`];
readonly properties: readonly [`${string}name`, `${string}version`, `${string}language`, `${string}hasClass`, `${string}hasDocumentation`, `${string}dependsOn`];
};
readonly [ONTOLOGY_CLASSES.Class]: {
readonly subClassOf: readonly [`${string}CodeElement`];
readonly properties: readonly [`${string}name`, `${string}fullyQualifiedName`, `${string}visibility`, `${string}isAbstract`, `${string}extends`, `${string}implements`, `${string}hasMethod`, `${string}hasProperty`];
};
readonly [ONTOLOGY_CLASSES.Method]: {
readonly subClassOf: readonly [`${string}CodeElement`];
readonly properties: readonly [`${string}name`, `${string}signature`, `${string}visibility`, `${string}isStatic`, `${string}isAsync`, `${string}hasParameter`, `${string}calls`];
};
};
readonly properties: {
readonly [ONTOLOGY_PROPERTIES.name]: {
readonly domain: readonly [`${string}CodeElement`];
readonly range: readonly [`${string}string`];
readonly functional: true;
};
readonly [ONTOLOGY_PROPERTIES.extends]: {
readonly domain: readonly [`${string}Class`];
readonly range: readonly [`${string}Class`];
readonly functional: true;
};
readonly [ONTOLOGY_PROPERTIES.implements]: {
readonly domain: readonly [`${string}Class`];
readonly range: readonly [`${string}Interface`];
readonly functional: false;
};
readonly [ONTOLOGY_PROPERTIES.hasComplexity]: {
readonly domain: readonly [`${string}CodeElement`];
readonly range: readonly [`${string}ComplexityMetric`];
readonly functional: true;
};
};
};
/**
* LLM-Optimized Prefixes
*
* Human-readable prefixes for better LLM understanding
*/
export declare const LLM_PREFIXES: {
readonly '@prefix': {
readonly code: string;
readonly module: string;
readonly arch: string;
readonly business: string;
readonly quality: string;
readonly rdfs: string;
readonly owl: string;
readonly xsd: string;
};
};
/**
* Business Context Placeholders
*
* Template placeholders to guide developer enhancement of TTL files
*/
export declare const BUSINESS_CONTEXT_PLACEHOLDERS: {
readonly domain: {
readonly template: "# Business Domain: [REPLACE_WITH_DOMAIN]\n# Purpose: [DESCRIBE_BUSINESS_PURPOSE]\n# Key Stakeholders: [LIST_STAKEHOLDERS]";
readonly example: "# Business Domain: E-commerce Order Management\n# Purpose: Handles customer order processing and fulfillment\n# Key Stakeholders: Customers, Sales Team, Fulfillment Team";
};
readonly businessRules: {
readonly template: "# Business Rules:\n# - [RULE_1]: [DESCRIPTION]\n# - [RULE_2]: [DESCRIPTION]";
readonly example: "# Business Rules:\n# - Order Validation: Orders must have valid payment before processing\n# - Inventory Check: Items must be in stock before order confirmation";
};
readonly useCases: {
readonly template: "# Use Cases:\n# - [USE_CASE_1]: [DESCRIPTION]\n# - [USE_CASE_2]: [DESCRIPTION]";
readonly example: "# Use Cases:\n# - Place Order: Customer creates new order with items\n# - Process Payment: System validates and processes payment";
};
readonly qualityAttributes: {
readonly template: "# Quality Attributes:\n# - Performance: [TARGET_RESPONSE_TIME]\n# - Reliability: [AVAILABILITY_TARGET]\n# - Security: [SECURITY_REQUIREMENTS]";
readonly example: "# Quality Attributes:\n# - Performance: Order processing < 2 seconds\n# - Reliability: 99.9% uptime\n# - Security: PCI DSS compliance for payment data";
};
readonly constraints: {
readonly template: "# Constraints:\n# - Technical: [TECHNICAL_CONSTRAINTS]\n# - Business: [BUSINESS_CONSTRAINTS]\n# - Regulatory: [COMPLIANCE_REQUIREMENTS]";
readonly example: "# Constraints:\n# - Technical: Must integrate with legacy ERP system\n# - Business: Maximum 5% cart abandonment rate\n# - Regulatory: GDPR compliance for customer data";
};
};
/**
* Neo4j Optimization Hints
*
* Properties and structures optimized for Neo4j graph database ingestion
*/
export declare const NEO4J_OPTIMIZATION: {
readonly indexedProperties: readonly [`${string}name`, `${string}fullyQualifiedName`, `${string}type`, `${string}sourceFile`];
readonly relationshipTypes: {
readonly EXTENDS: "EXTENDS";
readonly IMPLEMENTS: "IMPLEMENTS";
readonly DEPENDS_ON: "DEPENDS_ON";
readonly HAS_METHOD: "HAS_METHOD";
readonly HAS_PROPERTY: "HAS_PROPERTY";
readonly CALLS: "CALLS";
readonly USES: "USES";
readonly BELONGS_TO: "BELONGS_TO";
};
readonly nodeLabels: {
readonly Module: "Module";
readonly Class: "Class";
readonly Interface: "Interface";
readonly Method: "Method";
readonly Property: "Property";
readonly Dependency: "Dependency";
};
};
/**
* Validation Rules
*
* Rules for validating RDF content and ensuring consistency
*/
export declare const VALIDATION_RULES: {
readonly required: {
readonly [ONTOLOGY_CLASSES.Module]: readonly [`${string}name`, `${string}language`, `${string}version`];
readonly [ONTOLOGY_CLASSES.Class]: readonly [`${string}name`, `${string}fullyQualifiedName`, `${string}visibility`];
readonly [ONTOLOGY_CLASSES.Method]: readonly [`${string}name`, `${string}signature`, `${string}visibility`];
};
readonly patterns: {
readonly fullyQualifiedName: RegExp;
readonly version: RegExp;
readonly visibility: RegExp;
};
readonly constraints: {
readonly maxStringLength: 1000;
readonly maxArraySize: 100;
readonly requiredNamespaces: any[];
};
};
//# sourceMappingURL=ontology.d.ts.map