# Editable RDFS vocabulary source. Assemble distributions with scripts/build_rdf.py.
# Copyright (c) 2026 CoreStory, Inc. — Apache-2.0

@prefix export: <https://ontologies.corestory.ai/sao/export/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sao: <https://ontologies.corestory.ai/sao/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

sao:AuditEntry a rdfs:Class ;
    rdfs:label "AuditEntry" ;
    rdfs:comment "A single record within an audit log" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf sao:NamedEntity .

sao:AuditLog a rdfs:Class ;
    rdfs:label "AuditLog" ;
    rdfs:comment "A tamper-evident record of system activities" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf sao:NamedEntity .

sao:Collection a rdfs:Class ;
    rdfs:label "Collection" ;
    rdfs:comment "A logical grouping of records (table, collection, bucket)" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf sao:NamedEntity .

sao:DataClassification a rdfs:Class ;
    rdfs:label "DataClassification" ;
    rdfs:comment "A sensitivity or handling category" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf sao:NamedEntity .

sao:DataLineage a rdfs:Class ;
    rdfs:label "DataLineage" ;
    rdfs:comment "The origin, transformation history, and movement of data" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf sao:NamedEntity .

sao:DataStore a rdfs:Class ;
    rdfs:label "DataStore" ;
    rdfs:comment "A persistence mechanism" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf sao:NamedEntity .

sao:Record a rdfs:Class ;
    rdfs:label "Record" ;
    rdfs:comment "A single persisted instance of data" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf sao:NamedEntity .

sao:RetentionPolicy a rdfs:Class ;
    rdfs:label "RetentionPolicy" ;
    rdfs:comment "Rules governing data lifecycle and deletion" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf sao:NamedEntity .

sao:Schema a rdfs:Class ;
    rdfs:label "Schema" ;
    rdfs:comment "The structural definition of stored data" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf sao:NamedEntity,
        sao:Versionable .

sao:SchemaVersion a rdfs:Class ;
    rdfs:label "SchemaVersion" ;
    rdfs:comment "A specific iteration of a schema" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf sao:NamedEntity .

sao:affects_resource a rdf:Property ;
    rdfs:label "affects_resource" ;
    rdfs:comment "[AuditEntry] `Resource` affected.",
        "`Resource` affected." ;
    rdfs:domain sao:AuditEntry ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Resource .

sao:archive_after_days a rdf:Property ;
    rdfs:label "archive_after_days" ;
    rdfs:comment "Days before archiving.",
        "[RetentionPolicy] Days before archiving." ;
    rdfs:domain sao:RetentionPolicy ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:integer .

sao:audit_performed_by_actor a rdf:Property ;
    rdfs:label "audit_performed_by_actor" ;
    rdfs:comment "[AuditEntry] `Actor` who performed action.",
        "`Actor` who performed action." ;
    rdfs:domain sao:AuditEntry ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Actor .

sao:auditlog_governed_by_retention a rdf:Property ;
    rdfs:label "auditlog_governed_by_retention" ;
    rdfs:comment "[AuditLog] `RetentionPolicy` for log retention.",
        "`RetentionPolicy` for log retention." ;
    rdfs:domain sao:AuditLog ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:RetentionPolicy .

sao:classification_type a rdf:Property ;
    rdfs:label "classification_type" ;
    rdfs:comment "Classification level.",
        "[DataClassification] Classification level." ;
    rdfs:domain sao:DataClassification ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:DataClassificationType .

sao:collection_structured_by_schema a rdf:Property ;
    rdfs:label "collection_structured_by_schema" ;
    rdfs:comment "[Collection] `Schema` defining structure.",
        "`Schema` defining structure." ;
    rdfs:domain sao:Collection ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Schema .

sao:conforms_to_schema a rdf:Property ;
    rdfs:label "conforms_to_schema" ;
    rdfs:comment "[Record] `Schema` for validation.",
        "`Schema` for validation." ;
    rdfs:domain sao:Record ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Schema .

sao:connection_string a rdf:Property ;
    rdfs:label "connection_string" ;
    rdfs:comment "Connection configuration.",
        "[DataStore] Connection configuration." ;
    rdfs:domain sao:DataStore ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:string .

sao:defines_operation_input a rdf:Property ;
    rdfs:label "defines_operation_input" ;
    rdfs:comment "[Schema] `Operation` entities using this schema as input.",
        "`Operation` entities using this schema as input." ;
    rdfs:domain sao:Schema ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Operation .

