Package org.apache.clerezza.rdf.core

Examples of org.apache.clerezza.rdf.core.NonLiteral


        TripleCollection tc = provider.getTriples(graphUriRef);
        assertNotNull(tc);
    }

    private Triple createTestTriple() {
        NonLiteral subject = new BNode() {};
        UriRef predicate = new UriRef("http://test.com/");
        NonLiteral object = new UriRef("http://test.com/myObject");
        return new TripleImpl(subject, predicate, object);
    }
View Full Code Here


    }
    return true;
  }

  private static Triple map(Triple triple, Map<BNode, BNode> map) {
    final NonLiteral oSubject = triple.getSubject();

    NonLiteral subject = oSubject instanceof BNode ?
      map.get((BNode)oSubject) : oSubject;

    Resource oObject = triple.getObject();
    Resource object = oObject instanceof BNode ?
      map.get((BNode)oObject) : oObject;
View Full Code Here

   */
  private class RenderFunction implements RenderingFunction<Object, String> {

    @Override
    public String process(Object... values) throws IOException {
      NonLiteral resource = (NonLiteral) values[0];
      GraphNode graphNode = new GraphNode(resource, graph);
      String mode = null;
      if (values.length > 1) {
        mode = (String) values[1];
      }
View Full Code Here

    }
    if (nextTo > userList.size()) {
      nextTo = userList.size();
    }

    NonLiteral userOverviewPage = new BNode();
    List<Resource> resultList = new RdfList(userOverviewPage, resultGraph);
    for (int i = from; i < to; i++) {
      resultList.add(userList.get(i).getNode());
    }
   
View Full Code Here

  public GraphNode addUser(@Context UriInfo uriInfo) {
    AccessController.checkPermission(new UserManagerAccessPermission());
    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));
View Full Code Here

    if (!message.isEmpty()) {
      returnInputErrorMessages(message);
    }
    userManager.storeUser(userName, email, psw, userRoles, pathPrefix);
    LockableMGraph contentGraph = (LockableMGraph) cgProvider.getContentGraph();
    NonLiteral user = new BNode();
   
    Lock writeLock = contentGraph.getLock().writeLock();
    writeLock.lock();
    try {
      contentGraph.add(new TripleImpl(user, RDF.type, FOAF.Agent));
View Full Code Here

    saveCustomUserInformation(contentGraph, userName, userRoles, form);
    return RedirectUtil.createSeeOtherResponse("list-users", uriInfo);
  }

  private Set<String> retrieveRoleTitlesOfUser(String userName) {
    NonLiteral user = userManager.getUserByName(userName);
    Iterator<NonLiteral> roles = userManager.getRolesOfUser(user);
    Set<String> userRoleTitles = new HashSet<String>();
    Lock lock = systemGraph.getLock().readLock();
    lock.lock();
    try {
View Full Code Here

    return userRoleTitles;
  }

  private void saveCustomUserInformation(LockableMGraph contentGraph,
      String userName, List<String> roles, MultiPartBody form) {
    NonLiteral user = getCustomUser(contentGraph, userName);
    if (user != null) {
      for (int i = 0; i < roles.size(); i++) {
        NonLiteral collection = customPropertyManager
            .getCustomPropertyCollection(PERMISSION.Role, roles
    .get(i));
        ArrayList<UriRef> customproperties = customPropertyManager.getPropertiesOfCollection(collection);
        for (UriRef property : customproperties) {
          String[] values = form.getTextParameterValues(property.getUnicodeString());
View Full Code Here

      @QueryParam(value = "user") String userName,
      @Context UriInfo uriInfo) throws ParseException {
    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,
View Full Code Here

    AccessController.checkPermission(new UserManagerAccessPermission());
    checkUserParam(userName);
    userManager.deleteUser(userName);
    LockableMGraph contentGraph = (LockableMGraph) cgProvider.getContentGraph();
    NonLiteral user = getCustomUser(contentGraph, userName);
    if (user != null) {
      Lock writeLock = contentGraph.getLock().writeLock();
      writeLock.lock();
      try {
        Iterator<Triple> userTriples = contentGraph.filter(user, null, null);
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.NonLiteral

Copyright © 2018 www.massapicom. 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.