PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX acl: <http://www.w3.org/ns/auth/acl#>
PREFIX linkml: <https://w3id.org/linkml/>
PREFIX ont: <http://www.w3.org/2006/gen/ont#>
PREFIX ns: <http://www.w3.org/2006/vcard/ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX vann: <http://purl.org/vocab/vann/>

<http://www.w3.org/ns/auth/acl> a owl:Ontology ;
  vann:preferredNamespacePrefix "acl" ;
  vann:preferredNamespaceUri "http://www.w3.org/ns/auth/acl#"^^xsd:anyURI ;
  sh:declare [
    sh:prefix "acl" ;
    sh:namespace "http://www.w3.org/ns/auth/acl#"^^xsd:anyURI
  ] , [
    sh:prefix "linkml" ;
    sh:namespace "https://w3id.org/linkml/"^^xsd:anyURI
  ] , [
    sh:prefix "rdfs" ;
    sh:namespace "http://www.w3.org/2000/01/rdf-schema#"^^xsd:anyURI
  ] , [
    sh:prefix "ont" ;
    sh:namespace "http://www.w3.org/2006/gen/ont#"^^xsd:anyURI
  ] , [
    sh:prefix "ns" ;
    sh:namespace "http://www.w3.org/2006/vcard/ns#"^^xsd:anyURI
  ] , [
    sh:prefix "foaf" ;
    sh:namespace "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
  ] .

acl:Write a owl:Class ;
  rdfs:label "write"@en ;
  rdfs:subClassOf acl:Access .

acl:Control a owl:Class ;
  rdfs:label "control"@en ;
  rdfs:comment "Allows read/write access to the ACL for the resource(s)" ;
  rdfs:subClassOf acl:Access .

acl:Read a owl:Class ;
  rdfs:label "read"@en ;
  rdfs:comment "The class of read operations" ;
  rdfs:subClassOf acl:Access .

acl:Access a owl:Class ;
  rdfs:label "access"@en ;
  rdfs:comment "Any kind of access to a resource. Don't use this, use R W and RW" .

acl:Append a owl:Class ;
  rdfs:label "append"@en ;
  rdfs:comment """Append accesses are specific write access which only add information, and do not remove information.
    For text files, for example, append access allows bytes to be added onto the end of the file.
    For RDF graphs, Append access allows adds triples to the graph but does not remove any.
    Append access is useful for dropbox functionality.
    Dropbox can be used for link notification, which the information added is a notification
    that a some link has been made elsewhere relevant to the given resource.
    """ ;
  rdfs:subClassOf acl:Access , acl:Write .

acl:Authorization a owl:Class ;
  rdfs:label "authorization" ;
  rdfs:comment """An element of access control,
    allowing agent to agents access of some kind to resources or classes of resources""" ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty acl:defaultForNew ;
    owl:allValuesFrom owl:Thing
  ] , [
    a owl:Restriction ;
    owl:onProperty acl:origin ;
    owl:allValuesFrom acl:Origin
  ] , [
    a owl:Restriction ;
    owl:onProperty acl:agent ;
    owl:allValuesFrom foaf:Agent
  ] , [
    a owl:Restriction ;
    owl:onProperty acl:accessTo ;
    owl:allValuesFrom ont:InformationResource
  ] , [
    a owl:Restriction ;
    owl:onProperty acl:mode ;
    owl:allValuesFrom rdfs:Class
  ] , [
    a owl:Restriction ;
    owl:onProperty acl:accessToClass ;
    owl:allValuesFrom rdfs:Class
  ] , [
    a owl:Restriction ;
    owl:onProperty acl:default ;
    owl:allValuesFrom owl:Thing
  ] , [
    a owl:Restriction ;
    owl:onProperty acl:agentClass ;
    owl:allValuesFrom rdfs:Class
  ] , [
    a owl:Restriction ;
    owl:onProperty acl:agentGroup ;
    owl:allValuesFrom ns:Group
  ] .

acl:Origin a owl:Class ;
  rdfs:label "Origin" ;
  rdfs:comment """An Origin is basically a web site
        (Note WITHOUT the trailing slash after the domain name and port in its URI)
        and is the basis for controlling access to data by web apps
        in the Same Origin Model of web security.
        All scripts from the same origin are given the same right.""" ;
  rdfs:seeAlso <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin> .

acl:AuthenticatedAgent a owl:Class ;
  rdfs:label "Anyone authenticated" ;
  rdfs:comment """A class of agents who have been authenticated.
In other words, anyone can access this resource, but not anonymously.
The social expectation is that the authentication process will provide an
identify and a name, or pseudonym.
(A new ID should not be minted for every access: the intent is that the user
is able to continue to use the ID for continues interactions with peers,
and for example to develop a reputation)
""" ;
  rdfs:subClassOf foaf:Agent .

