Files
wehub-resource-sync bf2343b7e4
Integration Tests - MySQL + Elasticsearch / Detect Changes (push) Waiting to run
Integration Tests - MySQL + Elasticsearch / integration-tests-mysql-elasticsearch (push) Blocked by required conditions
Integration Tests - PostgreSQL + Elasticsearch + Redis / Detect Changes (push) Waiting to run
Integration Tests - PostgreSQL + Elasticsearch + Redis / integration-tests-postgres-elasticsearch-redis (push) Blocked by required conditions
Integration Tests - PostgreSQL + OpenSearch / Detect Changes (push) Waiting to run
Integration Tests - PostgreSQL + OpenSearch / integration-tests-postgres-opensearch (push) Blocked by required conditions
Java Checkstyle / java-checkstyle (push) Waiting to run
Maven Collate Tests / maven-collate-ci (push) Waiting to run
OpenMetadata Service Unit Tests / Detect Changes (push) Waiting to run
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests (push) Blocked by required conditions
OpenMetadata Service Unit Tests / k8s_operator-unit-tests (push) Blocked by required conditions
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests-status (push) Blocked by required conditions
Publish Package to Maven Central Repository / publish-maven-packages (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:35:45 +08:00

52 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
#
# Script to generate RDF models from JSON schemas
# This creates JSON-LD contexts and OWL ontology from OpenMetadata schemas
#
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="$SCRIPT_DIR/.."
SCHEMA_PATH="$ROOT_DIR/openmetadata-spec/src/main/resources/json/schema"
OUTPUT_PATH="$ROOT_DIR/openmetadata-spec/src/main/resources/rdf"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${GREEN}OpenMetadata RDF Model Generator${NC}"
echo "=================================="
# Check if schema directory exists
if [ ! -d "$SCHEMA_PATH" ]; then
echo -e "${RED}Error: Schema directory not found at $SCHEMA_PATH${NC}"
exit 1
fi
# Create output directory if it doesn't exist
mkdir -p "$OUTPUT_PATH"
# Compile the generator if needed
echo -e "${YELLOW}Compiling RDF generator...${NC}"
cd "$ROOT_DIR"
mvn compile -pl openmetadata-service -DskipTests
# Run the generator
echo -e "${YELLOW}Generating RDF models...${NC}"
mvn exec:java \
-pl openmetadata-service \
-Dexec.mainClass="org.openmetadata.service.rdf.generator.RdfModelGenerator" \
-Dexec.args="$SCHEMA_PATH $OUTPUT_PATH"
if [ $? -eq 0 ]; then
echo -e "${GREEN}RDF model generation completed successfully!${NC}"
echo ""
echo "Generated files:"
echo "- JSON-LD contexts: $OUTPUT_PATH/contexts/"
echo "- OWL ontology: $OUTPUT_PATH/ontology/openmetadata-generated.ttl"
else
echo -e "${RED}RDF model generation failed!${NC}"
exit 1
fi