Package org.apache.clerezza.rdf.utils

Examples of org.apache.clerezza.rdf.utils.GraphNode.addProperty()


        }
        GraphNode permissionNode = new GraphNode(new BNode(), systemGraph);
        permissionNode.addProperty(RDF.type, PERMISSION.Permission);
        // permissionNode.addProperty(DC.title, new PlainLiteralImpl(permissionName));
        subjectNode.addProperty(PERMISSION.hasPermission, permissionNode.getNode());
        permissionNode.addProperty(PERMISSION.javaPermissionEntry, new PlainLiteralImpl(permissionString));
        return subjectNode;
    }

    private boolean hasPermission(GraphNode userNode, String permissionString) {
        boolean has = false;
View Full Code Here


        final UnionMGraph resultGraph = new UnionMGraph(responseGraph, getRequestLogGraph());
        //This GraphNode represents the service within our result graph
        final GraphNode node = new GraphNode(serviceUri, resultGraph);
        //The triples will be added to the first graph of the union
        //i.e. to the in-memory responseGraph
        node.addProperty(RDF.type, Ontology.ResourceResolver);
        node.addProperty(RDFS.comment, new PlainLiteralImpl("A Resource Resolver"));
        if (iri != null) {
            node.addProperty(Ontology.describes, iri);
            addResourceDescription(iri, responseGraph);
            logRequest(iri, userAgent);
View Full Code Here

        //This GraphNode represents the service within our result graph
        final GraphNode node = new GraphNode(serviceUri, resultGraph);
        //The triples will be added to the first graph of the union
        //i.e. to the in-memory responseGraph
        node.addProperty(RDF.type, Ontology.ResourceResolver);
        node.addProperty(RDFS.comment, new PlainLiteralImpl("A Resource Resolver"));
        if (iri != null) {
            node.addProperty(Ontology.describes, iri);
            addResourceDescription(iri, responseGraph);
            logRequest(iri, userAgent);
        }
View Full Code Here

        //The triples will be added to the first graph of the union
        //i.e. to the in-memory responseGraph
        node.addProperty(RDF.type, Ontology.ResourceResolver);
        node.addProperty(RDFS.comment, new PlainLiteralImpl("A Resource Resolver"));
        if (iri != null) {
            node.addProperty(Ontology.describes, iri);
            addResourceDescription(iri, responseGraph);
            logRequest(iri, userAgent);
        }
        //What we return is the GraphNode we created with a template path
        return new RdfViewable("ResourceResolver", node, ResourceResolver.class);
View Full Code Here

        //asked to log in
        AccessController.doPrivileged(new PrivilegedAction<Object>() {
            public Object run() {
                final MGraph logGraph = getRequestLogGraph();
                GraphNode loggedRequest = new GraphNode(new BNode(), logGraph);
                loggedRequest.addProperty(RDF.type, Ontology.LoggedRequest);
                loggedRequest.addPropertyValue(DC.date, new Date());
                loggedRequest.addPropertyValue(Ontology.userAgent, userAgent);
                loggedRequest.addProperty(Ontology.requestedEntity, iri);
                return null;
            }
View Full Code Here

                final MGraph logGraph = getRequestLogGraph();
                GraphNode loggedRequest = new GraphNode(new BNode(), logGraph);
                loggedRequest.addProperty(RDF.type, Ontology.LoggedRequest);
                loggedRequest.addPropertyValue(DC.date, new Date());
                loggedRequest.addPropertyValue(Ontology.userAgent, userAgent);
                loggedRequest.addProperty(Ontology.requestedEntity, iri);
                return null;
            }
        });
       
    }
View Full Code Here

     * @return user node in system graph
     */
    private GraphNode createRole(String newRoleName, String comment) {
        BNode subject = new BNode();
        GraphNode roleNode = new GraphNode(subject, systemGraph);
        roleNode.addProperty(RDF.type, PERMISSION.Role);
        roleNode.addProperty(DC.title, new PlainLiteralImpl(newRoleName));
        roleNode.addProperty(RDFS.comment, new PlainLiteralImpl(comment));
        return roleNode;
    }

View Full Code Here

     */
    private GraphNode createRole(String newRoleName, String comment) {
        BNode subject = new BNode();
        GraphNode roleNode = new GraphNode(subject, systemGraph);
        roleNode.addProperty(RDF.type, PERMISSION.Role);
        roleNode.addProperty(DC.title, new PlainLiteralImpl(newRoleName));
        roleNode.addProperty(RDFS.comment, new PlainLiteralImpl(comment));
        return roleNode;
    }

    private Response storeRole(GraphNode roleNode, UriInfo uriInfo,
View Full Code Here

    private GraphNode createRole(String newRoleName, String comment) {
        BNode subject = new BNode();
        GraphNode roleNode = new GraphNode(subject, systemGraph);
        roleNode.addProperty(RDF.type, PERMISSION.Role);
        roleNode.addProperty(DC.title, new PlainLiteralImpl(newRoleName));
        roleNode.addProperty(RDFS.comment, new PlainLiteralImpl(comment));
        return roleNode;
    }

    private Response storeRole(GraphNode roleNode, UriInfo uriInfo,
            String roleName,
View Full Code Here

     */
    private GraphNode createUser(String newUserName) {
        BNode subject = new BNode();

        GraphNode userNode = new GraphNode(subject, systemGraph);
        userNode.addProperty(RDF.type, FOAF.Agent);
        userNode.addProperty(PLATFORM.userName, new PlainLiteralImpl(newUserName));
        addRole(userNode, "BasePermissionsRole");
        return userNode;
    }
    // move later?
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.