sao:defines_operation_output a rdf:Property ;
    rdfs:label "defines_operation_output" ;
    rdfs:comment "[Schema] `Operation` entities using this schema as output.",
        "`Operation` entities using this schema as output." ;
    rdfs:domain sao:Schema ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Operation .

sao:deletion_strategy a rdf:Property ;
    rdfs:label "deletion_strategy" ;
    rdfs:comment "How data is deleted (soft delete, hard delete, anonymize).",
        "[RetentionPolicy] How data is deleted (soft delete, hard delete, anonymize)." ;
    rdfs:domain sao:RetentionPolicy ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:string .

sao:derived_from_records a rdf:Property ;
    rdfs:label "derived_from_records" ;
    rdfs:comment "Source `Record` entities.",
        "[DataLineage] Source `Record` entities." ;
    rdfs:domain sao:DataLineage ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Record .

sao:details a rdf:Property ;
    rdfs:label "details" ;
    rdfs:comment "Additional context.",
        "[AuditEntry] Additional context." ;
    rdfs:domain sao:AuditEntry ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:string .

sao:encryption_required a rdf:Property ;
    rdfs:label "encryption_required" ;
    rdfs:comment "Encryption flag.",
        "[DataClassification] Encryption flag." ;
    rdfs:domain sao:DataClassification ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:boolean .

sao:governed_by_retention_policy a rdf:Property ;
    rdfs:label "governed_by_retention_policy" ;
    rdfs:comment "[Collection] `RetentionPolicy` for data lifecycle.",
        "`RetentionPolicy` for data lifecycle." ;
    rdfs:domain sao:Collection ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:RetentionPolicy .

sao:governs_audit_logs a rdf:Property ;
    rdfs:label "governs_audit_logs" ;
    rdfs:comment "[RetentionPolicy] `AuditLog` entities governed by this policy.",
        "`AuditLog` entities governed by this policy." ;
    rdfs:domain sao:RetentionPolicy ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:AuditLog .

sao:governs_collections a rdf:Property ;
    rdfs:label "governs_collections" ;
    rdfs:comment "[RetentionPolicy] `Collection` entities governed by this policy.",
        "`Collection` entities governed by this policy." ;
    rdfs:domain sao:RetentionPolicy ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Collection .

sao:governs_logs a rdf:Property ;
    rdfs:label "governs_logs" ;
    rdfs:comment "[RetentionPolicy] `Log` entities governed by this policy.",
        "`Log` entities governed by this policy." ;
    rdfs:domain sao:RetentionPolicy ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Log .

sao:handling_requirements a rdf:Property ;
    rdfs:label "handling_requirements" ;
    rdfs:comment "Required procedures.",
        "[DataClassification] Required procedures." ;
    rdfs:domain sao:DataClassification ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:string .

sao:has_collections a rdf:Property ;
    rdfs:label "has_collections" ;
    rdfs:comment "List of collections/tables.",
        "[DataStore] List of collections/tables." ;
    rdfs:domain sao:DataStore ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Collection .

sao:has_indexes a rdf:Property ;
    rdfs:label "has_indexes" ;
    rdfs:comment "[Collection] `DatabaseIndex[]` (inlined) -- index definitions for this collection (see Section 27).",
        "`DatabaseIndex[]` (inlined) -- index definitions for this collection (see Section 27)." ;
    rdfs:domain sao:Collection ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:DatabaseIndex .

sao:has_lineage a rdf:Property ;
    rdfs:label "has_lineage" ;
    rdfs:comment "[Record] `DataLineage` tracking origin and transformations.",
        "`DataLineage` tracking origin and transformations." ;
    rdfs:domain sao:Record ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:DataLineage .

sao:hosted_on_infrastructure a rdf:Property ;
    rdfs:label "hosted_on_infrastructure" ;
    rdfs:comment "[DataStore] `Infrastructure` hosting the data store.",
        "`Infrastructure` hosting the data store." ;
    rdfs:domain sao:DataStore ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Infrastructure .

sao:indexes a rdf:Property ;
    rdfs:label "indexes" ;
    rdfs:comment "Index definitions as strings (DEPRECATED -- use has_indexes)",
        "[Collection] Index definitions as strings (DEPRECATED -- use has_indexes)" ;
    rdfs:domain sao:Collection ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:string .

sao:is_backward_compatible a rdf:Property ;
    rdfs:label "is_backward_compatible" ;
    rdfs:comment "Compatibility flag.",
        "[SchemaVersion] Compatibility flag." ;
    rdfs:domain sao:SchemaVersion ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:boolean .

sao:migration_script a rdf:Property ;
    rdfs:label "migration_script" ;
    rdfs:comment "Migration from previous version.",
        "[SchemaVersion] Migration from previous version." ;
    rdfs:domain sao:SchemaVersion ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:string .

