Examples of TripleImpl


Examples of org.apache.clerezza.rdf.core.impl.TripleImpl

        writeLock.lock();
        try {
          Iterator<Resource> valIter = hierarchyNode.getObjects(predicate);
          Set<Triple> triplesToBeRemoved = new HashSet<Triple>();
          while (valIter.hasNext()) {
            triplesToBeRemoved.add(new TripleImpl(subject, predicate, valIter.next()));
          }
          contentGraph.removeAll(triplesToBeRemoved);
        } finally {
          writeLock.unlock();
        }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.impl.TripleImpl

      Iterator<Resource> valIter, TripleCollection contentGraph,
      Map.Entry<Property, String> entry) {
    LiteralFactory fac = LiteralFactory.getInstance();
    Set<Triple> triplesToBeRemoved = new HashSet<Triple>();
    if (valIter.hasNext()) {
      triplesToBeRemoved.add(new TripleImpl(subject, predicate, valIter.next()));
    }
    contentGraph.removeAll(triplesToBeRemoved);
    contentGraph.add(new TripleImpl(subject, predicate,
        fac.createTypedLiteral(entry.getValue())));
  }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.impl.TripleImpl

    if (uriString.charAt(uriString.length()-1) != '/') {
      uriString += '/';
    }
    UriRef nodeUri = new UriRef(uriString);
    final MGraph mGraph = cgProvider.getContentGraph();
    Triple typeTriple = new TripleImpl(nodeUri, RDF.type, HIERARCHY.Collection);
    if (mGraph.contains(typeTriple)) {
      return Response.status(405) // Method Not Allowed
          .entity("Collection \"" + nodeUri.getUnicodeString()
          + "\" already exists.").build();
    }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.impl.TripleImpl

    TrailingSlash.enforceNotPresent(uriInfo);

    MGraph resultGraph = new SimpleMGraph();
    NonLiteral addUserPage = new BNode();

    resultGraph.add(new TripleImpl(addUserPage, RDF.type,
        USERMANAGER.AddUserPage));
    resultGraph.add(new TripleImpl(addUserPage, RDF.type,
        PLATFORM.HeadedPage));

    LockableMGraph contentGraph = (LockableMGraph) cgProvider.getContentGraph();
    Lock readLock = contentGraph.getLock().readLock();
    readLock.lock();
    try {
      Iterator<Triple> formFields = contentGraph.filter(null, RDF.type,
          USERMANAGER.UserFormField);
      while (formFields.hasNext()) {
        resultGraph.add(new TripleImpl(addUserPage,
            CUSTOMPROPERTY.customfield, formFields.next().getSubject()));
      }
    } finally {
      readLock.unlock();
    }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.impl.TripleImpl

    NonLiteral user = new BNode();
   
    Lock writeLock = contentGraph.getLock().writeLock();
    writeLock.lock();
    try {
      contentGraph.add(new TripleImpl(user, RDF.type, FOAF.Agent));
      contentGraph.add(new TripleImpl(user, PLATFORM.userName, new PlainLiteralImpl(
          userName)));
    } finally {
      writeLock.unlock();
    }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.impl.TripleImpl

                property, null);
            while (actualValues.hasNext()) {
              contentGraph.remove(actualValues.next());
            }
            for (int k = 0; k < values.length; k++) {
              contentGraph.add(new TripleImpl(user, property,
                  LiteralFactory.getInstance().createTypedLiteral(values[k])));
            }
          } finally {
            writeLock.unlock();
          }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.impl.TripleImpl

    AccessController.checkPermission(new UserManagerAccessPermission());
    LockableMGraph contentGraph = (LockableMGraph) cgProvider.getContentGraph();
    MGraph resultGraph = new SimpleMGraph();
    NonLiteral node = new BNode();

    resultGraph.add(new TripleImpl(resource, USERMANAGER.custominformation,
        node));
    resultGraph.add(new TripleImpl(node, RDF.type,
        USERMANAGER.CustomUserInformationPage));

    ArrayList<NonLiteral> customfields = new ArrayList<NonLiteral>();

    if (!roles.equals("") && roles.trim().length() > 0) {
      String[] rolesArray = roles.split(",");
      for (int i = 0; i < rolesArray.length; i++) {
        NonLiteral collection = customPropertyManager
            .getCustomPropertyCollection(PERMISSION.Role,
                rolesArray[i]);
        customfields.addAll(customPropertyManager
            .getCustomfieldsOfCollection(collection));
      }
    }

    for (NonLiteral customField : customfields) {
      UriRef property = customPropertyManager
  .getCustomFieldProperty(customField);

      if (userName != null && !userName.equals("")
          && userName.trim().length() > 0) {
        NonLiteral user = getCustomUser(contentGraph, userName);
        if (user != null) {
          Lock readLock = contentGraph.getLock().readLock();
          readLock.lock();
          try {
            Iterator<Triple> values = contentGraph.filter(user,
                property, null);
            while (values.hasNext()) {
              Resource value = values.next().getObject();
              resultGraph.add(new TripleImpl(customField,
                  CUSTOMPROPERTY.actualvalues, value));
            }
          } finally {
            readLock.unlock();
          }

        }
      }
      resultGraph.add(new TripleImpl(node, CUSTOMPROPERTY.customfield,
          customField));
    }
    return new GraphNode(node, new UnionMGraph(resultGraph, contentGraph));
  }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.impl.TripleImpl

    NonLiteral userPermissionPage = new BNode();
    Iterator<PermissionDescripton> permDescs = permGatherer.getAllPermissionDescriptors();
    while(permDescs.hasNext()) {
      PermissionDescripton desc = permDescs.next();
      BNode providedPermission = new BNode();
      resultGraph.add(new TripleImpl(userPermissionPage,
          USERMANAGER.permission, providedPermission));

      resultGraph.add(new TripleImpl(providedPermission,
          PERMISSION.javaPermissionEntry, new PlainLiteralImpl(desc.getJavaPermissionString())));

      resultGraph.add(new TripleImpl(providedPermission,
          DCTERMS.title, new PlainLiteralImpl(desc.getSimpleName())));

      resultGraph.add(new TripleImpl(providedPermission,
          DCTERMS.description, new PlainLiteralImpl(desc.getDescription())));
   
    resultGraph.add(new TripleImpl(userPermissionPage, RDF.type,
        PLATFORM.HeadedPage));
    resultGraph.add(new TripleImpl(userPermissionPage, RDF.type,
        USERMANAGER.UserPermissionPage));

    NonLiteral user = userManager.getUserByName(userName);
    if (user != null) {
      resultGraph.add(new TripleImpl(userPermissionPage,
          USERMANAGER.user, user));
      Iterator<NonLiteral> permissions = userManager
          .getPermissionsOfUser(user);
      return new GraphNode(userPermissionPage, new UnionMGraph(
          resultGraph, systemGraph));
View Full Code Here

Examples of org.apache.clerezza.rdf.core.impl.TripleImpl

    NonLiteral user = userManager.getUserByName(userName);
    if (user != null) {
      MGraph resultGraph = new SimpleMGraph();
      NonLiteral updateUserPage = new BNode();
      resultGraph.add(new TripleImpl(updateUserPage, RDF.type,
          USERMANAGER.UpdateUserPage));
      resultGraph.add(new TripleImpl(updateUserPage, RDF.type,
          PLATFORM.HeadedPage));
     

      LockableMGraph contentGraph = (LockableMGraph) cgProvider.getContentGraph();
      resultGraph.add(new TripleImpl(updateUserPage, USERMANAGER.user,
          user));

      Iterator<NonLiteral> userRoles = userManager
          .getRolesOfUser(user);

      ArrayList<NonLiteral> customfields = new ArrayList<NonLiteral>();

      while (userRoles.hasNext()) {
        customfields.addAll(customPropertyManager
            .getCustomfieldsOfCollection(customPropertyManager
                .getCustomPropertyCollection(PERMISSION.Role,
                    userRoles.next().toString())));
      }
      for (NonLiteral customfield : customfields) {
        resultGraph.add(new TripleImpl(updateUserPage,
            CUSTOMPROPERTY.customfield, customfield));
        UriRef property = customPropertyManager.getCustomFieldProperty(customfield);
        NonLiteral contentUser = getCustomUser(contentGraph, userName);

        Lock readLock = contentGraph.getLock().readLock();
        readLock.lock();
        try {
          Iterator<Triple> values = contentGraph.filter(contentUser,
              property, null);
          while (values.hasNext()) {
            PlainLiteral value = (PlainLiteral) values.next().getObject();
            resultGraph.add(new TripleImpl(customfield,
                CUSTOMPROPERTY.actualvalues, value));
          }
        } finally {
          readLock.unlock();
        }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.impl.TripleImpl

    AccessController.checkPermission(new UserManagerAccessPermission());
    TrailingSlash.enforceNotPresent(uriInfo);

    MGraph resultGraph = new SimpleMGraph();
    NonLiteral roleOverviewPage = new BNode();
    resultGraph.add(new TripleImpl(roleOverviewPage, RDF.type,
        USERMANAGER.RoleOverviewPage));
    resultGraph.add(new TripleImpl(roleOverviewPage, RDF.type,
        PLATFORM.HeadedPage));
   
    GraphNode result =  new GraphNode(roleOverviewPage,
        new UnionMGraph(resultGraph, systemGraph, cgProvider.getContentGraph()));
    addAvailableRoles(result);
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.