ont:InformationResource a owl:Class ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty acl:accessControl ;
    owl:allValuesFrom ont:InformationResource
  ] .

foaf:Agent a owl:Class .

ns:Group a owl:Class .

acl:defaultForNew a owl:ObjectProperty ;
  rdfs:label "default access for new things in the object" ;
  rdfs:comment """THIS IS OBSOLETE AS OF 2017-08-01.   See 'default'.
        Was: A directory for which this authorization is used for new files in the directory.""" ;
  rdfs:domain acl:Authorization .

acl:origin a owl:ObjectProperty ;
  rdfs:label "origin" ;
  rdfs:comment """A web application, identified by its Origin, such as
        <https://scripts.example.com>, being given the right.
        When a user of the web application at a certain origin accesses the server,
        then the browser sets the Origin: header to warn that a possibly untrusted webapp
        is being used.
        Then, BOTH the user AND the origin must have the required access.""" ;
  rdfs:seeAlso <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin> ;
  rdfs:range acl:Origin ;
  rdfs:domain acl:Authorization .

acl:accessControl a owl:ObjectProperty ;
  rdfs:label "access control" ;
  rdfs:comment """The Access Control file for this information resource.
        This may of course be a virtual resource implemented by the access control system.
        Note that HTTP header `Link: <foo.acl>; rel=\"acl\"` can also be used for this.""" ;
  rdfs:seeAlso <https://solidproject.org/TR/wac#acl-link-relation> ;
  rdfs:range ont:InformationResource ;
  rdfs:domain ont:InformationResource .

acl:agent a owl:ObjectProperty ;
  rdfs:label "agent" ;
  rdfs:comment "A person or social entity to being given the right" ;
  rdfs:range foaf:Agent ;
  rdfs:domain acl:Authorization .

acl:owner a owl:ObjectProperty ;
  rdfs:label "owner"@en ;
  rdfs:comment """The person or other agent which owns this.
    For example, the owner of a file in a filesystem.
    There is a sense of \"right to control\".   Typically defaults to the agent who created
    something, but can be changed.""" ;
  rdfs:range foaf:Agent .

acl:accessTo a owl:ObjectProperty ;
  rdfs:label "to" ;
  rdfs:comment "The information resource to which access is being granted." ;
  rdfs:range ont:InformationResource ;
  rdfs:domain acl:Authorization .

acl:mode a owl:ObjectProperty ;
  rdfs:label "access mode" ;
  rdfs:comment "A mode of access such as read or write." ;
  rdfs:range rdfs:Class ;
  rdfs:domain acl:Authorization .

acl:accessToClass a owl:ObjectProperty ;
  rdfs:label "to all in" ;
  rdfs:comment "A class of information resources to which access is being granted." ;
  rdfs:range rdfs:Class ;
  rdfs:domain acl:Authorization .

acl:delegates a owl:ObjectProperty ;
  rdfs:label "delegates"@en ;
  rdfs:comment """Delegates a person or another agent to act on behalf of the agent.
    For example, Alice delegates Bob to act on behalf of Alice for ACL purposes.""" ;
  rdfs:range foaf:Agent .

acl:default a owl:ObjectProperty ;
  rdfs:label "default access for things in this" ;
  rdfs:comment """If a resource has no ACL file (it is 404),
        then access to the resource is given by the ACL of the immediately
        containing directory, or failing that (404) the ACL of the recursively next
        containing directory which has an ACL file.
        Within that ACL file,
        any Authorization which has that directory as its acl:default applies to the
        resource. (The highest directory must have an ACL file.)
""" ;
  rdfs:domain acl:Authorization .

acl:agentClass a owl:ObjectProperty ;
  rdfs:label "agent class" ;
  rdfs:comment "A class of persons or social entities to being given the right" ;
  rdfs:range rdfs:Class ;
  rdfs:domain acl:Authorization .

acl:agentGroup a owl:ObjectProperty ;
  rdfs:label "agent group" ;
  rdfs:comment """A group of persons or social entities to being given the right.
          The right is given to any entity which is a vcard:member of the group,
          as defined by the document received when the Group is dereferenced.""" ;
  rdfs:range ns:Group ;
  rdfs:domain acl:Authorization .

vann:preferredNamespacePrefix a owl:AnnotationProperty .

vann:preferredNamespaceUri a owl:AnnotationProperty .

sh:declare a owl:AnnotationProperty .

sh:prefix a owl:AnnotationProperty .

sh:namespace a owl:AnnotationProperty .
