I have a use case where I'm trying to infer if a specific user has admin access to a resource. I'm using GraphDB.
My ontology contains Users, Roles, Permissions and Resources. A User can have N roles. Each Role has different Permissions, one of which is the administration permissions. And each Role applies to a specific Resource.
So what I'm trying to infer is a direct relation indicating that a user has admin access to the resource. I'm trying to make PropertyChains and rolification fit for my use case, but I don't quite make it work. I'm not sure if that's even the right path.
I draft this piece of the ontology here:
@prefix : <https://stackoverflow.com/myQuestion#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<https://stackoverflow.com/myQuestion>
a owl:Ontology .
:hasRole a owl:ObjectProperty ;
rdfs:domain :User ;
rdfs:range :Role .
:roleHasPermission a owl:ObjectProperty ;
rdfs:domain :Role ;
rdfs:range :Permission ;
:appliesToResource a owl:ObjectProperty ;
rdfs:domain :Role ;
rdfs:range :Resource .
:userHasAdminPermission a owl:ObjectProperty ;
rdfs:domain :User ;
rdfs:range :Resource .
:User a owl:Class .
:Role a owl:Class .
:Permission a owl:Class .
:Resource a owl:Class .
:AdminPermission a :Permission .
:OtherPermission a :Permission .