@prefix empx: <https://empower-x.io/ns/rulebook#> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .

<https://empower-x.io/ns/rulebook#> a owl:Ontology ;
    rdfs:label "EMPOWER-X Rulebook vocabulary"@en ;
    owl:versionInfo "1.0 (draft)" ;
    rdfs:comment "Terms used by the EMPOWER-X machine-readable Rulebook files. The human-readable Rulebook pages prevail."@en .

# ---- Access levels (R5.2)
empx:AccessLevel a owl:Class ; rdfs:label "Access level"@en .
empx:accessLevel a owl:ObjectProperty ; rdfs:label "access level"@en ; rdfs:range empx:AccessLevel ;
    rdfs:comment "The one access level of an offer, set by the data holder (R5.2)."@en .
empx:Open a empx:AccessLevel, skos:Concept ; rdfs:label "Open"@en ; skos:definition "Any wallet may order."@en .
empx:Participants a empx:AccessLevel, skos:Concept ; rdfs:label "Participants"@en ; skos:definition "Holders of a valid EMPOWER-X membership credential may order."@en .
empx:Restricted a empx:AccessLevel, skos:Concept ; rdfs:label "Restricted"@en ; skos:definition "Named participants or roles chosen by the data holder may order."@en .
empx:ComputeToDataOnly a empx:AccessLevel, skos:Concept ; rdfs:label "Compute-to-data only"@en ; skos:definition "As one of the other levels, but raw data never leaves the provider."@en .

# ---- Offer properties (R6.1, R3.4, R3.1)
empx:dataHolder a owl:ObjectProperty ; rdfs:label "data holder"@en ; rdfs:comment "The organisation that holds the rights to the data in an offer."@en .
empx:containsPersonalData a owl:DatatypeProperty ; rdfs:label "personal-data flag"@en ; rdfs:range xsd:boolean .
empx:licenceStatus a owl:ObjectProperty ; rdfs:label "licence status"@en .
empx:LicenceApproved a skos:Concept ; rdfs:label "Licence approved by the data holder"@en .
empx:LicencePending a skos:Concept ; rdfs:label "Licence pending"@en .
empx:knownLimitations a owl:DatatypeProperty ; rdfs:label "known limitations"@en ; rdfs:range xsd:string .
empx:approvedAlgorithm a owl:ObjectProperty ; rdfs:label "approved algorithm"@en ; rdfs:comment "An algorithm approved to run on a compute-to-data offer (R5.3)."@en .
empx:outboundNetworkAccess a owl:DatatypeProperty ; rdfs:label "outbound network access"@en ; rdfs:range xsd:boolean .
empx:networkListing a owl:DatatypeProperty ; rdfs:label "network listing"@en ; rdfs:comment "Which network a listing belongs to, when an offer also exists on a test network (R6.2)."@en .

# ---- Roles (R1.3)
empx:Role a owl:Class ; rdfs:label "Role"@en .
empx:GovernanceAuthority a empx:Role ; rdfs:label "Governance Authority"@en .
empx:DataSpaceOperator a empx:Role ; rdfs:label "Data space operator"@en .
empx:TechnologyProvider a empx:Role ; rdfs:label "Technology provider"@en .
empx:DataProvider a empx:Role ; rdfs:label "Data provider"@en .
empx:DataConsumer a empx:Role ; rdfs:label "Data consumer"@en .
empx:ServiceProvider a empx:Role ; rdfs:label "Service provider"@en .
empx:ComputeProvider a empx:Role ; rdfs:label "Compute provider"@en .
empx:TrustAnchor a empx:Role ; rdfs:label "Trust anchor"@en .
empx:FederationPartner a empx:Role ; rdfs:label "Federation partner"@en .

# ---- Membership (R1.4, R5.1)
empx:MembershipCredential a owl:Class ; rdfs:label "EMPOWER-X membership credential"@en .
empx:MembershipStatus a owl:Class ; rdfs:label "Membership status"@en .
empx:Active a empx:MembershipStatus ; rdfs:label "Active"@en .
empx:Suspended a empx:MembershipStatus ; rdfs:label "Suspended"@en .
empx:Revoked a empx:MembershipStatus ; rdfs:label "Revoked"@en .

# ---- ODRL extensions used by the policy templates (R5.2, R5.3)
empx:membershipStatus a odrl:LeftOperand ; rdfs:label "membership status"@en ;
    rdfs:comment "Status of the requesting party's EMPOWER-X membership credential, checked against the status list."@en .
empx:role a odrl:LeftOperand ; rdfs:label "role"@en ; rdfs:comment "Role stated in the requesting party's membership credential."@en .
empx:algorithm a odrl:LeftOperand ; rdfs:label "algorithm"@en ; rdfs:comment "Identifier (DID) of the algorithm a compute job runs."@en .
empx:networkEgress a odrl:LeftOperand ; rdfs:label "network egress"@en ; rdfs:comment "Whether a compute job may open outbound network connections."@en .
empx:compute a odrl:Action ; rdfs:label "compute"@en ; odrl:includedIn odrl:use ;
    rdfs:comment "Run an approved algorithm where the data is held and receive only the result (compute-to-data)."@en .