sao:outcome a rdf:Property ;
    rdfs:label "outcome" ;
    rdfs:comment "Result of the action (success, failure, error).",
        "[AuditEntry] Result of the action (success, failure, error)." ;
    rdfs:domain sao:AuditEntry ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:string .

sao:persists_aggregates a rdf:Property ;
    rdfs:label "persists_aggregates" ;
    rdfs:comment "[DataStore] `Aggregate` entities stored.",
        "`Aggregate` entities stored." ;
    rdfs:domain sao:DataStore ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Aggregate .

sao:persists_structures a rdf:Property ;
    rdfs:label "persists_structures" ;
    rdfs:comment "Code-level data structures persisted.",
        "[Collection] Code-level data structures persisted." ;
    rdfs:domain sao:Collection ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:DataStructure .

sao:records_action a rdf:Property ;
    rdfs:label "records_action" ;
    rdfs:comment "[AuditEntry] `Action` that was performed.",
        "`Action` that was performed." ;
    rdfs:domain sao:AuditEntry ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Action .

sao:retention_days a rdf:Property ;
    rdfs:label "retention_days" ;
    rdfs:comment "Days to retain data.",
        "[RetentionPolicy] Days to retain data." ;
    rdfs:domain sao:RetentionPolicy ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:integer .

sao:schema_type a rdf:Property ;
    rdfs:label "schema_type" ;
    rdfs:comment "Kind of schema.",
        "[Schema] Kind of schema." ;
    rdfs:domain sao:Schema ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:SchemaType .

sao:source_of_lineage a rdf:Property ;
    rdfs:label "source_of_lineage" ;
    rdfs:comment "Lineage entries where this record is a source.",
        "[Record] Lineage entries where this record is a source." ;
    rdfs:domain sao:Record ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:DataLineage .

sao:store_file_definitions a rdf:Property ;
    rdfs:label "store_file_definitions" ;
    rdfs:comment "[DataStore] `FileDefinition` entities associated with this store.",
        "`FileDefinition` entities associated with this store." ;
    rdfs:domain sao:DataStore ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:FileDefinition .

sao:store_read_by_pipelines a rdf:Property ;
    rdfs:label "store_read_by_pipelines" ;
    rdfs:comment "[DataStore] `DataPipeline` entities that read from this store.",
        "`DataPipeline` entities that read from this store." ;
    rdfs:domain sao:DataStore ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:DataPipeline .

sao:store_type a rdf:Property ;
    rdfs:label "store_type" ;
    rdfs:comment "Kind of data store.",
        "[DataStore] Kind of data store." ;
    rdfs:domain sao:DataStore ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:DataStoreType .

sao:store_written_by_pipelines a rdf:Property ;
    rdfs:label "store_written_by_pipelines" ;
    rdfs:comment "[DataStore] `DataPipeline` entities that write to this store.",
        "`DataPipeline` entities that write to this store." ;
    rdfs:domain sao:DataStore ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:DataPipeline .

sao:stored_in_collection a rdf:Property ;
    rdfs:label "stored_in_collection" ;
    rdfs:comment "Parent `Collection`.",
        "[Record] Parent `Collection`." ;
    rdfs:domain sao:Record ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Collection .

sao:stores_records a rdf:Property ;
    rdfs:label "stores_records" ;
    rdfs:comment "[Collection] `Record` instances.",
        "`Record` instances." ;
    rdfs:domain sao:Collection ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Record .

sao:structures_collections a rdf:Property ;
    rdfs:label "structures_collections" ;
    rdfs:comment "[Schema] `Collection` entities structured by this schema.",
        "`Collection` entities structured by this schema." ;
    rdfs:domain sao:Schema ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Collection .

sao:structures_events a rdf:Property ;
    rdfs:label "structures_events" ;
    rdfs:comment "[Schema] `Event` entities structured by this schema.",
        "`Event` entities structured by this schema." ;
    rdfs:domain sao:Schema ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Event .

sao:structures_messages a rdf:Property ;
    rdfs:label "structures_messages" ;
    rdfs:comment "[Schema] `Message` entities structured by this schema.",
        "`Message` entities structured by this schema." ;
    rdfs:domain sao:Schema ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Message .

sao:structures_resource_types a rdf:Property ;
    rdfs:label "structures_resource_types" ;
    rdfs:comment "[Schema] `ResourceType` entities structured by this schema.",
        "`ResourceType` entities structured by this schema." ;
    rdfs:domain sao:Schema ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:ResourceType .

