<commit_before># 
#    Copyright (c) 2011 3 Round Stones Inc, Some Rights Reserved
# 
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
# 
#        http://www.apache.org/licenses/LICENSE-2.0
# 
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.

@prefix xsd:<http://www.w3.org/2001/XMLSchema#>.
@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 dcterms:<http://purl.org/dc/terms/>.
@prefix skosxl:<http://www.w3.org/2008/05/skos-xl#>.
@prefix foaf:<http://xmlns.com/foaf/0.1/>.
@prefix msg:<http://www.openrdf.org/rdf/2011/messaging#>.
@prefix calli:<http://callimachusproject.org/rdf/2009/framework#>.
@prefix prov:<http://www.w3.org/ns/prov#>.
@prefix :<#>.

<> a <SchemaGraph>.

<Folder> a <Creatable>, owl:Class;
    rdfs:subClassOf <Composite>, <PURL>, calli:Folder;
    rdfs:label "Folder";
    rdfs:comment "A folder of resources";
    owl:equivalentClass </callimachus/Folder>;
    rdfs:isDefinedBy <../../ontology>;
    calli:administrator </auth/groups/admin>;
    calli:author </auth/groups/users>,</auth/groups/staff>,</auth/groups/admin>;
    calli:icon <../images/folder.png>;
    calli:view <../templates/folder-view.xhtml>;
    calli:edit <../templates/folder-edit.xhtml>;
    calli:create <../templates/folder-create.xhtml>.

# when a Folder is created
:CreateFolder owl:intersectionOf (<creatable.ttl#PostCreate>
        [owl:onProperty msg:target; owl:hasValue <Folder> ]);
    calli:imports <java:org.callimachusproject.server.exceptions.BadRequest>;
    calli:script """
        var uri = location.toString();
        if (uri.lastIndexOf('/') != uri.length - 1)
            throw new BadRequest("Folders must end with a slash");
        return proceed();
    """.

################################
# POST file
################################

:PostFileSlug rdfs:subClassOf msg:Message;
    rdfs:subClassOf [owl:onProperty msg:target; owl:allValuesFrom <Folder>];
    rdfs:subClassOf [owl:onProperty msg:object; owl:allValuesFrom rdfs:Resource];<commit_msg>Require subscriber permission to view folder contents<commit_after># 
#    Copyright (c) 2011 3 Round Stones Inc, Some Rights Reserved
# 
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
# 
#        http://www.apache.org/licenses/LICENSE-2.0
# 
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.

@prefix xsd:<http://www.w3.org/2001/XMLSchema#>.
@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 dcterms:<http://purl.org/dc/terms/>.
@prefix skosxl:<http://www.w3.org/2008/05/skos-xl#>.
@prefix foaf:<http://xmlns.com/foaf/0.1/>.
@prefix msg:<http://www.openrdf.org/rdf/2011/messaging#>.
@prefix calli:<http://callimachusproject.org/rdf/2009/framework#>.
@prefix prov:<http://www.w3.org/ns/prov#>.
@prefix :<#>.

<> a <SchemaGraph>.

<Folder> a <Creatable>, owl:Class;
    rdfs:subClassOf <Composite>, <PURL>, calli:Folder;
    rdfs:label "Folder";
    rdfs:comment "A folder of resources";
    owl:equivalentClass </callimachus/Folder>;
    rdfs:isDefinedBy <../../ontology>;
    calli:administrator </auth/groups/admin>;
    calli:author </auth/groups/users>,</auth/groups/staff>,</auth/groups/admin>;
    calli:icon <../images/folder.png>;
    calli:view <../templates/folder-view.xhtml>;
    calli:edit <../templates/folder-edit.xhtml>;
    calli:create <../templates/folder-create.xhtml>.

# when a Folder is created
:CreateFolder owl:intersectionOf (<creatable.ttl#PostCreate>
        [owl:onProperty msg:target; owl:hasValue <Folder> ]);
    calli:imports <java:org.callimachusproject.server.exceptions.BadRequest>;
    calli:script """
        var uri = location.toString();
        if (uri.lastIndexOf('/') != uri.length - 1)
            throw new BadRequest("Folders must end with a slash");
        return proceed();
    """.

# folder view requires subscriber
:GetFolderViewPage owl:intersectionOf (<viewable.ttl#GetViewPage>
        [owl:onProperty msg:target; owl:allValuesFrom <Folder> ]);
    calli:rel "alternate";
    calli:method "GET";
    calli:query "view";
    calli:requires calli:subscriber;
    calli:type "text/html";
    calli:header "cache-control:no-cache";
    calli:script """
        return proceed();
    """.

################################
# POST file
################################

:PostFileSlug rdfs:subClassOf msg:Message;
    rdfs:subClassOf [owl:onProperty msg:target; owl:allValuesFrom <Folder>];
    rdfs:subClassOf [owl:onProperty msg:object; owl:allValuesFrom rdfs:Resource];
{'fraction_non_alphanumeric': 0.17383348581884722, 'fraction_numerical': 0.020494053064958828, 'mean_word_length': 3.867319679430098, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 16, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6476783', 'n_tokens_mistral': 1924, 'n_tokens_neox': 1796, 'n_words': 411}