sao:tracks_record a rdf:Property ;
    rdfs:label "tracks_record" ;
    rdfs:comment "Target `Record` being tracked.",
        "[DataLineage] Target `Record` being tracked." ;
    rdfs:domain sao:DataLineage ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Record .

sao:transformations a rdf:Property ;
    rdfs:label "transformations" ;
    rdfs:comment "List of transformations applied.",
        "[DataLineage] List of transformations applied." ;
    rdfs:domain sao:DataLineage ;
    rdfs:isDefinedBy sao: ;
    rdfs:range xsd:string .

sao:validates_records a rdf:Property ;
    rdfs:label "validates_records" ;
    rdfs:comment "[Schema] `Record` entities validated by this schema.",
        "`Record` entities validated by this schema." ;
    rdfs:domain sao:Schema ;
    rdfs:isDefinedBy sao: ;
    rdfs:range sao:Record .

sao:DataStoreType a rdfs:Datatype ;
    rdfs:label "DataStoreType" ;
    rdfs:comment "Types of data stores" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf rdfs:Literal ;
    export:permissibleValue <https://ontologies.corestory.ai/sao/export/values/DataStoreType/cache>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/data_lake>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/dead_letter_queue>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/document_db>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/flat_file>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/graph_db>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/isam>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/key_value_store>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/message_broker>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/object_storage>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/relational_db>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/search_index>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/time_series_db>,
        <https://ontologies.corestory.ai/sao/export/values/DataStoreType/vsam> .

sao:SchemaType a rdfs:Datatype ;
    rdfs:label "SchemaType" ;
    rdfs:comment "Types of data schemas" ;
    rdfs:isDefinedBy sao: ;
    rdfs:subClassOf rdfs:Literal ;
    export:permissibleValue <https://ontologies.corestory.ai/sao/export/values/SchemaType/api_schema>,
        <https://ontologies.corestory.ai/sao/export/values/SchemaType/document_schema>,
        <https://ontologies.corestory.ai/sao/export/values/SchemaType/event_schema>,
        <https://ontologies.corestory.ai/sao/export/values/SchemaType/message_schema>,
        <https://ontologies.corestory.ai/sao/export/values/SchemaType/table_schema> .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/cache> rdf:value "cache" ;
    rdfs:comment "In-memory cache." .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/data_lake> rdf:value "data_lake" ;
    rdfs:comment "Data lake for analytics." .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/dead_letter_queue> rdf:value "dead_letter_queue" ;
    rdfs:comment "Dead letter queue." .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/document_db> rdf:value "document_db" ;
    rdfs:comment "Document-oriented database (NoSQL)." .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/flat_file> rdf:value "flat_file" ;
    rdfs:comment "Sequential or flat file" .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/graph_db> rdf:value "graph_db" ;
    rdfs:comment "Graph database (Neo4j)." .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/isam> rdf:value "isam" ;
    rdfs:comment "Indexed Sequential Access Method file" .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/key_value_store> rdf:value "key_value_store" ;
    rdfs:comment "Key-value store (Redis, DynamoDB)." .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/message_broker> rdf:value "message_broker" ;
    rdfs:comment "Message broker or queue." .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/object_storage> rdf:value "object_storage" ;
    rdfs:comment "Object storage (S3, blob storage)." .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/relational_db> rdf:value "relational_db" ;
    rdfs:comment "Relational database (SQL)." .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/search_index> rdf:value "search_index" ;
    rdfs:comment "Search index (Elasticsearch, Solr)." .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/time_series_db> rdf:value "time_series_db" ;
    rdfs:comment "Time-series database." .

<https://ontologies.corestory.ai/sao/export/values/DataStoreType/vsam> rdf:value "vsam" ;
    rdfs:comment "IBM VSAM dataset" .

<https://ontologies.corestory.ai/sao/export/values/SchemaType/api_schema> rdf:value "api_schema" ;
    rdfs:comment "API request/response schema." .

<https://ontologies.corestory.ai/sao/export/values/SchemaType/document_schema> rdf:value "document_schema" ;
    rdfs:comment "Document or JSON schema." .

<https://ontologies.corestory.ai/sao/export/values/SchemaType/event_schema> rdf:value "event_schema" ;
    rdfs:comment "Event payload schema." .

<https://ontologies.corestory.ai/sao/export/values/SchemaType/message_schema> rdf:value "message_schema" ;
    rdfs:comment "Message format schema." .

<https://ontologies.corestory.ai/sao/export/values/SchemaType/table_schema> rdf:value "table_schema" ;
    rdfs:comment "Relational database table schema." .
